]> git.baikalelectronics.ru Git - kernel.git/commit
time: Validate user input in compat_settimeofday()
authorzhengbin <zhengbin13@huawei.com>
Sun, 7 Jul 2019 00:51:41 +0000 (08:51 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 7 Jul 2019 10:05:40 +0000 (12:05 +0200)
commit1e514ced0ce06febdee2fcfcc166aac65eab10f7
tree7100c6b23fae3ed167439119a7ca1ac71344d6eb
parentc5381dc9a8af141fa8110413a4aafb96e74a8e1c
time: Validate user input in compat_settimeofday()

The user value is validated after converting the timeval to a timespec, but
for a wide range of negative tv_usec values the multiplication overflow turns
them in positive numbers. So the 'validated later' is not catching the
invalid input.

Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/1562460701-113301-1-git-send-email-zhengbin13@huawei.com
kernel/time/time.c