Re: Re: [PATCH v1 1/2] sysctl: cap to ULONG_MAX in proc_get_long()

2018-10-15 Thread Kees Cook
On Mon, Oct 15, 2018 at 12:32 PM, Christian Brauner wrote: > On Mon, Oct 15, 2018 at 9:27 PM Alexey Dobriyan wrote: >> >> > int kstrtoul_bounded(const char *s, unsigned int base, >> > char **trailing, unsigned long long *res) >> >> NO! The whole point is not have million variants of slightly diff

Re: Re: [PATCH v1 1/2] sysctl: cap to ULONG_MAX in proc_get_long()

2018-10-15 Thread Christian Brauner
On Mon, Oct 15, 2018 at 9:27 PM Alexey Dobriyan wrote: > > > int kstrtoul_bounded(const char *s, unsigned int base, > > char **trailing, unsigned long long *res) > > NO! The whole point is not have million variants of slightly different > integer parsing functions. > Cap it in the sysctl -- noone

Re: Re: [PATCH v1 1/2] sysctl: cap to ULONG_MAX in proc_get_long()

2018-10-15 Thread Alexey Dobriyan
> int kstrtoul_bounded(const char *s, unsigned int base, > char **trailing, unsigned long long *res) NO! The whole point is not have million variants of slightly different integer parsing functions. Cap it in the sysctl -- noone would care.