summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/proc-v7m.S
diff options
context:
space:
mode:
authorChristian Brauner <christian@brauner.io>2019-03-08 01:29:43 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-08 03:32:02 +0100
commit32a5ad9c22852e6bd9e74bdec5934ef9d1480bc5 (patch)
tree7d6434cbbae1e8036702c03e7bc8d4dc2103222a /arch/arm/mm/proc-v7m.S
parentsysctl: handle overflow in proc_get_long (diff)
downloadlinux-32a5ad9c22852e6bd9e74bdec5934ef9d1480bc5.tar.xz
linux-32a5ad9c22852e6bd9e74bdec5934ef9d1480bc5.zip
sysctl: handle overflow for file-max
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. This commit sets the max and min value for file-max. The max value is set to long int. Any higher value cannot currently be used as the percpu counters are long ints and not unsigned integers. Note that the file-max value is ultimately parsed via __do_proc_doulongvec_minmax(). This function does not report error when min or max are exceeded. Which means if a value largen that long int is written userspace will not receive an error instead the old value will be kept. There is an argument to be made that this should be changed and __do_proc_doulongvec_minmax() should return an error when a dedicated min or max value are exceeded. However this has the potential to break userspace so let's defer this to an RFC patch. Link: http://lkml.kernel.org/r/20190107222700.15954-3-christian@brauner.io Signed-off-by: Christian Brauner <christian@brauner.io> Acked-by: Kees Cook <keescook@chromium.org> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Joe Lawrence <joe.lawrence@redhat.com> Cc: Luis Chamberlain <mcgrof@kernel.org> Cc: Waiman Long <longman@redhat.com> [christian@brauner.io: v4] Link: http://lkml.kernel.org/r/20190210203943.8227-3-christian@brauner.io Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm/mm/proc-v7m.S')
0 files changed, 0 insertions, 0 deletions