]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] Range checking in do_proc_dointvec_(userhz_)jiffies_conv
authorBart Samwel <bart@samwel.tk>
Fri, 24 Mar 2006 11:15:50 +0000 (03:15 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 24 Mar 2006 15:33:20 +0000 (07:33 -0800)
commit56982ef5204b2619d774de83872dc9416cf8afe4
treee93e3da369be7e9f55d15d02908606a43cecfbb9
parentd09e5231133d9a595a0d856a83f141054c94d7df
[PATCH] Range checking in do_proc_dointvec_(userhz_)jiffies_conv

When (integer) sysctl values are in either seconds or centiseconds, but
represented internally as jiffies, the allowable value range is decreased.
This patch adds range checks to the conversion routines.

For values in seconds: maximum LONG_MAX / HZ.

For values in centiseconds: maximum (LONG_MAX / HZ) * USER_HZ.

(BTW, does anyone else feel that an interface in seconds should not be
accepting negative values?)

Signed-off-by: Bart Samwel <bart@samwel.tk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/sysctl.c