AUDIT: Treat all user messages identically.
It's silly to have to add explicit entries for new userspace messages
as we invent them. Just treat all messages in the user range the same.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/kernel/audit.c b/kernel/audit.c
index a0e33b6..e6d8863 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -325,15 +325,7 @@
if (!cap_raised(eff_cap, CAP_AUDIT_CONTROL))
err = -EPERM;
break;
- case AUDIT_USER:
- case AUDIT_USER_AUTH:
- case AUDIT_USER_ACCT:
- case AUDIT_USER_MGMT:
- case AUDIT_CRED_ACQ:
- case AUDIT_CRED_DISP:
- case AUDIT_USER_START:
- case AUDIT_USER_END:
- case AUDIT_USER_AVC:
+ case AUDIT_FIRST_USER_MSG...AUDIT_LAST_USER_MSG:
if (!cap_raised(eff_cap, CAP_AUDIT_WRITE))
err = -EPERM;
break;
@@ -402,15 +394,7 @@
audit_set_backlog_limit(status_get->backlog_limit,
loginuid);
break;
- case AUDIT_USER:
- case AUDIT_USER_AUTH:
- case AUDIT_USER_ACCT:
- case AUDIT_USER_MGMT:
- case AUDIT_CRED_ACQ:
- case AUDIT_CRED_DISP:
- case AUDIT_USER_START:
- case AUDIT_USER_END:
- case AUDIT_USER_AVC:
+ case AUDIT_FIRST_USER_MSG...AUDIT_LAST_USER_MSG:
ab = audit_log_start(NULL, msg_type);
if (!ab)
break; /* audit_panic has been called */