From: Ondrej Mosnáček Date: Thu, 17 May 2018 15:31:14 +0000 (+0200) Subject: audit: Fix wrong task in comparison of session ID X-Git-Tag: Ubuntu-5.13.0-19.19~10870^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5b71388663c0920848c0ee7de946970a2692b76d;p=mirror_ubuntu-jammy-kernel.git audit: Fix wrong task in comparison of session ID The audit_filter_rules() function in auditsc.c compared the session ID with the credentials of the current task, while it should use the credentials of the task given to audit_filter_rules() as a parameter (tsk). GitHub issue: https://github.com/linux-audit/audit-kernel/issues/82 Fixes: 8fae47705685 ("audit: add support for session ID user filter") Signed-off-by: Ondrej Mosnacek Reviewed-by: Richard Guy Briggs [PM: not user visible, dropped stable] Signed-off-by: Paul Moore --- diff --git a/kernel/auditsc.c b/kernel/auditsc.c index ef3e189bcb15..ceb1c4596c51 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -517,7 +517,7 @@ static int audit_filter_rules(struct task_struct *tsk, result = audit_gid_comparator(cred->fsgid, f->op, f->gid); break; case AUDIT_SESSIONID: - sessionid = audit_get_sessionid(current); + sessionid = audit_get_sessionid(tsk); result = audit_comparator(sessionid, f->op, f->val); break; case AUDIT_PERS: