提交 351d6204 编写于 作者: Q Qixue Xiao 提交者: Greg Kroah-Hartman

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: NQixue Xiao <xiaoqixue_1@163.com>
Suggested-by: NYongjian Xu <xuyongjiande@gmail.com>
Suggested-by: NYu Chen <chyyuu@gmail.com>
Signed-off-by: NQixue Xiao <xiaoqixue_1@163.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4903713c
......@@ -2709,6 +2709,8 @@ cy_ioctl(struct tty_struct *tty,
break;
#ifndef CONFIG_CYZ_INTR
case CYZSETPOLLCYCLE:
if (arg > LONG_MAX / HZ)
return -ENODEV;
cyz_polling_cycle = (arg * HZ) / 1000;
break;
case CYZGETPOLLCYCLE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册