Heinrich Schuchardt 230633d109 kernel/sysctl.c: detect overflows when converting to int
When converting unsigned long to int overflows may occur.  These currently
are not detected when writing to the sysctl file system.

E.g. on a system where int has 32 bits and long has 64 bits
  echo 0x800001234 > /proc/sys/kernel/threads-max
has the same effect as
  echo 0x1234 > /proc/sys/kernel/threads-max

The patch adds the missing check in do_proc_dointvec_conv.

With the patch an overflow will result in an error EINVAL when writing to
the the sysctl file system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-17 09:04:08 -04:00
..
2015-04-11 22:24:41 -04:00
2015-04-11 22:27:55 -04:00
2014-10-09 22:26:04 -04:00
2014-08-08 15:57:18 -07:00
2015-04-12 21:03:31 +02:00
2015-04-12 20:58:24 +02:00
2015-02-24 08:41:07 +01:00
2014-09-10 15:42:12 -07:00
2015-02-17 14:34:51 -08:00
2014-12-04 14:34:54 -05:00
2014-12-22 15:40:48 +01:00
2015-01-17 10:02:23 +13:00
2014-12-10 17:41:10 -08:00
2015-04-06 11:16:04 -04:00