]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
audit: handle unknown status requests in audit_receive_msg()
authorRicardo Robaina <rrobaina@redhat.com>
Mon, 9 Mar 2026 13:05:33 +0000 (10:05 -0300)
committerPaul Moore <paul@paul-moore.com>
Tue, 10 Mar 2026 19:22:43 +0000 (15:22 -0400)
commit360160f75592bdc85edba8fe78fb20d90924c7e8
tree7cb9615875a5f2100048dcb499a74f8a093b82e2
parentf3e334fb7f82cd63734faeb395419ab713b4bb5c
audit: handle unknown status requests in audit_receive_msg()

Currently, audit_receive_msg() ignores unknown status bits in AUDIT_SET
requests, incorrectly returning success to newer user space tools
querying unsupported features. This breaks forward compatibility.

Fix this by defining AUDIT_STATUS_ALL and returning -EINVAL if any
unrecognized bits are set (s.mask & ~AUDIT_STATUS_ALL).
This ensures invalid requests are safely rejected, allowing user space
to reliably test for and gracefully handle feature detection on older
kernels.

Suggested-by: Steve Grubb <sgrubb@redhat.com>
Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>
[PM: subject line tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/audit.h
kernel/audit.c