diff options
author | Qixue Xiao <s2exqx@gmail.com> | 2013-12-20 04:51:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-20 15:21:57 -0500 |
commit | 351d6204bfc814a1aee300296d2f54460ffff172 (patch) | |
tree | 8ee90f783108f35518c50fb9a43f2191e88e5a00 /drivers/tty | |
parent | 4903713cac8bd41b576e4e3eff3d54bd199a7737 (diff) |
tty: an overflow of multiplication in drivers/tty/cyclades.c
there is an overflow in the code :
cyz_polling_cycle = (arg * HZ) / 1000,
the multiplicator arg comes from user, so it may be an overflow if
arg is a big number. And the value of cyc_polling_cycle will be
wrong when it is used next time.
Reported-by: Qixue Xiao <xiaoqixue_1@163.com>
Suggested-by: Yongjian Xu <xuyongjiande@gmail.com>
Suggested-by: Yu Chen <chyyuu@gmail.com>
Signed-off-by: Qixue Xiao <xiaoqixue_1@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/cyclades.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index 33f83fee9fae..a57bb5ab761c 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c | |||
@@ -2709,6 +2709,8 @@ cy_ioctl(struct tty_struct *tty, | |||
2709 | break; | 2709 | break; |
2710 | #ifndef CONFIG_CYZ_INTR | 2710 | #ifndef CONFIG_CYZ_INTR |
2711 | case CYZSETPOLLCYCLE: | 2711 | case CYZSETPOLLCYCLE: |
2712 | if (arg > LONG_MAX / HZ) | ||
2713 | return -ENODEV; | ||
2712 | cyz_polling_cycle = (arg * HZ) / 1000; | 2714 | cyz_polling_cycle = (arg * HZ) / 1000; |
2713 | break; | 2715 | break; |
2714 | case CYZGETPOLLCYCLE: | 2716 | case CYZGETPOLLCYCLE: |