projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.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
|
blame
|
history
diff --git
a/drivers/char/lp.c
b/drivers/char/lp.c
index 0913d79424d3a3e81930a4c138979a621de18605..c4094c4e22c11dda9647d3d472a18203f98f9649 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: