Subject: CVE-2021-47464: audit: fix possible null-pointer dereference in audit_filter_rules

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

audit: fix possible null-pointer dereference in audit_filter_rules

Fix  possible null-pointer dereference in audit_filter_rules.

audit_filter_rules() error: we previously assumed 'ctx' could be null

The Linux kernel CVE team has assigned CVE-2021-47464 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.3 with commit bf361231c295 and fixed in 5.4.156 with commit d6f451f1f60c
	Issue introduced in 5.3 with commit bf361231c295 and fixed in 5.10.76 with commit 16802fa4c33e
	Issue introduced in 5.3 with commit bf361231c295 and fixed in 5.14.15 with commit 4e9e46a70020
	Issue introduced in 5.3 with commit bf361231c295 and fixed in 5.15 with commit 6e3ee990c904

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2021-47464
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	kernel/auditsc.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/d6f451f1f60c58d73038c7c3177066f8f084e2a2
	https://git.kernel.org/stable/c/16802fa4c33eb1a8efb23f1e93365190e4047d05
	https://git.kernel.org/stable/c/4e9e46a700201b4c85081fd478c99c692a9aaa0d
	https://git.kernel.org/stable/c/6e3ee990c90494561921c756481d0e2125d8b895