Re: [PATCH] pstore: ram_core: fix incorrect success return when vmap() fails

From: Kees Cook

Date: Fri Feb 06 2026 - 19:51:55 EST


On Tue, 03 Feb 2026 10:03:58 +0800, ruipengqi wrote:
> 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.
>
> [...]

Applied to for-next/pstore, thanks!

[1/1] pstore: ram_core: fix incorrect success return when vmap() fails
https://git.kernel.org/kees/c/05363abc7625

Take care,

--
Kees Cook