Skip to content

Commit

Permalink
Staging: lustre: integer overflow in ioctl
Browse files Browse the repository at this point in the history
hdr->ioc_len is a user controlled u32 so the addition can overflow,
especially on 32 bit systems.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Apr 3, 2015
1 parent b311eba commit faec8ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/libcfs/linux/linux-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
return -EINVAL;
}

if (hdr->ioc_len + buf >= end) {
if (hdr->ioc_len >= end - buf) {
CERROR("PORTALS: user buffer exceeds kernel buffer\n");
return -EINVAL;
}
Expand Down

0 comments on commit faec8ab

Please sign in to comment.