summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2023-12-29 06:54:41 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-25 15:45:23 -0800
commit4c546abf22de9a31c2753e5a9753df12e5792237 (patch)
treeb2bfd6303d2adaa46b4824dd2a27934512d97e87 /security
parented2b9948574f6dd44fcf63f77be231399168395b (diff)
downloadlinux-stable-4c546abf22de9a31c2753e5a9753df12e5792237.tar.gz
linux-stable-4c546abf22de9a31c2753e5a9753df12e5792237.tar.bz2
linux-stable-4c546abf22de9a31c2753e5a9753df12e5792237.zip
apparmor: Fix ref count leak in task_kill
[ Upstream commit 2cb54a19ac7153b9a26a72098c495187f64c2276 ] apparmor_task_kill was not putting the task_cred reference tc, or the cred_label reference tc when dealing with a passed in cred, fix this by using a single fn exit. Fixes: 90c436a64a6e ("apparmor: pass cred through to audit info.") Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/lsm.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 4981bdf02993..608a849a7468 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -954,7 +954,6 @@ static int apparmor_task_kill(struct task_struct *target, struct kernel_siginfo
cl = aa_get_newest_cred_label(cred);
error = aa_may_signal(cred, cl, tc, tl, sig);
aa_put_label(cl);
- return error;
} else {
cl = __begin_current_label_crit_section();
error = aa_may_signal(current_cred(), cl, tc, tl, sig);