lkml.org 
[lkml]   [2015]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/3] sysctl: detect overflows when setting integers
Date
This patch series addresses undetected overflows when writing to the
sysctl file system.

E.g.
echo 0x800001234 > /proc/sys/kernel/threads-max
has the same effect as
echo 0x1234 > /proc/sys/kernel/threads-max

The first type of overflow occurs when converting from string to unsigned long.
The second type of overflow occurs when converting from unsigned long to int.

The first patch provide new functions kstrtoul_e and kstrtoull_e that can be
used to replace deprecated simple_strtoul and simple_strtoull.

The second patch replaces a call to simple_strtoul by kstrtoul_e. This is
necessary to detect overflows when converting from string to unsigned long.

The third patch adds checks when converting form unsigned long to int.

Heinrich Schuchardt (3):
lib/kstrtox.c: functions returning end of string
sysctl: detect overflows in proc_get_long
sysctl: detect overflows when converting to int

include/linux/kernel.h | 4 +++
kernel/sysctl.c | 13 +++++++--
lib/kstrtox.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 83 insertions(+), 5 deletions(-)

--
2.1.4



\
 
 \ /
  Last update: 2015-03-29 22:21    [W:0.118 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site