]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm ioctl: validate name length when renaming
authorMilan Broz <mbroz@redhat.com>
Mon, 16 Mar 2009 16:56:01 +0000 (16:56 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 23 Mar 2009 22:00:00 +0000 (15:00 -0700)
commite6e775fcaef2b0d5cb50dbc709bfa7f07762c3a6
tree9df60a0270ede0cc1252d06338c58da11f5cc89a
parente2c0fa5344dff02dcb837114a8b7b79034d1b268
dm ioctl: validate name length when renaming

commit bc0fd67feba2e0770aad85393500ba77c6489f1c upstream.

When renaming a mapped device validate the length of the new name.

The rename ioctl accepted any correctly-terminated string enclosed
within the data passed from userspace.  The other ioctls enforce a
size limit of DM_NAME_LEN.  If the name is changed and becomes longer
than that, the device can no longer be addressed by name.

Fix it by properly checking for device name length (including
terminating zero).

Signed-off-by: Milan Broz <mbroz@redhat.com>
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
Reviewed-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-ioctl.c