]> git.pld-linux.org Git - packages/kernel.git/blame - kernel-vserver-fixes.patch
- rel 3; previous fix was buggy (oops at vserver guest stop)
[packages/kernel.git] / kernel-vserver-fixes.patch
CommitLineData
0232a98e
AM
1--- linux-3.3/fs/proc/base.c~ 2012-03-19 21:44:42.000000000 +0100
2+++ linux-3.3/fs/proc/base.c 2012-03-21 12:25:28.051092423 +0100
3@@ -568,6 +568,8 @@
4 struct task_struct *task,
5 int hide_pid_min)
6 {
7+ if (vx_check(0, VS_WATCH_P))
8+ return true;
9 if (pid->hide_pid < hide_pid_min)
10 return true;
11 if (in_group_p(pid->pid_gid))
9b783a63
AM
12--- linux-4.1.3-vs2.3.8.2/kernel/signal.c 2015-09-20 20:06:03.000000000 +0200
13+++ testing41/kernel/signal.c 2015-12-05 13:01:00.599373873 +0100
14@@ -1369,8 +1369,14 @@
15 for (;;) {
16 rcu_read_lock();
17 p = pid_task(pid, PIDTYPE_PID);
18- if (p && vx_check(vx_task_xid(p), VS_IDENT))
19- error = group_send_sig_info(sig, info, p);
20+ if (p) {
21+ if (vx_check(vx_task_xid(p), VS_IDENT))
22+ error = group_send_sig_info(sig, info, p);
23+ else {
24+ rcu_read_unlock();
25+ return -ESRCH;
26+ }
27+ }
28 rcu_read_unlock();
29 if (likely(!p || error != -ESRCH))
30 return error;
75bc2bd9
AM
31--- linux-4.1.3-vs2.3.8.2/kernel/exit.c 2015-09-20 20:06:03.000000000 +0200
32+++ testing41/kernel/exit.c 2016-01-27 20:50:37.170221605 +0100
33@@ -580,8 +580,11 @@ static void forget_original_parent(struc
34
35 reaper = find_new_reaper(father, reaper);
36 list_for_each_entry(p, &father->children, sibling) {
37+ struct task_struct *this_reaper = reaper;
38+ if (p == reaper)
39+ this_reaper = task_active_pid_ns(reaper)->child_reaper;
40 for_each_thread(p, t) {
41- t->real_parent = reaper;
42+ t->real_parent = this_reaper;
43 BUG_ON((!t->ptrace) != (t->parent == father));
44 if (likely(!t->ptrace))
45 t->parent = t->real_parent;
46@@ -593,7 +596,7 @@ static void forget_original_parent(struc
47 * If this is a threaded reparent there is no need to
48 * notify anyone anything has happened.
49 */
50- if (!same_thread_group(reaper, father))
51+ if (!same_thread_group(this_reaper, father))
52 reparent_leader(father, p, dead);
53 }
54 list_splice_tail_init(&father->children, &reaper->children);
9d49b35c
AM
55diff -Nurp linux-4.1.3-vs2.3.8.2.fakeinit04/kernel/exit.c linux-4.1.3-vs2.3.8.2.fakeinit05/kernel/exit.c
56--- linux-4.1.3-vs2.3.8.2.fakeinit04/kernel/exit.c 2016-01-29 23:56:25.077386945 +0100
57+++ linux-4.1.3-vs2.3.8.2.fakeinit05/kernel/exit.c 2016-01-30 00:12:30.693073246 +0100
58@@ -579,8 +579,10 @@ static void forget_original_parent(struc
59 return;
60
61 reaper = find_new_reaper(father, reaper);
62- list_for_each_entry(p, &father->children, sibling) {
63- struct task_struct *this_reaper = reaper;
64+ for (p = list_first_entry(&father->children, struct task_struct, sibling);
65+ &p->sibling != &father->children;
66+ ) {
67+ struct task_struct *next, *this_reaper = reaper;
68 if (p == reaper)
69 this_reaper = task_active_pid_ns(reaper)->child_reaper;
70 for_each_thread(p, t) {
71@@ -598,8 +600,11 @@ static void forget_original_parent(struc
72 */
73 if (!same_thread_group(this_reaper, father))
74 reparent_leader(father, p, dead);
75+ next = list_next_entry(p, sibling);
76+ list_add(&p->sibling, &this_reaper->children);
77+ p = next;
78 }
79- list_splice_tail_init(&father->children, &reaper->children);
80+ INIT_LIST_HEAD(&father->children);
81 }
82
83 /*
This page took 0.202225 seconds and 4 git commands to generate.