diff options
author | Eric Sandeen <[email protected]> | 2019-05-14 15:45:13 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2019-05-14 19:52:51 -0700 |
commit | 3116ad38f51c98c81175151bd7358858a92a6031 (patch) | |
tree | 050a030511caba8c6a56c783087bd9900b1c885f /drivers/usb/cdns3/cdns3-debug.h | |
parent | 2ea622b887e74497ce5aac5bfe247502b5786f56 (diff) |
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/[email protected]
Signed-off-by: Eric Sandeen <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: Eric Sandeen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-debug.h')
0 files changed, 0 insertions, 0 deletions