Files
Qian Zuo 1d5ad6c5a2 coredump: fix pidfs file refcount leak in umh_coredump_setup
The backport of upstream commit b5325b2a27 introduced a reference
count leak for pidfs_file.

In the upstream implementation, pidfs_file is declared with
__free(fput), which automatically drops the initial file reference when
leaving the scope. During the backport, the code was rewritten to manage
the file pointer manually, but after a successful replace_fd(),
pidfs_file was simply cleared without dropping the initial reference.

As a result, the pidfs file keeps an extra reference and is never
released after the usermode helper exits, leaving associated objects,
such as struct pid, permanently allocated and triggering kmemleak
reports.

Fix this by explicitly calling fput(pidfs_file) after replace_fd().

Fixes: cdb61a705f ("coredump: hand a pidfd to the usermode coredump helper")
Signed-off-by: Qian Zuo <zuoqian113@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-08-03 11:15:40 +02:00
..
…
…
2026-07-24 16:03:10 +02:00
2026-03-04 07:20:43 -05:00
2026-01-17 16:30:00 +01:00
…
…
…
…
…
2025-03-22 12:50:41 -07:00
2026-07-24 16:03:53 +02:00
…
…
…
…
…
2026-07-04 13:42:23 +02:00
…
…
…
2026-07-04 13:42:23 +02:00
…
2026-01-11 15:22:23 +01:00
…
…
…
…
…
2026-07-04 13:42:23 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
2026-04-06 09:55:59 +02:00