libnvdimm: Fix security issue with DSM IOCTL.
authorJerry Hoemann <jerry.hoemann@hpe.com>
Wed, 6 Jan 2016 23:03:41 +0000 (16:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:08:39 +0000 (09:08 -0700)
commit83250e67a9d65a662c5fdec6075f3c2dee0e79a0
tree0e53178094834342c2db3645ab06dcf87e036335
parentb9d26f81ae9fa23988a5b503455f300bcef292fb
libnvdimm: Fix security issue with DSM IOCTL.

commit 07accfa9d1a8bac8262f6d24a94a54d2d1f35149 upstream.

Code attempts to prevent certain IOCTL DSM from being called
when device is opened read only.  This security feature can
be trivially overcome by changing the size portion of the
ioctl_command which isn't used.

Check only the _IOC_NR (i.e. the command).

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/bus.c