staging: lustre: integer overflow in obd_ioctl_is_invalid()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 28 Apr 2014 10:58:58 +0000 (13:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 May 2014 23:37:42 +0000 (19:37 -0400)
commitee02eb4ae43b3b65cbf4c49c6915fe9d63aac970
treeba20872386b9d4d75fdc5d221527cbcee53eef22
parentd36175e9d2c986ee653277928bfcbab6ddf6bb85
staging: lustre: integer overflow in obd_ioctl_is_invalid()

The obd_ioctl_getdata() function caps "data->ioc_len" at
OBD_MAX_IOCTL_BUFFER and then calls this obd_ioctl_is_invalid() to check
that the other values inside data are valid.

There are several lengths inside data but when they are added together
they must not be larger than "data->ioc_len".  The checks against
"(data->ioc_inllen1 > (1<<30))" are supposed to ensure that the addition
does not have an integer overflow.  But "(1<<30) * 4" actually can
overflow 32 bits, so the checks are insufficient.

I have changed it to "> OBD_MAX_IOCTL_BUFFER" instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre_lib.h