summaryrefslogtreecommitdiffstats
path: root/kernel/pid.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2019-05-14 15:45:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-14 19:52:51 -0700
commit3116ad38f51c98c81175151bd7358858a92a6031 (patch)
tree050a030511caba8c6a56c783087bd9900b1c885f /kernel/pid.c
parent2ea622b887e74497ce5aac5bfe247502b5786f56 (diff)
downloadlinux-3116ad38f51c98c81175151bd7358858a92a6031.tar.gz
linux-3116ad38f51c98c81175151bd7358858a92a6031.tar.bz2
linux-3116ad38f51c98c81175151bd7358858a92a6031.zip
kernel/sysctl.c: fix proc_do_large_bitmap for large input buffers
Today, proc_do_large_bitmap() truncates a large write input buffer to PAGE_SIZE - 1, which may result in misparsed numbers at the (truncated) end of the buffer. Further, it fails to notify the caller that the buffer was truncated, so it doesn't get called iteratively to finish the entire input buffer. Tell the caller if there's more work to do by adding the skipped amount back to left/*lenp before returning. To fix the misparsing, reset the position if we have completely consumed a truncated buffer (or if just one char is left, which may be a "-" in a range), and ask the caller to come back for more. Link: http://lkml.kernel.org/r/20190320222831.8243-7-mcgrof@kernel.org Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Acked-by: Kees Cook <keescook@chromium.org> Cc: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/pid.c')
0 files changed, 0 insertions, 0 deletions