Debug the possibility of systemd changing the audit config causing
shutdown delays by blocking all such requests.

Signed-off-by: Richard Guy Briggs <r...@redhat.com>
---
 kernel/audit.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 30b3b08..93a466b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -680,18 +680,20 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 
msg_type)
        case AUDIT_ADD:
        case AUDIT_DEL:
                return -EOPNOTSUPP;
-       case AUDIT_GET:
        case AUDIT_SET:
-       case AUDIT_GET_FEATURE:
        case AUDIT_SET_FEATURE:
-       case AUDIT_LIST_RULES:
        case AUDIT_ADD_RULE:
        case AUDIT_DEL_RULE:
-       case AUDIT_SIGNAL_INFO:
-       case AUDIT_TTY_GET:
-       case AUDIT_TTY_SET:
        case AUDIT_TRIM:
        case AUDIT_MAKE_EQUIV:
+       case AUDIT_TTY_SET:
+               if (current->tgid == 1)
+                       return -EPERM;
+       case AUDIT_GET:
+       case AUDIT_GET_FEATURE:
+       case AUDIT_LIST_RULES:
+       case AUDIT_SIGNAL_INFO:
+       case AUDIT_TTY_GET:
                /* Only support auditd and auditctl in initial pid namespace
                 * for now. */
                if ((task_active_pid_ns(current) != &init_pid_ns))
-- 
1.7.1

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit

Reply via email to