提交 1c2de820 编写于 作者: Y Yongjian Xu 提交者: Greg Kroah-Hartman

char: Int overflow in lp_do_ioctl().

arg comes from user-space, so int overflow may occur:
	LP_TIME(minor) = arg * HZ/100;
Reported-by: NYongjian Xu <xuyongjiande@gmail.com>
Suggested-by: NQixue Xiao <s2exqx@gmail.com>
Signed-off-by: NYu Chen <chyyuu@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 138a6d7e
......@@ -587,6 +587,8 @@ static int lp_do_ioctl(unsigned int minor, unsigned int cmd,
return -ENODEV;
switch ( cmd ) {
case LPTIME:
if (arg > UINT_MAX / HZ)
return -EINVAL;
LP_TIME(minor) = arg * HZ/100;
break;
case LPCHAR:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册