android_kernel_motorola_sm6375/fs/proc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Josef Bacik 80745460b4
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.

[willy@infradead.org: changelog tweaks]

Link: https://lkml.kernel.org/r/6345270a2c1160b89dd5e6715461f388176899d1.1612972413.git.josef@toxicpanda.com
Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
Change-Id: I03ad7285b4c57d2c53aff84e369ef5edbeef7679
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
CC: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
2026-02-01 20:39:16 -08:00
..
array.c
base.c Merge tag 'ASB-2025-06-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-06-30 10:49:17 +03:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c
fd.h
generic.c fs/proc: fix uaf in proc_readdir_de() 2025-12-03 12:45:21 +01:00
inode.c fix proc_sys_compare() handling of in-lookup dentries 2025-07-17 18:25:01 +02:00
internal.h
interrupts.c
Kconfig
kcore.c BACKPORT: maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2026-01-14 18:13:21 -08:00
kmsg.c
loadavg.c
Makefile
meminfo.c
namespaces.c UPSTREAM: nsfs: clean-up ns_get_path() signature to return int 2025-12-23 13:35:44 -08:00
nommu.c
page.c
proc_net.c UPSTREAM: bpf: Refactor to provide aux info to bpf_iter_init_seq_priv_t 2026-01-14 18:12:07 -08:00
proc_sysctl.c proc: use kvzalloc for our kernel buffer 2026-02-01 20:39:16 -08:00
proc_tty.c
root.c
self.c
softirqs.c proc/softirqs: replace seq_printf with seq_put_decimal_ull_width 2024-12-14 19:44:21 +01:00
stat.c
task_mmu.c Merge tag 'ASB-2025-09-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2025-09-12 18:48:05 +03:00
task_nommu.c
thread_self.c
uptime.c
util.c
version.c
vmcore.c fs/proc: fix softlockup in __read_vmcore (part 2) 2025-02-01 18:18:51 +01:00