aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/garbage.c
diff options
context:
space:
mode:
authorTengda Wu <[email protected]>2025-03-14 06:53:35 +0000
committerSteven Rostedt (Google) <[email protected]>2025-03-14 12:29:12 +0000
commit0b4ffbe4888a2c71185eaf5c1a02dd3586a9bc04 (patch)
treec58e3d1473cfcfd0873f64c34fdc19471a161d60 /net/unix/garbage.c
parentLinux 6.14-rc5 (diff)
downloadkernel-0b4ffbe4888a2c71185eaf5c1a02dd3586a9bc04.tar.gz
kernel-0b4ffbe4888a2c71185eaf5c1a02dd3586a9bc04.zip
tracing: Correct the refcount if the hist/hist_debug file fails to open
The function event_{hist,hist_debug}_open() maintains the refcount of 'file->tr' and 'file' through tracing_open_file_tr(). However, it does not roll back these counts on subsequent failure paths, resulting in a refcount leak. A very obvious case is that if the hist/hist_debug file belongs to a specific instance, the refcount leak will prevent the deletion of that instance, as it relies on the condition 'tr->ref == 1' within __remove_instance(). Fix this by calling tracing_release_file_tr() on all failure paths in event_{hist,hist_debug}_open() to correct the refcount. Cc: [email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Zheng Yejian <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: 1cc111b9cddc ("tracing: Fix uaf issue when open the hist or hist_debug file") Signed-off-by: Tengda Wu <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
Diffstat (limited to 'net/unix/garbage.c')
0 files changed, 0 insertions, 0 deletions