diff options
| author | Andrea Parri <parri.andrea@gmail.com> | 2026-09-21 22:23:16 +0200 |
|---|---|---|
| committer | Kees Cook <kees@kernel.org> | 2026-09-21 14:37:16 -0700 |
| commit | 1b30df8662ac85a6759be4332f3bec7e3cb28efc (patch) | |
| tree | e41f2dff27827f61d15e03f3a4b24566739d3718 /tools/lib/python | |
| parent | 70fec428c845216da98041b1ae9f16a8f54b3d68 (diff) | |
| download | linux-next-1b30df8662ac85a6759be4332f3bec7e3cb28efc.tar.gz linux-next-1b30df8662ac85a6759be4332f3bec7e3cb28efc.zip | |
pstore: reject persistent RAM zones too small for the buffer header
persistent_ram_buffer_map() computes
prz->buffer_size = size - sizeof(struct persistent_ram_buffer);
without checking that size is large enough to hold the header. A
ramoops zone configured with a tiny size (e.g. ramoops.pmsg_size=1)
underflows buffer_size to a huge value, which defeats every bounds
check in persistent_ram_write() and persistent_ram_write_user(); a
write to /dev/pmsg0 then copies user data far past the end of the zone
and corrupts kernel memory.
Reject zones that are not larger than the buffer header.
Fixes: 404a6043385de ("staging: android: persistent_ram: handle reserving and mapping memory")
Assisted-by: LLM
Signed-off-by: Andrea Parri <parri.andrea@gmail.com>
Link: https://patch.msgid.link/20260921202317.70595-3-parri.andrea@gmail.com
Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
