Re: [RESEND PATCH v3 2/2] sysctl: handle overflow for file-max

2019-01-11 Thread Christian Brauner
e file-max sysctl might also apply to other users of this function > where extra1 and/or2 extra2 are set. > > If there are no other users of this function where extra1 or extra2 are set, > just add a comment in the commit message: > > While this changes the behaviour of __do_pr

Re: [RESEND PATCH v3 2/2] sysctl: handle overflow for file-max

2019-01-10 Thread Christian Brauner
On Thu, Jan 10, 2019 at 03:55:59PM +0100, Dominik Brodowski wrote: > On Thu, Jan 10, 2019 at 03:50:05PM +0100, Christian Brauner wrote: > > On Tue, Jan 08, 2019 at 08:01:10AM +0100, Dominik Brodowski wrote: > > > On Mon, Jan 07, 2019 at 11:27:00PM +0100, Christian Brauner wrote: > > > > @@ -2833,6

Re: [RESEND PATCH v3 2/2] sysctl: handle overflow for file-max

2019-01-10 Thread Dominik Brodowski
On Thu, Jan 10, 2019 at 03:50:05PM +0100, Christian Brauner wrote: > On Tue, Jan 08, 2019 at 08:01:10AM +0100, Dominik Brodowski wrote: > > On Mon, Jan 07, 2019 at 11:27:00PM +0100, Christian Brauner wrote: > > > @@ -2833,6 +2836,10 @@ static int __do_proc_doulongvec_minmax(void *data, > > >

Re: [RESEND PATCH v3 2/2] sysctl: handle overflow for file-max

2019-01-10 Thread Christian Brauner
On Tue, Jan 08, 2019 at 08:01:10AM +0100, Dominik Brodowski wrote: > On Mon, Jan 07, 2019 at 11:27:00PM +0100, Christian Brauner wrote: > > @@ -2833,6 +2836,10 @@ static int __do_proc_doulongvec_minmax(void *data, > > struct ctl_table *table, int > > break; > >

Re: [RESEND PATCH v3 2/2] sysctl: handle overflow for file-max

2019-01-07 Thread Dominik Brodowski
On Mon, Jan 07, 2019 at 11:27:00PM +0100, Christian Brauner wrote: > @@ -2833,6 +2836,10 @@ static int __do_proc_doulongvec_minmax(void *data, > struct ctl_table *table, int > break; > if (neg) > continue; > +

[RESEND PATCH v3 2/2] sysctl: handle overflow for file-max

2019-01-07 Thread Christian Brauner
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 and returns -EINVAL when a long int is exceeded. Any higher value cannot currently