summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-10-20 19:11:17 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2021-10-20 19:11:17 +0300
commit6da52dead8f59fcf81e19ad3937d903a9b87e1de (patch)
tree5e30679b1787126eb6a1dd58239dc1bc5a750f40
parentfc9b289344b845576aedefe0691a4210987f3711 (diff)
parent6e3ee990c90494561921c756481d0e2125d8b895 (diff)
downloadlinux-6da52dead8f59fcf81e19ad3937d903a9b87e1de.tar.xz
Merge tag 'audit-pr-20211019' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit fix from Paul Moore: "One small audit patch to add a pointer NULL check" * tag 'audit-pr-20211019' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: fix possible null-pointer dereference in audit_filter_rules
-rw-r--r--kernel/auditsc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 8dd73a64f921..b1cb1dbf7417 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -657,7 +657,7 @@ static int audit_filter_rules(struct task_struct *tsk,
result = audit_comparator(audit_loginuid_set(tsk), f->op, f->val);
break;
case AUDIT_SADDR_FAM:
- if (ctx->sockaddr)
+ if (ctx && ctx->sockaddr)
result = audit_comparator(ctx->sockaddr->ss_family,
f->op, f->val);
break;