diff options
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 132271448b89..274882d308d3 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -597,13 +597,14 @@ static int audit_netlink_ok(struct sk_buff *skb, u16 msg_type) | |||
597 | return -EPERM; | 597 | return -EPERM; |
598 | 598 | ||
599 | switch (msg_type) { | 599 | switch (msg_type) { |
600 | case AUDIT_GET: | ||
601 | case AUDIT_LIST: | 600 | case AUDIT_LIST: |
602 | case AUDIT_LIST_RULES: | ||
603 | case AUDIT_SET: | ||
604 | case AUDIT_ADD: | 601 | case AUDIT_ADD: |
605 | case AUDIT_ADD_RULE: | ||
606 | case AUDIT_DEL: | 602 | case AUDIT_DEL: |
603 | return -EOPNOTSUPP; | ||
604 | case AUDIT_GET: | ||
605 | case AUDIT_SET: | ||
606 | case AUDIT_LIST_RULES: | ||
607 | case AUDIT_ADD_RULE: | ||
607 | case AUDIT_DEL_RULE: | 608 | case AUDIT_DEL_RULE: |
608 | case AUDIT_SIGNAL_INFO: | 609 | case AUDIT_SIGNAL_INFO: |
609 | case AUDIT_TTY_GET: | 610 | case AUDIT_TTY_GET: |
@@ -766,25 +767,6 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
766 | audit_log_end(ab); | 767 | audit_log_end(ab); |
767 | } | 768 | } |
768 | break; | 769 | break; |
769 | case AUDIT_ADD: | ||
770 | case AUDIT_DEL: | ||
771 | if (nlmsg_len(nlh) < sizeof(struct audit_rule)) | ||
772 | return -EINVAL; | ||
773 | if (audit_enabled == AUDIT_LOCKED) { | ||
774 | audit_log_common_recv_msg(&ab, AUDIT_CONFIG_CHANGE, | ||
775 | loginuid, sessionid, sid); | ||
776 | |||
777 | audit_log_format(ab, " audit_enabled=%d res=0", | ||
778 | audit_enabled); | ||
779 | audit_log_end(ab); | ||
780 | return -EPERM; | ||
781 | } | ||
782 | /* fallthrough */ | ||
783 | case AUDIT_LIST: | ||
784 | err = audit_receive_filter(msg_type, NETLINK_CB(skb).portid, | ||
785 | seq, data, nlmsg_len(nlh), | ||
786 | loginuid, sessionid, sid); | ||
787 | break; | ||
788 | case AUDIT_ADD_RULE: | 770 | case AUDIT_ADD_RULE: |
789 | case AUDIT_DEL_RULE: | 771 | case AUDIT_DEL_RULE: |
790 | if (nlmsg_len(nlh) < sizeof(struct audit_rule_data)) | 772 | if (nlmsg_len(nlh) < sizeof(struct audit_rule_data)) |