diff options
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index a24aafa850ae..e0cf64a0ae2d 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -87,11 +87,11 @@ static int audit_failure = AUDIT_FAIL_PRINTK; | |||
87 | 87 | ||
88 | /* | 88 | /* |
89 | * If audit records are to be written to the netlink socket, audit_pid | 89 | * If audit records are to be written to the netlink socket, audit_pid |
90 | * contains the pid of the auditd process and audit_nlk_pid contains | 90 | * contains the pid of the auditd process and audit_nlk_portid contains |
91 | * the pid to use to send netlink messages to that process. | 91 | * the portid to use to send netlink messages to that process. |
92 | */ | 92 | */ |
93 | int audit_pid; | 93 | int audit_pid; |
94 | static int audit_nlk_pid; | 94 | static int audit_nlk_portid; |
95 | 95 | ||
96 | /* If audit_rate_limit is non-zero, limit the rate of sending audit records | 96 | /* If audit_rate_limit is non-zero, limit the rate of sending audit records |
97 | * to that number per second. This prevents DoS attacks, but results in | 97 | * to that number per second. This prevents DoS attacks, but results in |
@@ -401,7 +401,7 @@ static void kauditd_send_skb(struct sk_buff *skb) | |||
401 | int err; | 401 | int err; |
402 | /* take a reference in case we can't send it and we want to hold it */ | 402 | /* take a reference in case we can't send it and we want to hold it */ |
403 | skb_get(skb); | 403 | skb_get(skb); |
404 | err = netlink_unicast(audit_sock, skb, audit_nlk_pid, 0); | 404 | err = netlink_unicast(audit_sock, skb, audit_nlk_portid, 0); |
405 | if (err < 0) { | 405 | if (err < 0) { |
406 | BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */ | 406 | BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */ |
407 | printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid); | 407 | printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid); |
@@ -692,7 +692,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
692 | status_set.backlog_limit = audit_backlog_limit; | 692 | status_set.backlog_limit = audit_backlog_limit; |
693 | status_set.lost = atomic_read(&audit_lost); | 693 | status_set.lost = atomic_read(&audit_lost); |
694 | status_set.backlog = skb_queue_len(&audit_skb_queue); | 694 | status_set.backlog = skb_queue_len(&audit_skb_queue); |
695 | audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_GET, 0, 0, | 695 | audit_send_reply(NETLINK_CB(skb).portid, seq, AUDIT_GET, 0, 0, |
696 | &status_set, sizeof(status_set)); | 696 | &status_set, sizeof(status_set)); |
697 | break; | 697 | break; |
698 | case AUDIT_SET: | 698 | case AUDIT_SET: |
@@ -720,7 +720,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
720 | sessionid, sid, 1); | 720 | sessionid, sid, 1); |
721 | 721 | ||
722 | audit_pid = new_pid; | 722 | audit_pid = new_pid; |
723 | audit_nlk_pid = NETLINK_CB(skb).pid; | 723 | audit_nlk_portid = NETLINK_CB(skb).portid; |
724 | } | 724 | } |
725 | if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) { | 725 | if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) { |
726 | err = audit_set_rate_limit(status_get->rate_limit, | 726 | err = audit_set_rate_limit(status_get->rate_limit, |
@@ -782,7 +782,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
782 | } | 782 | } |
783 | /* fallthrough */ | 783 | /* fallthrough */ |
784 | case AUDIT_LIST: | 784 | case AUDIT_LIST: |
785 | err = audit_receive_filter(msg_type, NETLINK_CB(skb).pid, | 785 | err = audit_receive_filter(msg_type, NETLINK_CB(skb).portid, |
786 | uid, seq, data, nlmsg_len(nlh), | 786 | uid, seq, data, nlmsg_len(nlh), |
787 | loginuid, sessionid, sid); | 787 | loginuid, sessionid, sid); |
788 | break; | 788 | break; |
@@ -801,7 +801,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
801 | } | 801 | } |
802 | /* fallthrough */ | 802 | /* fallthrough */ |
803 | case AUDIT_LIST_RULES: | 803 | case AUDIT_LIST_RULES: |
804 | err = audit_receive_filter(msg_type, NETLINK_CB(skb).pid, | 804 | err = audit_receive_filter(msg_type, NETLINK_CB(skb).portid, |
805 | uid, seq, data, nlmsg_len(nlh), | 805 | uid, seq, data, nlmsg_len(nlh), |
806 | loginuid, sessionid, sid); | 806 | loginuid, sessionid, sid); |
807 | break; | 807 | break; |
@@ -872,7 +872,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
872 | memcpy(sig_data->ctx, ctx, len); | 872 | memcpy(sig_data->ctx, ctx, len); |
873 | security_release_secctx(ctx, len); | 873 | security_release_secctx(ctx, len); |
874 | } | 874 | } |
875 | audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_SIGNAL_INFO, | 875 | audit_send_reply(NETLINK_CB(skb).portid, seq, AUDIT_SIGNAL_INFO, |
876 | 0, 0, sig_data, sizeof(*sig_data) + len); | 876 | 0, 0, sig_data, sizeof(*sig_data) + len); |
877 | kfree(sig_data); | 877 | kfree(sig_data); |
878 | break; | 878 | break; |
@@ -891,7 +891,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
891 | rcu_read_unlock(); | 891 | rcu_read_unlock(); |
892 | 892 | ||
893 | if (!err) | 893 | if (!err) |
894 | audit_send_reply(NETLINK_CB(skb).pid, seq, | 894 | audit_send_reply(NETLINK_CB(skb).portid, seq, |
895 | AUDIT_TTY_GET, 0, 0, &s, sizeof(s)); | 895 | AUDIT_TTY_GET, 0, 0, &s, sizeof(s)); |
896 | break; | 896 | break; |
897 | } | 897 | } |