lkml.org 
[lkml]   [2018]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Re: [PATCH v1 1/2] sysctl: cap to ULONG_MAX in proc_get_long()
On Mon, Oct 15, 2018 at 12:32 PM, Christian Brauner
<christian@brauner.io> wrote:
> On Mon, Oct 15, 2018 at 9:27 PM Alexey Dobriyan <adobriyan@gmail.com> 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 would care.
>
> (Please keep the CC list when replying.)
>
> Whatever works; I prefer the local strtoul_cap_erange() in kernel/sysctl.c as
> well.

This does match the standard of "evolution" for the kernel: there is
only one user currently, so keep it a static in sysctl.c. If we grow a
greater need, we can move it into lib/.

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

--
Kees Cook
Pixel Security

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