]> git.baikalelectronics.ru Git - kernel.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)
committerAlasdair G Kergon <agk@redhat.com>
Mon, 16 Mar 2009 16:56:01 +0000 (16:56 +0000)
commitf5fce5ec89fc9c1c12f24921d6efb630b5950e95
tree898f91bc16492588dc74f191979dcca5462cdc36
parentf625a9048c39ef7d44c66894b633a4c0852bc95e
dm ioctl: validate name length when renaming

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).

Cc: stable@kernel.org
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>
drivers/md/dm-ioctl.c