Thread (16 messages) flat view 16 messages, 3 authors, 2026-08-04

Re: [PATCH 1/6] powerpc/spufs: fix spu_context leak in coredump

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2026-08-03 09:05:51
Also in: lkml, stable

On Sun, Aug 2, 2026, at 17:51, Junrui Luo via B4 Relay wrote:
From: Junrui Luo <redacted>

coredump_next_context() returns a spu_context with a reference taken by
get_spu_context(), which the caller must drop.
spufs_coredump_extra_notes_size() does so on all of its exits, but
spufs_coredump_extra_notes_write() never calls put_spu_context(), so
every context dumped through elf_coredump_extra_notes_write() leaks a
reference, including on the success path.

Fix by dropping the reference on each of the three exits of the loop,
mirroring ..._size().

Fixes: 38b407be172d ("powerpc/spufs: Rework fcheck() usage")
Reported-by: Yuhao Jiang <redacted>
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <redacted>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help