Re: [PATCH v2] riscv: Fix a NULL pointer reference in machine_kexec_prepare

Pratyush Yadav <[email protected]>
Newsgroups org.infradead.lists.kexec,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Sun, Jun 28 2026, Tao Liu wrote:

> A NULL pointer reference issue is noticed in riscv's machine_kexec_prepare,
> where image->segment[i].buf might be NULL and copied unchecked.
>
> The NULL buf comes from security/integrity/ima/ima_kexec.c:
> ima_add_kexec_buffer(), where kbuf is added by kexec_add_buffer(),
> but kbuf.buffer is NULL.
>
> Fix this by simply adding a check before copy.
>
> Acked-by: Baoquan He <[email protected]>
> Signed-off-by: Tao Liu <[email protected]>

Acked-by: Pratyush Yadav <[email protected]>

[...]

-- 
Regards,
Pratyush Yadav
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.