mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
audit: fix possible null-pointer dereference in audit_filter_rules
commit6e3ee990c9upstream. Fix possible null-pointer dereference in audit_filter_rules. audit_filter_rules() error: we previously assumed 'ctx' could be null Cc: stable@vger.kernel.org Fixes:bf361231c2("audit: add saddr_fam filter field") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0d867a3599
commit
16802fa4c3
@@ -653,7 +653,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;
|
||||
|
||||
Reference in New Issue
Block a user