[lkml]   [2018]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectoverflow on proc_nr_files

I've just got pinged by Lennart who discovered that you can get your
system into an unuseable state by writing something that exceeds a s64
into /proc/sys/fs/file-max. Say,

echo 20000000000000000000 > /proc/sys/fs/file-max

which will trigger an overflow and percpu_counter_read_positive() will
return 0 and cat /proc/sys/fs/file-max will return 0.

That effectively means you write that number and it succeeds and all is
well and a few seconds/minutes later your system just dies or gets into
an unuseable state pretty quickly

I wonder if we shouldn't accept overflows or - if we have no way in this
codepath to detect them - set it to some pre-defined hard-coded value.

Or maybe this is even a known issue and by design but before I work on a
patch here I just wanted to check.


 \ /
  Last update: 2018-10-11 16:11    [W:0.060 / U:1.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site