linux/fs/pstore
Ruipeng Qi 8d849adfbc pstore: ram_core: fix incorrect success return when vmap() fails
[ Upstream commit 05363abc76 ]

In persistent_ram_vmap(), vmap() may return NULL on failure.

If offset is non-zero, adding offset_in_page(start) causes the function
to return a non-NULL pointer even though the mapping failed.
persistent_ram_buffer_map() therefore incorrectly returns success.

Subsequent access to prz->buffer may dereference an invalid address
and cause crashes.

Add proper NULL checking for vmap() failures.

Signed-off-by: Ruipeng Qi <ruipengqi3@gmail.com>
Link: https://patch.msgid.link/20260203020358.3315299-1-ruipengqi3@gmail.com
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-03-04 07:20:58 -05:00
..
blk.c pstore/blk: trivial typo fixes 2025-02-08 09:56:51 +01:00
ftrace.c pstore/ftrace: Allow immediate recording 2021-11-18 10:29:52 -08:00
inode.c pstore: Change kmsg_bytes storage size to u32 2025-05-29 11:02:58 +02:00
internal.h pstore: Change kmsg_bytes storage size to u32 2025-05-29 11:02:58 +02:00
Kconfig pstore: Replace crypto API compression with zlib_deflate library calls 2023-07-17 16:08:58 -07:00
Makefile pstore/blk: Introduce backend for block devices 2020-05-30 10:34:03 -07:00
platform.c pstore: Change kmsg_bytes storage size to u32 2025-05-29 11:02:58 +02:00
pmsg.c pstore update for v6.4-rc1 2023-04-27 17:03:40 -07:00
ram.c pstore/ramoops: Add ramoops.mem_name= command line option 2024-06-19 18:05:14 +03:00
ram_core.c pstore: ram_core: fix incorrect success return when vmap() fails 2026-03-04 07:20:58 -05:00
ram_internal.h pstore/ram: Set freed addresses to NULL 2022-10-19 09:25:39 -07:00
zone.c pstore/zone: Don't clear memory twice 2024-03-09 12:33:22 -08:00