Files
Linux/kernel
Gao Feng 63259457a2 proc/sysctl: fix the int overflow for jiffies conversion
do_proc_dointvec_jiffies_conv() uses LONG_MAX/HZ as the max value to
avoid overflow.  But actually the *valp is int type, so it still causes
overflow.

For example,

  echo 2147483647 > ./sys/net/ipv4/tcp_keepalive_time

Then,

  cat ./sys/net/ipv4/tcp_keepalive_time

The output is "-1", it is not expected.

Now use INT_MAX/HZ as the max value instead LONG_MAX/HZ to fix it.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Gao Feng <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2017-05-08 17:15:10 -07:00
..
…
…
…
2017-01-12 07:01:56 -07:00
…
…
…
…
…
…
2017-04-21 20:30:46 +08:00
…
…
2017-04-21 22:46:25 -05:00
…
2016-12-22 22:58:37 -05:00