projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
138a6d7
)
char: Int overflow in lp_do_ioctl().
author
Yongjian Xu
<xuyongjiande@gmail.com>
Wed, 18 Dec 2013 07:45:12 +0000
(15:45 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 19 Dec 2013 00:39:54 +0000
(16:39 -0800)
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>
drivers/char/lp.c
patch
|
blob
|
history
diff --git
a/drivers/char/lp.c
b/drivers/char/lp.c
index
0913d79
..
c4094c4
100644
(file)
--- a/
drivers/char/lp.c
+++ b/
drivers/char/lp.c
@@
-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: