]> asedeno.scripts.mit.edu Git - linux.git/commit
sched/rt: Check integer overflow at usec to nsec conversion
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Wed, 27 Feb 2019 08:10:17 +0000 (11:10 +0300)
committerIngo Molnar <mingo@kernel.org>
Fri, 19 Apr 2019 11:42:09 +0000 (13:42 +0200)
commit1a010e29cfa00fee2888fd2fd4983f848cbafb58
treefe7a600c464f655492c109f38f6e427e0a08327b
parentbee9853932e90ce94bce4276ec6b7b06bc48070b
sched/rt: Check integer overflow at usec to nsec conversion

Example of unhandled overflows:

 # echo 18446744073709651 > cpu.rt_runtime_us
 # cat cpu.rt_runtime_us
 99

 # echo 18446744073709900 > cpu.rt_period_us
 # cat cpu.rt_period_us
 348

After this patch they will fail with -EINVAL.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/155125501739.293431.5252197504404771496.stgit@buzz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/rt.c