diff options
author | Josef Bacik <[email protected]> | 2021-02-25 17:20:49 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2021-02-26 09:41:03 -0800 |
commit | 4508943794efdd94171549c0bd52810e2f4ad9fe (patch) | |
tree | 6b6930dc88e157d4210ac4b2396816420f800ed1 /scripts/gdb/linux/lists.py | |
parent | 152c432b128cb043fc107e8f211195fe94b2159c (diff) |
proc: use kvzalloc for our kernel buffer
Since
sysctl: pass kernel pointers to ->proc_handler
we have been pre-allocating a buffer to copy the data from the proc
handlers into, and then copying that to userspace. The problem is this
just blindly kzalloc()'s the buffer size passed in from the read, which in
the case of our 'cat' binary was 64kib. Order-4 allocations are not
awesome, and since we can potentially allocate up to our maximum order, so
use kvzalloc for these buffers.
[[email protected]: changelog tweaks]
Link: https://lkml.kernel.org/r/6345270a2c1160b89dd5e6715461f388176899d1.1612972413.git.josef@toxicpanda.com
Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
Signed-off-by: Josef Bacik <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
CC: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/lists.py')
0 files changed, 0 insertions, 0 deletions