Skip to content

Commit

Permalink
audit: Fix wrong task in comparison of session ID
Browse files Browse the repository at this point in the history
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:
linux-audit/audit-kernel#82

Fixes: 8fae477 ("audit: add support for session ID user filter")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
[PM: not user visible, dropped stable]
Signed-off-by: Paul Moore <paul@paul-moore.com>
  • Loading branch information
WOnder93 authored and pcmoore committed May 21, 2018
1 parent 5c5b8d8 commit 5b71388
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/auditsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5b71388

Please sign in to comment.