sysctl: cap to ULONG_MAX in proc_get_long()
Quoted 2 lines
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.
Quoted 7 lines · Alexey Dobriyan
Quoted 3 lines
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.
Kees Cook
Reviewed-byQuoted 5 lines · Christian Brauner
Quoted 4 lines · Alexey Dobriyan
Quoted 3 lines
int
kstrtoul_bounded(const char *s, unsigned int base, char **trailing, unsigned long long *res)
Quoted 8 lines
Quoted 3 lines
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()inkernel/sysctl.cas 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/.
-Kees
Signature · 2 lines
Kees Cook Pixel Security