aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c25
-rw-r--r--kernel/exit.c3
-rw-r--r--kernel/fork.c1
-rw-r--r--kernel/taskstats.c4
4 files changed, 18 insertions, 15 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 511488a7bc71..4d0ceede3319 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -88,11 +88,11 @@ static int audit_failure = AUDIT_FAIL_PRINTK;
88 88
89/* 89/*
90 * If audit records are to be written to the netlink socket, audit_pid 90 * If audit records are to be written to the netlink socket, audit_pid
91 * contains the pid of the auditd process and audit_nlk_pid contains 91 * contains the pid of the auditd process and audit_nlk_portid contains
92 * the pid to use to send netlink messages to that process. 92 * the portid to use to send netlink messages to that process.
93 */ 93 */
94int audit_pid; 94int audit_pid;
95static int audit_nlk_pid; 95static int audit_nlk_portid;
96 96
97/* If audit_rate_limit is non-zero, limit the rate of sending audit records 97/* If audit_rate_limit is non-zero, limit the rate of sending audit records
98 * to that number per second. This prevents DoS attacks, but results in 98 * to that number per second. This prevents DoS attacks, but results in
@@ -402,7 +402,7 @@ static void kauditd_send_skb(struct sk_buff *skb)
402 int err; 402 int err;
403 /* take a reference in case we can't send it and we want to hold it */ 403 /* take a reference in case we can't send it and we want to hold it */
404 skb_get(skb); 404 skb_get(skb);
405 err = netlink_unicast(audit_sock, skb, audit_nlk_pid, 0); 405 err = netlink_unicast(audit_sock, skb, audit_nlk_portid, 0);
406 if (err < 0) { 406 if (err < 0) {
407 BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */ 407 BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */
408 printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid); 408 printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid);
@@ -679,7 +679,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
679 status_set.backlog_limit = audit_backlog_limit; 679 status_set.backlog_limit = audit_backlog_limit;
680 status_set.lost = atomic_read(&audit_lost); 680 status_set.lost = atomic_read(&audit_lost);
681 status_set.backlog = skb_queue_len(&audit_skb_queue); 681 status_set.backlog = skb_queue_len(&audit_skb_queue);
682 audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_GET, 0, 0, 682 audit_send_reply(NETLINK_CB(skb).portid, seq, AUDIT_GET, 0, 0,
683 &status_set, sizeof(status_set)); 683 &status_set, sizeof(status_set));
684 break; 684 break;
685 case AUDIT_SET: 685 case AUDIT_SET:
@@ -707,7 +707,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
707 sessionid, sid, 1); 707 sessionid, sid, 1);
708 708
709 audit_pid = new_pid; 709 audit_pid = new_pid;
710 audit_nlk_pid = NETLINK_CB(skb).pid; 710 audit_nlk_portid = NETLINK_CB(skb).portid;
711 } 711 }
712 if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) { 712 if (status_get->mask & AUDIT_STATUS_RATE_LIMIT) {
713 err = audit_set_rate_limit(status_get->rate_limit, 713 err = audit_set_rate_limit(status_get->rate_limit,
@@ -750,7 +750,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
750 size--; 750 size--;
751 audit_log_n_untrustedstring(ab, data, size); 751 audit_log_n_untrustedstring(ab, data, size);
752 } 752 }
753 audit_set_pid(ab, NETLINK_CB(skb).pid); 753 audit_set_pid(ab, NETLINK_CB(skb).portid);
754 audit_log_end(ab); 754 audit_log_end(ab);
755 } 755 }
756 break; 756 break;
@@ -769,7 +769,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
769 } 769 }
770 /* fallthrough */ 770 /* fallthrough */
771 case AUDIT_LIST: 771 case AUDIT_LIST:
772 err = audit_receive_filter(msg_type, NETLINK_CB(skb).pid, 772 err = audit_receive_filter(msg_type, NETLINK_CB(skb).portid,
773 seq, data, nlmsg_len(nlh), 773 seq, data, nlmsg_len(nlh),
774 loginuid, sessionid, sid); 774 loginuid, sessionid, sid);
775 break; 775 break;
@@ -788,7 +788,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
788 } 788 }
789 /* fallthrough */ 789 /* fallthrough */
790 case AUDIT_LIST_RULES: 790 case AUDIT_LIST_RULES:
791 err = audit_receive_filter(msg_type, NETLINK_CB(skb).pid, 791 err = audit_receive_filter(msg_type, NETLINK_CB(skb).portid,
792 seq, data, nlmsg_len(nlh), 792 seq, data, nlmsg_len(nlh),
793 loginuid, sessionid, sid); 793 loginuid, sessionid, sid);
794 break; 794 break;
@@ -859,7 +859,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
859 memcpy(sig_data->ctx, ctx, len); 859 memcpy(sig_data->ctx, ctx, len);
860 security_release_secctx(ctx, len); 860 security_release_secctx(ctx, len);
861 } 861 }
862 audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_SIGNAL_INFO, 862 audit_send_reply(NETLINK_CB(skb).portid, seq, AUDIT_SIGNAL_INFO,
863 0, 0, sig_data, sizeof(*sig_data) + len); 863 0, 0, sig_data, sizeof(*sig_data) + len);
864 kfree(sig_data); 864 kfree(sig_data);
865 break; 865 break;
@@ -871,7 +871,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
871 s.enabled = tsk->signal->audit_tty != 0; 871 s.enabled = tsk->signal->audit_tty != 0;
872 spin_unlock_irq(&tsk->sighand->siglock); 872 spin_unlock_irq(&tsk->sighand->siglock);
873 873
874 audit_send_reply(NETLINK_CB(skb).pid, seq, 874 audit_send_reply(NETLINK_CB(skb).portid, seq,
875 AUDIT_TTY_GET, 0, 0, &s, sizeof(s)); 875 AUDIT_TTY_GET, 0, 0, &s, sizeof(s));
876 break; 876 break;
877 } 877 }
@@ -946,8 +946,7 @@ static int __init audit_init(void)
946 946
947 printk(KERN_INFO "audit: initializing netlink socket (%s)\n", 947 printk(KERN_INFO "audit: initializing netlink socket (%s)\n",
948 audit_default ? "enabled" : "disabled"); 948 audit_default ? "enabled" : "disabled");
949 audit_sock = netlink_kernel_create(&init_net, NETLINK_AUDIT, 949 audit_sock = netlink_kernel_create(&init_net, NETLINK_AUDIT, &cfg);
950 THIS_MODULE, &cfg);
951 if (!audit_sock) 950 if (!audit_sock)
952 audit_panic("cannot initialize netlink socket"); 951 audit_panic("cannot initialize netlink socket");
953 else 952 else
diff --git a/kernel/exit.c b/kernel/exit.c
index f65345f9e5bb..42f25952edd9 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1046,6 +1046,9 @@ void do_exit(long code)
1046 if (tsk->splice_pipe) 1046 if (tsk->splice_pipe)
1047 __free_pipe_info(tsk->splice_pipe); 1047 __free_pipe_info(tsk->splice_pipe);
1048 1048
1049 if (tsk->task_frag.page)
1050 put_page(tsk->task_frag.page);
1051
1049 validate_creds_for_do_exit(tsk); 1052 validate_creds_for_do_exit(tsk);
1050 1053
1051 preempt_disable(); 1054 preempt_disable();
diff --git a/kernel/fork.c b/kernel/fork.c
index 5a0e74d89a5a..a2b1efc20928 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -330,6 +330,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
330 tsk->btrace_seq = 0; 330 tsk->btrace_seq = 0;
331#endif 331#endif
332 tsk->splice_pipe = NULL; 332 tsk->splice_pipe = NULL;
333 tsk->task_frag.page = NULL;
333 334
334 account_kernel_stack(ti, 1); 335 account_kernel_stack(ti, 1);
335 336
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 3880df2acf05..5eab1f3edfa5 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -476,7 +476,7 @@ static int cmd_attr_register_cpumask(struct genl_info *info)
476 rc = parse(info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK], mask); 476 rc = parse(info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK], mask);
477 if (rc < 0) 477 if (rc < 0)
478 goto out; 478 goto out;
479 rc = add_del_listener(info->snd_pid, mask, REGISTER); 479 rc = add_del_listener(info->snd_portid, mask, REGISTER);
480out: 480out:
481 free_cpumask_var(mask); 481 free_cpumask_var(mask);
482 return rc; 482 return rc;
@@ -492,7 +492,7 @@ static int cmd_attr_deregister_cpumask(struct genl_info *info)
492 rc = parse(info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK], mask); 492 rc = parse(info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK], mask);
493 if (rc < 0) 493 if (rc < 0)
494 goto out; 494 goto out;
495 rc = add_del_listener(info->snd_pid, mask, DEREGISTER); 495 rc = add_del_listener(info->snd_portid, mask, DEREGISTER);
496out: 496out:
497 free_cpumask_var(mask); 497 free_cpumask_var(mask);
498 return rc; 498 return rc;