staging: lustre: improve length checks in ioctls
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Apr 2014 21:49:13 +0000 (00:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2014 22:08:45 +0000 (15:08 -0700)
commit2e5ed7fdfb23566cc3d85ce028b2f446c7bf057b
treebba27ad4a740dbbf1799b567c93b771d1977f126
parentcad7aa13a34dc83daa95ae5f9deca794021b4a2a
staging: lustre: improve length checks in ioctls

We copy "hdr->ioc_len" from the user twice but we only verify that it's
within the limit on the first copy.  Otherwise we could read unmapped
memory and Oops.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c