[PATCH 0/2] sysctl: cap file-max value at ULONG_MAX
From: Christian Brauner
Date: Sun Oct 14 2018 - 09:25:48 EST
Hey,
Currently, when writing
echo 18446744073709551616 > /proc/sys/fs/file-max
/proc/sys/fs/file-max will overflow and be set to 0. That quickly
crashes the system. Let's detect the overflow and set to ULONG_MAX in
this case effectively capping the value.
The patch tries to ensure that there is no other user visible change in
behavior for other values. Only when a maximum value is set for a
specific sysctl will it be capped on overflow. The details are outlined
in the commit message of the first commit.
(This patchset is in reference to https://lkml.org/lkml/2018/10/11/585.)
Thanks!
Christian
Christian Brauner (2):
sysctl: add overflow detection to proc_get_long()
sysctl: handle overflow for file-max
kernel/sysctl.c | 54 ++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 42 insertions(+), 12 deletions(-)
--
2.17.1