mirror of https://gitee.com/openkylin/linux.git
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: Yongjian Xu <xuyongjiande@gmail.com> Suggested-by: Qixue Xiao <s2exqx@gmail.com> Signed-off-by: Yu Chen <chyyuu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
138a6d7ea2
commit
1c2de820d6
|
@ -587,6 +587,8 @@ static int lp_do_ioctl(unsigned int minor, unsigned int cmd,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
switch ( cmd ) {
|
switch ( cmd ) {
|
||||||
case LPTIME:
|
case LPTIME:
|
||||||
|
if (arg > UINT_MAX / HZ)
|
||||||
|
return -EINVAL;
|
||||||
LP_TIME(minor) = arg * HZ/100;
|
LP_TIME(minor) = arg * HZ/100;
|
||||||
break;
|
break;
|
||||||
case LPCHAR:
|
case LPCHAR:
|
||||||
|
|
Loading…
Reference in New Issue