提交 faec8ab4 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

Staging: lustre: integer overflow in ioctl

hdr->ioc_len is a user controlled u32 so the addition can overflow,
especially on 32 bit systems.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b311ebac
...@@ -57,7 +57,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg) ...@@ -57,7 +57,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
return -EINVAL; return -EINVAL;
} }
if (hdr->ioc_len + buf >= end) { if (hdr->ioc_len >= end - buf) {
CERROR("PORTALS: user buffer exceeds kernel buffer\n"); CERROR("PORTALS: user buffer exceeds kernel buffer\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册