From 483a39c7ac7d24b92cd8be809bb172132f96f445 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 b0405ed1..57c06b1b 100644 --- a/kernel/core_hook.c +++ b/kernel/core_hook.c @@ -566,11 +566,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; }