From 211e4645ea4424abf50c78db267f50e36f3cdfd9 Mon Sep 17 00:00:00 2001 From: rsuntk <90097027+rsuntk@users.noreply.github.com> Date: Fri, 13 Jun 2025 12:26:49 +0700 Subject: [PATCH] kernel: core_hook: fix refcount leaks on try_umount (#2635) Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: rsuntk Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> --- kernel/core_hook.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/core_hook.c b/kernel/core_hook.c index fdf5a4f3..cf44fa3f 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -541,11 +541,13 @@ static void try_umount(const char *mnt, bool check_mnt, int flags) if (path.dentry != path.mnt->mnt_root) { // it is not root mountpoint, maybe umounted by others already. + path_put(&path); return; } // we are only interest in some specific mounts if (check_mnt && !should_umount(&path)) { + path_put(&path); return; }