summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRicardo Robaina <rrobaina@redhat.com>2026-03-09 16:05:33 +0300
committerPaul Moore <paul@paul-moore.com>2026-03-10 22:22:43 +0300
commit360160f75592bdc85edba8fe78fb20d90924c7e8 (patch)
tree7cb9615875a5f2100048dcb499a74f8a093b82e2 /include
parentf3e334fb7f82cd63734faeb395419ab713b4bb5c (diff)
downloadlinux-360160f75592bdc85edba8fe78fb20d90924c7e8.tar.xz
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/audit.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b642b5faca65..d79218bf075a 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -15,6 +15,15 @@
#include <uapi/linux/audit.h>
#include <uapi/linux/fanotify.h>
+#define AUDIT_STATUS_ALL (AUDIT_STATUS_ENABLED | \
+ AUDIT_STATUS_FAILURE | \
+ AUDIT_STATUS_PID | \
+ AUDIT_STATUS_RATE_LIMIT | \
+ AUDIT_STATUS_BACKLOG_LIMIT | \
+ AUDIT_STATUS_BACKLOG_WAIT_TIME | \
+ AUDIT_STATUS_LOST | \
+ AUDIT_STATUS_BACKLOG_WAIT_TIME_ACTUAL)
+
#define AUDIT_INO_UNSET ((unsigned long)-1)
#define AUDIT_DEV_UNSET ((dev_t)-1)