]>
Commit | Line | Data |
---|---|---|
1 | diff -NurpP --minimal linux-2.6.2-rc1/arch/alpha/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/alpha/kernel/ptrace.c | |
2 | --- linux-2.6.2-rc1/arch/alpha/kernel/ptrace.c Fri Jan 9 08:00:02 2004 | |
3 | +++ linux-2.6.2-rc1-vs0.05.1/arch/alpha/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
4 | @@ -6,6 +6,7 @@ | |
5 | ||
6 | #include <linux/kernel.h> | |
7 | #include <linux/sched.h> | |
8 | +#include <linux/vinline.h> | |
9 | #include <linux/mm.h> | |
10 | #include <linux/smp.h> | |
11 | #include <linux/smp_lock.h> | |
12 | @@ -285,7 +286,7 @@ do_sys_ptrace(long request, long pid, lo | |
13 | if (child) | |
14 | get_task_struct(child); | |
15 | read_unlock(&tasklist_lock); | |
16 | - if (!child) | |
17 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
18 | goto out_notsk; | |
19 | ||
20 | if (request == PTRACE_ATTACH) { | |
21 | diff -NurpP --minimal linux-2.6.2-rc1/arch/alpha/kernel/systbls.S linux-2.6.2-rc1-vs0.05.1/arch/alpha/kernel/systbls.S | |
22 | --- linux-2.6.2-rc1/arch/alpha/kernel/systbls.S Fri Jan 9 07:59:45 2004 | |
23 | +++ linux-2.6.2-rc1-vs0.05.1/arch/alpha/kernel/systbls.S Sat Jan 24 06:45:48 2004 | |
24 | @@ -291,7 +291,7 @@ sys_call_table: | |
25 | .quad alpha_ni_syscall /* 270 */ | |
26 | .quad alpha_ni_syscall | |
27 | .quad alpha_ni_syscall | |
28 | - .quad alpha_ni_syscall | |
29 | + .quad sys_vserver /* 273 sys_vserver */ | |
30 | .quad alpha_ni_syscall | |
31 | .quad alpha_ni_syscall /* 275 */ | |
32 | .quad alpha_ni_syscall | |
33 | diff -NurpP --minimal linux-2.6.2-rc1/arch/i386/kernel/entry.S linux-2.6.2-rc1-vs0.05.1/arch/i386/kernel/entry.S | |
34 | --- linux-2.6.2-rc1/arch/i386/kernel/entry.S Fri Jan 9 07:59:19 2004 | |
35 | +++ linux-2.6.2-rc1-vs0.05.1/arch/i386/kernel/entry.S Sat Jan 24 06:45:48 2004 | |
36 | @@ -881,6 +881,6 @@ ENTRY(sys_call_table) | |
37 | .long sys_tgkill /* 270 */ | |
38 | .long sys_utimes | |
39 | .long sys_fadvise64_64 | |
40 | - .long sys_ni_syscall /* sys_vserver */ | |
41 | + .long sys_vserver | |
42 | ||
43 | syscall_table_size=(.-sys_call_table) | |
44 | diff -NurpP --minimal linux-2.6.2-rc1/arch/i386/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/i386/kernel/ptrace.c | |
45 | --- linux-2.6.2-rc1/arch/i386/kernel/ptrace.c Fri Jan 9 07:59:19 2004 | |
46 | +++ linux-2.6.2-rc1-vs0.05.1/arch/i386/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
47 | @@ -7,6 +7,7 @@ | |
48 | ||
49 | #include <linux/kernel.h> | |
50 | #include <linux/sched.h> | |
51 | +#include <linux/vinline.h> | |
52 | #include <linux/mm.h> | |
53 | #include <linux/smp.h> | |
54 | #include <linux/smp_lock.h> | |
55 | @@ -255,7 +256,7 @@ asmlinkage int sys_ptrace(long request, | |
56 | if (child) | |
57 | get_task_struct(child); | |
58 | read_unlock(&tasklist_lock); | |
59 | - if (!child) | |
60 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
61 | goto out; | |
62 | ||
63 | ret = -EPERM; | |
64 | diff -NurpP --minimal linux-2.6.2-rc1/arch/ia64/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/ia64/kernel/ptrace.c | |
65 | --- linux-2.6.2-rc1/arch/ia64/kernel/ptrace.c Fri Jan 9 08:00:12 2004 | |
66 | +++ linux-2.6.2-rc1-vs0.05.1/arch/ia64/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
67 | @@ -10,6 +10,7 @@ | |
68 | #include <linux/config.h> | |
69 | #include <linux/kernel.h> | |
70 | #include <linux/sched.h> | |
71 | +#include <linux/vinline.h> | |
72 | #include <linux/slab.h> | |
73 | #include <linux/mm.h> | |
74 | #include <linux/errno.h> | |
75 | @@ -1282,7 +1283,7 @@ sys_ptrace (long request, pid_t pid, uns | |
76 | } | |
77 | } | |
78 | read_unlock(&tasklist_lock); | |
79 | - if (!child) | |
80 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
81 | goto out; | |
82 | ret = -EPERM; | |
83 | if (pid == 1) /* no messing around with init! */ | |
84 | diff -NurpP --minimal linux-2.6.2-rc1/arch/m68k/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/m68k/kernel/ptrace.c | |
85 | --- linux-2.6.2-rc1/arch/m68k/kernel/ptrace.c Fri Jan 9 07:59:19 2004 | |
86 | +++ linux-2.6.2-rc1-vs0.05.1/arch/m68k/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
87 | @@ -12,6 +12,7 @@ | |
88 | ||
89 | #include <linux/kernel.h> | |
90 | #include <linux/sched.h> | |
91 | +#include <linux/vinline.h> | |
92 | #include <linux/mm.h> | |
93 | #include <linux/smp.h> | |
94 | #include <linux/smp_lock.h> | |
95 | @@ -124,7 +125,7 @@ asmlinkage int sys_ptrace(long request, | |
96 | if (child) | |
97 | get_task_struct(child); | |
98 | read_unlock(&tasklist_lock); | |
99 | - if (!child) | |
100 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
101 | goto out; | |
102 | ||
103 | ret = -EPERM; | |
104 | diff -NurpP --minimal linux-2.6.2-rc1/arch/mips/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/mips/kernel/ptrace.c | |
105 | --- linux-2.6.2-rc1/arch/mips/kernel/ptrace.c Fri Jan 9 08:00:13 2004 | |
106 | +++ linux-2.6.2-rc1-vs0.05.1/arch/mips/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
107 | @@ -18,6 +18,7 @@ | |
108 | #include <linux/compiler.h> | |
109 | #include <linux/kernel.h> | |
110 | #include <linux/sched.h> | |
111 | +#include <linux/vinline.h> | |
112 | #include <linux/mm.h> | |
113 | #include <linux/errno.h> | |
114 | #include <linux/ptrace.h> | |
115 | @@ -74,7 +75,7 @@ asmlinkage int sys_ptrace(long request, | |
116 | if (child) | |
117 | get_task_struct(child); | |
118 | read_unlock(&tasklist_lock); | |
119 | - if (!child) | |
120 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
121 | goto out; | |
122 | ||
123 | ret = -EPERM; | |
124 | diff -NurpP --minimal linux-2.6.2-rc1/arch/parisc/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/parisc/kernel/ptrace.c | |
125 | --- linux-2.6.2-rc1/arch/parisc/kernel/ptrace.c Fri Jan 9 07:59:09 2004 | |
126 | +++ linux-2.6.2-rc1-vs0.05.1/arch/parisc/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
127 | @@ -8,6 +8,7 @@ | |
128 | ||
129 | #include <linux/kernel.h> | |
130 | #include <linux/sched.h> | |
131 | +#include <linux/vinline.h> | |
132 | #include <linux/mm.h> | |
133 | #include <linux/smp.h> | |
134 | #include <linux/smp_lock.h> | |
135 | @@ -109,7 +110,7 @@ long sys_ptrace(long request, pid_t pid, | |
136 | if (child) | |
137 | get_task_struct(child); | |
138 | read_unlock(&tasklist_lock); | |
139 | - if (!child) | |
140 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
141 | goto out; | |
142 | ret = -EPERM; | |
143 | if (pid == 1) /* no messing around with init! */ | |
144 | diff -NurpP --minimal linux-2.6.2-rc1/arch/ppc/kernel/misc.S linux-2.6.2-rc1-vs0.05.1/arch/ppc/kernel/misc.S | |
145 | --- linux-2.6.2-rc1/arch/ppc/kernel/misc.S Sat Jan 24 03:18:04 2004 | |
146 | +++ linux-2.6.2-rc1-vs0.05.1/arch/ppc/kernel/misc.S Sat Jan 24 06:45:48 2004 | |
147 | @@ -1386,3 +1386,22 @@ _GLOBAL(sys_call_table) | |
148 | .long sys_fstatfs64 | |
149 | .long ppc_fadvise64_64 | |
150 | .long sys_ni_syscall /* 255 - rtas (used on ppc64) */ | |
151 | + .long sys_ni_syscall | |
152 | + .long sys_ni_syscall | |
153 | + .long sys_ni_syscall | |
154 | + .long sys_ni_syscall | |
155 | + .long sys_ni_syscall /* 260 */ | |
156 | + .long sys_ni_syscall | |
157 | + .long sys_ni_syscall | |
158 | + .long sys_ni_syscall | |
159 | + .long sys_ni_syscall | |
160 | + .long sys_ni_syscall /* 265 */ | |
161 | + .long sys_ni_syscall | |
162 | + .long sys_ni_syscall | |
163 | + .long sys_ni_syscall | |
164 | + .long sys_ni_syscall | |
165 | + .long sys_ni_syscall /* 270 */ | |
166 | + .long sys_ni_syscall | |
167 | + .long sys_ni_syscall | |
168 | + .long sys_vserver /* 273 sys_vserver */ | |
169 | + | |
170 | diff -NurpP --minimal linux-2.6.2-rc1/arch/ppc/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/ppc/kernel/ptrace.c | |
171 | --- linux-2.6.2-rc1/arch/ppc/kernel/ptrace.c Fri Jan 9 07:59:19 2004 | |
172 | +++ linux-2.6.2-rc1-vs0.05.1/arch/ppc/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
173 | @@ -19,6 +19,7 @@ | |
174 | ||
175 | #include <linux/kernel.h> | |
176 | #include <linux/sched.h> | |
177 | +#include <linux/vinline.h> | |
178 | #include <linux/mm.h> | |
179 | #include <linux/smp.h> | |
180 | #include <linux/smp_lock.h> | |
181 | @@ -195,7 +196,7 @@ int sys_ptrace(long request, long pid, l | |
182 | if (child) | |
183 | get_task_struct(child); | |
184 | read_unlock(&tasklist_lock); | |
185 | - if (!child) | |
186 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
187 | goto out; | |
188 | ||
189 | ret = -EPERM; | |
190 | diff -NurpP --minimal linux-2.6.2-rc1/arch/ppc64/kernel/misc.S linux-2.6.2-rc1-vs0.05.1/arch/ppc64/kernel/misc.S | |
191 | --- linux-2.6.2-rc1/arch/ppc64/kernel/misc.S Sat Jan 24 03:18:04 2004 | |
192 | +++ linux-2.6.2-rc1-vs0.05.1/arch/ppc64/kernel/misc.S Sat Jan 24 06:45:48 2004 | |
193 | @@ -819,6 +819,24 @@ _GLOBAL(sys_call_table32) | |
194 | .llong .compat_fstatfs64 | |
195 | .llong .ppc32_fadvise64_64 /* 32bit only fadvise64_64 */ | |
196 | .llong .ppc_rtas /* 255 */ | |
197 | + .llong .sys_ni_syscall | |
198 | + .llong .sys_ni_syscall | |
199 | + .llong .sys_ni_syscall | |
200 | + .llong .sys_ni_syscall | |
201 | + .llong .sys_ni_syscall /* 260 */ | |
202 | + .llong .sys_ni_syscall | |
203 | + .llong .sys_ni_syscall | |
204 | + .llong .sys_ni_syscall | |
205 | + .llong .sys_ni_syscall | |
206 | + .llong .sys_ni_syscall /* 265 */ | |
207 | + .llong .sys_ni_syscall | |
208 | + .llong .sys_ni_syscall | |
209 | + .llong .sys_ni_syscall | |
210 | + .llong .sys_ni_syscall | |
211 | + .llong .sys_ni_syscall /* 270 */ | |
212 | + .llong .sys_ni_syscall | |
213 | + .llong .sys_ni_syscall | |
214 | + .llong .sys_vserver /* 273 sys_vserver */ | |
215 | ||
216 | .balign 8 | |
217 | _GLOBAL(sys_call_table) | |
218 | @@ -1078,3 +1096,22 @@ _GLOBAL(sys_call_table) | |
219 | .llong .sys_fstatfs64 | |
220 | .llong .sys_ni_syscall /* 32bit only fadvise64_64 */ | |
221 | .llong .ppc_rtas /* 255 */ | |
222 | + .llong .sys_ni_syscall | |
223 | + .llong .sys_ni_syscall | |
224 | + .llong .sys_ni_syscall | |
225 | + .llong .sys_ni_syscall | |
226 | + .llong .sys_ni_syscall /* 260 */ | |
227 | + .llong .sys_ni_syscall | |
228 | + .llong .sys_ni_syscall | |
229 | + .llong .sys_ni_syscall | |
230 | + .llong .sys_ni_syscall | |
231 | + .llong .sys_ni_syscall /* 265 */ | |
232 | + .llong .sys_ni_syscall | |
233 | + .llong .sys_ni_syscall | |
234 | + .llong .sys_ni_syscall | |
235 | + .llong .sys_ni_syscall | |
236 | + .llong .sys_ni_syscall /* 270 */ | |
237 | + .llong .sys_ni_syscall | |
238 | + .llong .sys_ni_syscall | |
239 | + .llong .sys_vserver /* 273 sys_vserver */ | |
240 | + | |
241 | diff -NurpP --minimal linux-2.6.2-rc1/arch/ppc64/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/ppc64/kernel/ptrace.c | |
242 | --- linux-2.6.2-rc1/arch/ppc64/kernel/ptrace.c Fri Jan 9 07:59:56 2004 | |
243 | +++ linux-2.6.2-rc1-vs0.05.1/arch/ppc64/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
244 | @@ -19,6 +19,7 @@ | |
245 | ||
246 | #include <linux/kernel.h> | |
247 | #include <linux/sched.h> | |
248 | +#include <linux/vinline.h> | |
249 | #include <linux/mm.h> | |
250 | #include <linux/smp.h> | |
251 | #include <linux/smp_lock.h> | |
252 | @@ -73,7 +74,7 @@ int sys_ptrace(long request, long pid, l | |
253 | if (child) | |
254 | get_task_struct(child); | |
255 | read_unlock(&tasklist_lock); | |
256 | - if (!child) | |
257 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
258 | goto out; | |
259 | ||
260 | ret = -EPERM; | |
261 | diff -NurpP --minimal linux-2.6.2-rc1/arch/s390/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/s390/kernel/ptrace.c | |
262 | --- linux-2.6.2-rc1/arch/s390/kernel/ptrace.c Sat Jan 24 03:18:05 2004 | |
263 | +++ linux-2.6.2-rc1-vs0.05.1/arch/s390/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
264 | @@ -24,6 +24,7 @@ | |
265 | ||
266 | #include <linux/kernel.h> | |
267 | #include <linux/sched.h> | |
268 | +#include <linux/vinline.h> | |
269 | #include <linux/mm.h> | |
270 | #include <linux/smp.h> | |
271 | #include <linux/smp_lock.h> | |
272 | @@ -647,7 +648,7 @@ sys_ptrace(long request, long pid, long | |
273 | if (child) | |
274 | get_task_struct(child); | |
275 | read_unlock(&tasklist_lock); | |
276 | - if (!child) | |
277 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
278 | goto out; | |
279 | ||
280 | ret = do_ptrace(child, request, addr, data); | |
281 | diff -NurpP --minimal linux-2.6.2-rc1/arch/s390/kernel/syscalls.S linux-2.6.2-rc1-vs0.05.1/arch/s390/kernel/syscalls.S | |
282 | --- linux-2.6.2-rc1/arch/s390/kernel/syscalls.S Sat Jan 24 03:18:05 2004 | |
283 | +++ linux-2.6.2-rc1-vs0.05.1/arch/s390/kernel/syscalls.S Sat Jan 24 06:45:48 2004 | |
284 | @@ -271,5 +271,5 @@ SYSCALL(sys_clock_settime,sys_clock_sett | |
285 | SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260 */ | |
286 | SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) | |
287 | SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) | |
288 | -NI_SYSCALL /* reserved for vserver */ | |
289 | +SYSCALL(sys_vserver,sys_vserver,sys_vserver) | |
290 | SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) | |
291 | diff -NurpP --minimal linux-2.6.2-rc1/arch/sparc/kernel/systbls.S linux-2.6.2-rc1-vs0.05.1/arch/sparc/kernel/systbls.S | |
292 | --- linux-2.6.2-rc1/arch/sparc/kernel/systbls.S Fri Jan 9 07:59:34 2004 | |
293 | +++ linux-2.6.2-rc1-vs0.05.1/arch/sparc/kernel/systbls.S Sat Jan 24 06:45:48 2004 | |
294 | @@ -72,7 +72,7 @@ sys_call_table: | |
295 | /*250*/ .long sparc_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl | |
296 | /*255*/ .long sys_nis_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep | |
297 | /*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun | |
298 | -/*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy | |
299 | +/*265*/ .long sys_timer_delete, sys_timer_create, sys_vserver, sys_io_setup, sys_io_destroy | |
300 | /*270*/ .long sys_io_submit, sys_io_cancel, sys_io_getevents, sys_nis_syscall | |
301 | ||
302 | #ifdef CONFIG_SUNOS_EMUL | |
303 | diff -NurpP --minimal linux-2.6.2-rc1/arch/sparc64/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/sparc64/kernel/ptrace.c | |
304 | --- linux-2.6.2-rc1/arch/sparc64/kernel/ptrace.c Fri Jan 9 08:00:05 2004 | |
305 | +++ linux-2.6.2-rc1-vs0.05.1/arch/sparc64/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
306 | @@ -12,6 +12,7 @@ | |
307 | ||
308 | #include <linux/kernel.h> | |
309 | #include <linux/sched.h> | |
310 | +#include <linux/vinline.h> | |
311 | #include <linux/mm.h> | |
312 | #include <linux/errno.h> | |
313 | #include <linux/ptrace.h> | |
314 | @@ -164,7 +165,7 @@ asmlinkage void do_ptrace(struct pt_regs | |
315 | get_task_struct(child); | |
316 | read_unlock(&tasklist_lock); | |
317 | ||
318 | - if (!child) { | |
319 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) { | |
320 | pt_error_return(regs, ESRCH); | |
321 | goto out; | |
322 | } | |
323 | diff -NurpP --minimal linux-2.6.2-rc1/arch/sparc64/kernel/systbls.S linux-2.6.2-rc1-vs0.05.1/arch/sparc64/kernel/systbls.S | |
324 | --- linux-2.6.2-rc1/arch/sparc64/kernel/systbls.S Fri Jan 9 07:59:26 2004 | |
325 | +++ linux-2.6.2-rc1-vs0.05.1/arch/sparc64/kernel/systbls.S Sat Jan 24 06:45:48 2004 | |
326 | @@ -73,7 +73,7 @@ sys_call_table32: | |
327 | .word sys_ni_syscall, compat_clock_settime, compat_clock_gettime, compat_clock_getres, compat_clock_nanosleep | |
328 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, compat_timer_settime, compat_timer_gettime, sys_timer_getoverrun | |
329 | .word sys_timer_delete, sys32_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy | |
330 | -/*270*/ .word compat_sys_io_submit, sys_io_cancel, compat_sys_io_getevents, sys_ni_syscall | |
331 | +/*270*/ .word compat_sys_io_submit, sys_io_cancel, compat_sys_io_getevents, sys_vserver | |
332 | ||
333 | /* Now the 64-bit native Linux syscall table. */ | |
334 | ||
335 | @@ -135,7 +135,7 @@ sys_call_table: | |
336 | .word sys_ni_syscall, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep | |
337 | /*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun | |
338 | .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy | |
339 | -/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_ni_syscall | |
340 | +/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_vserver | |
341 | ||
342 | #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ | |
343 | defined(CONFIG_SOLARIS_EMUL_MODULE) | |
344 | diff -NurpP --minimal linux-2.6.2-rc1/arch/x86_64/ia32/ia32entry.S linux-2.6.2-rc1-vs0.05.1/arch/x86_64/ia32/ia32entry.S | |
345 | --- linux-2.6.2-rc1/arch/x86_64/ia32/ia32entry.S Fri Jan 9 07:59:27 2004 | |
346 | +++ linux-2.6.2-rc1-vs0.05.1/arch/x86_64/ia32/ia32entry.S Sat Jan 24 06:45:48 2004 | |
347 | @@ -448,34 +448,35 @@ ia32_sys_call_table: | |
348 | .quad compat_sys_sched_getaffinity | |
349 | .quad sys32_set_thread_area | |
350 | .quad sys32_get_thread_area | |
351 | - .quad sys32_io_setup | |
352 | + .quad sys32_io_setup /* 245 */ | |
353 | .quad sys_io_destroy | |
354 | .quad sys32_io_getevents | |
355 | .quad sys32_io_submit | |
356 | .quad sys_io_cancel | |
357 | - .quad sys_fadvise64 | |
358 | + .quad sys_fadvise64 /* 250 */ | |
359 | .quad sys_ni_syscall /* free_huge_pages */ | |
360 | .quad sys_exit_group /* exit_group */ | |
361 | .quad sys_lookup_dcookie | |
362 | .quad sys_epoll_create | |
363 | - .quad sys_epoll_ctl | |
364 | + .quad sys_epoll_ctl /* 255 */ | |
365 | .quad sys_epoll_wait | |
366 | .quad sys_remap_file_pages | |
367 | .quad sys_set_tid_address | |
368 | .quad sys32_timer_create | |
369 | - .quad compat_timer_settime | |
370 | + .quad compat_timer_settime /* 260 */ | |
371 | .quad compat_timer_gettime | |
372 | .quad sys_timer_getoverrun | |
373 | .quad sys_timer_delete | |
374 | .quad compat_clock_settime | |
375 | - .quad compat_clock_gettime | |
376 | + .quad compat_clock_gettime /* 265 */ | |
377 | .quad compat_clock_getres | |
378 | .quad compat_clock_nanosleep | |
379 | .quad compat_statfs64 /* statfs64 */ | |
380 | .quad compat_fstatfs64 /* fstatfs64 */ | |
381 | - .quad sys_tgkill | |
382 | + .quad sys_tgkill /* 270 */ | |
383 | .quad compat_sys_utimes | |
384 | .quad sys32_fadvise64_64 | |
385 | + .quad sys_vserver /* 273 sys_vserver */ | |
386 | /* don't forget to change IA32_NR_syscalls */ | |
387 | ia32_syscall_end: | |
388 | .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 | |
389 | diff -NurpP --minimal linux-2.6.2-rc1/arch/x86_64/kernel/ptrace.c linux-2.6.2-rc1-vs0.05.1/arch/x86_64/kernel/ptrace.c | |
390 | --- linux-2.6.2-rc1/arch/x86_64/kernel/ptrace.c Fri Jan 9 07:59:19 2004 | |
391 | +++ linux-2.6.2-rc1-vs0.05.1/arch/x86_64/kernel/ptrace.c Sat Jan 24 06:45:48 2004 | |
392 | @@ -9,6 +9,7 @@ | |
393 | ||
394 | #include <linux/kernel.h> | |
395 | #include <linux/sched.h> | |
396 | +#include <linux/vinline.h> | |
397 | #include <linux/mm.h> | |
398 | #include <linux/smp.h> | |
399 | #include <linux/smp_lock.h> | |
400 | @@ -205,7 +206,7 @@ asmlinkage long sys_ptrace(long request, | |
401 | if (child) | |
402 | get_task_struct(child); | |
403 | read_unlock(&tasklist_lock); | |
404 | - if (!child) | |
405 | + if (!child || !vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) | |
406 | goto out; | |
407 | ||
408 | ret = -EPERM; | |
409 | diff -NurpP --minimal linux-2.6.2-rc1/fs/ext2/ialloc.c linux-2.6.2-rc1-vs0.05.1/fs/ext2/ialloc.c | |
410 | --- linux-2.6.2-rc1/fs/ext2/ialloc.c Sat Jan 24 03:18:15 2004 | |
411 | +++ linux-2.6.2-rc1-vs0.05.1/fs/ext2/ialloc.c Sat Jan 24 06:14:24 2004 | |
412 | @@ -581,7 +581,7 @@ got: | |
413 | memset(ei->i_data, 0, sizeof(ei->i_data)); | |
414 | ei->i_flags = EXT2_I(dir)->i_flags & ~EXT2_BTREE_FL; | |
415 | if (S_ISLNK(mode)) | |
416 | - ei->i_flags &= ~(EXT2_IMMUTABLE_FL|EXT2_APPEND_FL); | |
417 | + ei->i_flags &= ~(EXT2_IMMUTABLE_FL|EXT2_IUNLINK_FL|EXT2_APPEND_FL); | |
418 | /* dirsync is only applied to directories */ | |
419 | if (!S_ISDIR(mode)) | |
420 | ei->i_flags &= ~EXT2_DIRSYNC_FL; | |
421 | diff -NurpP --minimal linux-2.6.2-rc1/fs/ext2/inode.c linux-2.6.2-rc1-vs0.05.1/fs/ext2/inode.c | |
422 | --- linux-2.6.2-rc1/fs/ext2/inode.c Sat Jan 24 03:18:15 2004 | |
423 | +++ linux-2.6.2-rc1-vs0.05.1/fs/ext2/inode.c Sat Jan 24 06:28:27 2004 | |
424 | @@ -64,6 +64,8 @@ void ext2_put_inode(struct inode *inode) | |
425 | ext2_discard_prealloc(inode); | |
426 | } | |
427 | ||
428 | +static void ext2_truncate_nocheck (struct inode * inode); | |
429 | + | |
430 | /* | |
431 | * Called at the last iput() if i_nlink is zero. | |
432 | */ | |
433 | @@ -77,7 +79,7 @@ void ext2_delete_inode (struct inode * i | |
434 | ||
435 | inode->i_size = 0; | |
436 | if (inode->i_blocks) | |
437 | - ext2_truncate (inode); | |
438 | + ext2_truncate_nocheck(inode); | |
439 | ext2_free_inode (inode); | |
440 | ||
441 | return; | |
442 | @@ -876,7 +878,7 @@ static void ext2_free_branches(struct in | |
443 | ext2_free_data(inode, p, q); | |
444 | } | |
445 | ||
446 | -void ext2_truncate (struct inode * inode) | |
447 | +static void ext2_truncate_nocheck(struct inode * inode) | |
448 | { | |
449 | u32 *i_data = EXT2_I(inode)->i_data; | |
450 | int addr_per_block = EXT2_ADDR_PER_BLOCK(inode->i_sb); | |
451 | @@ -893,8 +895,6 @@ void ext2_truncate (struct inode * inode | |
452 | return; | |
453 | if (ext2_inode_is_fast_symlink(inode)) | |
454 | return; | |
455 | - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) | |
456 | - return; | |
457 | ||
458 | ext2_discard_prealloc(inode); | |
459 | ||
460 | @@ -1016,17 +1016,26 @@ Egdp: | |
461 | return ERR_PTR(-EIO); | |
462 | } | |
463 | ||
464 | +void ext2_truncate (struct inode * inode) | |
465 | +{ | |
466 | + if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) | |
467 | + return; | |
468 | + ext2_truncate_nocheck(inode); | |
469 | +} | |
470 | + | |
471 | void ext2_set_inode_flags(struct inode *inode) | |
472 | { | |
473 | unsigned int flags = EXT2_I(inode)->i_flags; | |
474 | ||
475 | - inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC); | |
476 | + inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_IUNLINK|S_NOATIME|S_DIRSYNC); | |
477 | if (flags & EXT2_SYNC_FL) | |
478 | inode->i_flags |= S_SYNC; | |
479 | if (flags & EXT2_APPEND_FL) | |
480 | inode->i_flags |= S_APPEND; | |
481 | if (flags & EXT2_IMMUTABLE_FL) | |
482 | inode->i_flags |= S_IMMUTABLE; | |
483 | + if (flags & EXT2_IUNLINK_FL) | |
484 | + inode->i_flags |= S_IUNLINK; | |
485 | if (flags & EXT2_NOATIME_FL) | |
486 | inode->i_flags |= S_NOATIME; | |
487 | if (flags & EXT2_DIRSYNC_FL) | |
488 | diff -NurpP --minimal linux-2.6.2-rc1/fs/ext3/ialloc.c linux-2.6.2-rc1-vs0.05.1/fs/ext3/ialloc.c | |
489 | --- linux-2.6.2-rc1/fs/ext3/ialloc.c Sat Jan 24 03:18:15 2004 | |
490 | +++ linux-2.6.2-rc1-vs0.05.1/fs/ext3/ialloc.c Sat Jan 24 06:14:24 2004 | |
491 | @@ -569,7 +569,7 @@ got: | |
492 | ||
493 | ei->i_flags = EXT3_I(dir)->i_flags & ~EXT3_INDEX_FL; | |
494 | if (S_ISLNK(mode)) | |
495 | - ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_APPEND_FL); | |
496 | + ei->i_flags &= ~(EXT3_IMMUTABLE_FL|EXT3_IUNLINK_FL|EXT3_APPEND_FL); | |
497 | /* dirsync only applies to directories */ | |
498 | if (!S_ISDIR(mode)) | |
499 | ei->i_flags &= ~EXT3_DIRSYNC_FL; | |
500 | diff -NurpP --minimal linux-2.6.2-rc1/fs/ext3/inode.c linux-2.6.2-rc1-vs0.05.1/fs/ext3/inode.c | |
501 | --- linux-2.6.2-rc1/fs/ext3/inode.c Sat Jan 24 03:18:15 2004 | |
502 | +++ linux-2.6.2-rc1-vs0.05.1/fs/ext3/inode.c Sat Jan 24 22:44:56 2004 | |
503 | @@ -189,6 +189,8 @@ void ext3_put_inode(struct inode *inode) | |
504 | ext3_discard_prealloc(inode); | |
505 | } | |
506 | ||
507 | +static void ext3_truncate_nocheck (struct inode *inode); | |
508 | + | |
509 | /* | |
510 | * Called at the last iput() if i_nlink is zero. | |
511 | */ | |
512 | @@ -214,7 +216,7 @@ void ext3_delete_inode (struct inode * i | |
513 | handle->h_sync = 1; | |
514 | inode->i_size = 0; | |
515 | if (inode->i_blocks) | |
516 | - ext3_truncate(inode); | |
517 | + ext3_truncate_nocheck(inode); | |
518 | /* | |
519 | * Kill off the orphan record which ext3_truncate created. | |
520 | * AKPM: I think this can be inside the above `if'. | |
521 | @@ -2114,7 +2116,7 @@ static void ext3_free_branches(handle_t | |
522 | * ext3_truncate() run will find them and release them. | |
523 | */ | |
524 | ||
525 | -void ext3_truncate(struct inode * inode) | |
526 | +void ext3_truncate_nocheck(struct inode * inode) | |
527 | { | |
528 | handle_t *handle; | |
529 | struct ext3_inode_info *ei = EXT3_I(inode); | |
530 | @@ -2135,8 +2137,6 @@ void ext3_truncate(struct inode * inode) | |
531 | return; | |
532 | if (ext3_inode_is_fast_symlink(inode)) | |
533 | return; | |
534 | - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) | |
535 | - return; | |
536 | ||
537 | ext3_discard_prealloc(inode); | |
538 | ||
539 | @@ -2443,17 +2443,26 @@ has_buffer: | |
540 | return 0; | |
541 | } | |
542 | ||
543 | +void ext3_truncate(struct inode * inode) | |
544 | +{ | |
545 | + if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) | |
546 | + return; | |
547 | + ext3_truncate_nocheck(inode); | |
548 | +} | |
549 | + | |
550 | void ext3_set_inode_flags(struct inode *inode) | |
551 | { | |
552 | unsigned int flags = EXT3_I(inode)->i_flags; | |
553 | ||
554 | - inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC); | |
555 | + inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_IUNLINK|S_NOATIME|S_DIRSYNC); | |
556 | if (flags & EXT3_SYNC_FL) | |
557 | inode->i_flags |= S_SYNC; | |
558 | if (flags & EXT3_APPEND_FL) | |
559 | inode->i_flags |= S_APPEND; | |
560 | if (flags & EXT3_IMMUTABLE_FL) | |
561 | inode->i_flags |= S_IMMUTABLE; | |
562 | + if (flags & EXT3_IUNLINK_FL) | |
563 | + inode->i_flags |= S_IUNLINK; | |
564 | if (flags & EXT3_NOATIME_FL) | |
565 | inode->i_flags |= S_NOATIME; | |
566 | if (flags & EXT3_DIRSYNC_FL) | |
567 | diff -NurpP --minimal linux-2.6.2-rc1/fs/inode.c linux-2.6.2-rc1-vs0.05.1/fs/inode.c | |
568 | --- linux-2.6.2-rc1/fs/inode.c Fri Jan 9 08:00:12 2004 | |
569 | +++ linux-2.6.2-rc1-vs0.05.1/fs/inode.c Sat Jan 24 06:23:57 2004 | |
570 | @@ -131,6 +131,7 @@ static struct inode *alloc_inode(struct | |
571 | inode->i_bdev = NULL; | |
572 | inode->i_cdev = NULL; | |
573 | inode->i_rdev = 0; | |
574 | + // inode->i_xid = 0; /* maybe not too wise ... */ | |
575 | inode->i_security = NULL; | |
576 | if (security_inode_alloc(inode)) { | |
577 | if (inode->i_sb->s_op->destroy_inode) | |
578 | diff -NurpP --minimal linux-2.6.2-rc1/fs/ioctl.c linux-2.6.2-rc1-vs0.05.1/fs/ioctl.c | |
579 | --- linux-2.6.2-rc1/fs/ioctl.c Sat Jan 24 03:18:15 2004 | |
580 | +++ linux-2.6.2-rc1-vs0.05.1/fs/ioctl.c Sat Jan 24 07:49:20 2004 | |
581 | @@ -9,10 +9,15 @@ | |
582 | #include <linux/file.h> | |
583 | #include <linux/fs.h> | |
584 | #include <linux/security.h> | |
585 | +#include <linux/proc_fs.h> | |
586 | +#include <linux/vserver/inode.h> | |
587 | ||
588 | #include <asm/uaccess.h> | |
589 | #include <asm/ioctls.h> | |
590 | ||
591 | +extern int vx_proc_ioctl(struct inode *, struct file *, | |
592 | + unsigned int, unsigned long); | |
593 | + | |
594 | static int file_ioctl(struct file *filp,unsigned int cmd,unsigned long arg) | |
595 | { | |
596 | int error; | |
597 | @@ -118,6 +123,12 @@ asmlinkage long sys_ioctl(unsigned int f | |
598 | } | |
599 | else | |
600 | error = -ENOTTY; | |
601 | + break; | |
602 | + case FIOC_GETXFLG: | |
603 | + case FIOC_SETXFLG: | |
604 | + error = -ENOTTY; | |
605 | + if (filp->f_dentry->d_inode->i_sb->s_magic == PROC_SUPER_MAGIC) | |
606 | + error = vx_proc_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); | |
607 | break; | |
608 | default: | |
609 | error = -ENOTTY; | |
610 | diff -NurpP --minimal linux-2.6.2-rc1/fs/namei.c linux-2.6.2-rc1-vs0.05.1/fs/namei.c | |
611 | --- linux-2.6.2-rc1/fs/namei.c Fri Jan 9 07:59:26 2004 | |
612 | +++ linux-2.6.2-rc1-vs0.05.1/fs/namei.c Sat Jan 24 06:14:24 2004 | |
613 | @@ -1021,7 +1021,7 @@ static inline int may_delete(struct inod | |
614 | if (IS_APPEND(dir)) | |
615 | return -EPERM; | |
616 | if (check_sticky(dir, victim->d_inode)||IS_APPEND(victim->d_inode)|| | |
617 | - IS_IMMUTABLE(victim->d_inode)) | |
618 | + IS_IXUNLINK(victim->d_inode)) | |
619 | return -EPERM; | |
620 | if (isdir) { | |
621 | if (!S_ISDIR(victim->d_inode->i_mode)) | |
622 | @@ -1816,7 +1816,7 @@ int vfs_link(struct dentry *old_dentry, | |
623 | /* | |
624 | * A link to an append-only or immutable file cannot be created. | |
625 | */ | |
626 | - if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) | |
627 | + if (IS_APPEND(inode) || IS_IXUNLINK(inode)) | |
628 | return -EPERM; | |
629 | if (!dir->i_op || !dir->i_op->link) | |
630 | return -EPERM; | |
631 | diff -NurpP --minimal linux-2.6.2-rc1/fs/proc/Makefile linux-2.6.2-rc1-vs0.05.1/fs/proc/Makefile | |
632 | --- linux-2.6.2-rc1/fs/proc/Makefile Fri Jan 9 07:59:07 2004 | |
633 | +++ linux-2.6.2-rc1-vs0.05.1/fs/proc/Makefile Sat Jan 24 05:45:59 2004 | |
634 | @@ -8,7 +8,7 @@ proc-y := task_nommu.o | |
635 | proc-$(CONFIG_MMU) := task_mmu.o | |
636 | ||
637 | proc-y += inode.o root.o base.o generic.o array.o \ | |
638 | - kmsg.o proc_tty.o proc_misc.o | |
639 | + kmsg.o proc_tty.o proc_misc.o virtual.o | |
640 | ||
641 | proc-$(CONFIG_PROC_KCORE) += kcore.o | |
642 | proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o | |
643 | diff -NurpP --minimal linux-2.6.2-rc1/fs/proc/array.c linux-2.6.2-rc1-vs0.05.1/fs/proc/array.c | |
644 | --- linux-2.6.2-rc1/fs/proc/array.c Fri Jan 9 07:59:44 2004 | |
645 | +++ linux-2.6.2-rc1-vs0.05.1/fs/proc/array.c Sat Jan 24 07:01:35 2004 | |
646 | @@ -73,6 +73,7 @@ | |
647 | #include <linux/highmem.h> | |
648 | #include <linux/file.h> | |
649 | #include <linux/times.h> | |
650 | +#include <linux/vinline.h> | |
651 | ||
652 | #include <asm/uaccess.h> | |
653 | #include <asm/pgtable.h> | |
654 | @@ -150,8 +151,13 @@ static inline const char * get_task_stat | |
655 | static inline char * task_state(struct task_struct *p, char *buffer) | |
656 | { | |
657 | int g; | |
658 | - | |
659 | + pid_t ppid; | |
660 | read_lock(&tasklist_lock); | |
661 | + ppid = p->real_parent->pid; | |
662 | + if (ppid != 0 | |
663 | + && current->vx_info | |
664 | + && current->vx_info->vx_initpid == ppid) | |
665 | + ppid = 1; | |
666 | buffer += sprintf(buffer, | |
667 | "State:\t%s\n" | |
668 | "SleepAVG:\t%lu%%\n" | |
669 | @@ -164,7 +170,7 @@ static inline char * task_state(struct t | |
670 | get_task_state(p), | |
671 | (p->sleep_avg/1024)*100/(1000000000/1024), | |
672 | p->tgid, | |
673 | - p->pid, p->pid ? p->real_parent->pid : 0, | |
674 | + p->pid, p->pid ? ppid : 0, | |
675 | p->pid && p->ptrace ? p->parent->pid : 0, | |
676 | p->uid, p->euid, p->suid, p->fsuid, | |
677 | p->gid, p->egid, p->sgid, p->fsgid); | |
678 | @@ -263,16 +269,20 @@ static inline char *task_cap(struct task | |
679 | { | |
680 | return buffer + sprintf(buffer, "CapInh:\t%016x\n" | |
681 | "CapPrm:\t%016x\n" | |
682 | - "CapEff:\t%016x\n", | |
683 | + "CapEff:\t%016x\n" | |
684 | + "CapBset:\t%016x\n", | |
685 | cap_t(p->cap_inheritable), | |
686 | cap_t(p->cap_permitted), | |
687 | - cap_t(p->cap_effective)); | |
688 | + cap_t(p->cap_effective), | |
689 | + cap_t(p->cap_bset)); | |
690 | } | |
691 | ||
692 | extern char *task_mem(struct mm_struct *, char *); | |
693 | int proc_pid_status(struct task_struct *task, char * buffer) | |
694 | { | |
695 | char * orig = buffer; | |
696 | + struct vx_info *vxi; | |
697 | + struct ip_info *ipi; | |
698 | struct mm_struct *mm = get_task_mm(task); | |
699 | ||
700 | buffer = task_name(task, buffer); | |
701 | @@ -284,6 +294,39 @@ int proc_pid_status(struct task_struct * | |
702 | } | |
703 | buffer = task_sig(task, buffer); | |
704 | buffer = task_cap(task, buffer); | |
705 | + | |
706 | + buffer += sprintf (buffer,"s_context: %d\n", vx_task_xid(task)); | |
707 | + vxi = task_get_vx_info(task); | |
708 | + if (vxi) { | |
709 | + buffer += sprintf (buffer,"ctxflags: %d\n" | |
710 | + ,vxi->vx_flags); | |
711 | + buffer += sprintf (buffer,"initpid: %d\n" | |
712 | + ,vxi->vx_initpid); | |
713 | + } else { | |
714 | + buffer += sprintf (buffer,"ctxflags: none\n"); | |
715 | + buffer += sprintf (buffer,"initpid: none\n"); | |
716 | + } | |
717 | + put_vx_info(vxi); | |
718 | + ipi = task_get_ip_info(task); | |
719 | + if (ipi) { | |
720 | + int i; | |
721 | + | |
722 | + buffer += sprintf (buffer,"ipv4root:"); | |
723 | + for (i=0; i<ipi->nbipv4; i++){ | |
724 | + buffer += sprintf (buffer," %08x/%08x" | |
725 | + ,ipi->ipv4[i] | |
726 | + ,ipi->mask[i]); | |
727 | + } | |
728 | + *buffer++ = '\n'; | |
729 | + buffer += sprintf (buffer,"ipv4root_bcast: %08x\n" | |
730 | + ,ipi->v4_bcast); | |
731 | + buffer += sprintf (buffer,"ipv4root_refcnt: %d\n" | |
732 | + ,atomic_read(&ipi->ip_refcount)); | |
733 | + } else { | |
734 | + buffer += sprintf (buffer,"ipv4root: 0\n"); | |
735 | + buffer += sprintf (buffer,"ipv4root_bcast: 0\n"); | |
736 | + } | |
737 | + put_ip_info(ipi); | |
738 | #if defined(CONFIG_ARCH_S390) | |
739 | buffer = task_show_regs(task, buffer); | |
740 | #endif | |
741 | diff -NurpP --minimal linux-2.6.2-rc1/fs/proc/base.c linux-2.6.2-rc1-vs0.05.1/fs/proc/base.c | |
742 | --- linux-2.6.2-rc1/fs/proc/base.c Sat Jan 24 03:18:15 2004 | |
743 | +++ linux-2.6.2-rc1-vs0.05.1/fs/proc/base.c Sat Jan 24 06:29:01 2004 | |
744 | @@ -32,6 +32,7 @@ | |
745 | #include <linux/mount.h> | |
746 | #include <linux/security.h> | |
747 | #include <linux/ptrace.h> | |
748 | +#include <linux/vinline.h> | |
749 | ||
750 | /* | |
751 | * For hysterical raisins we keep the same inumbers as in the old procfs. | |
752 | @@ -67,6 +68,7 @@ enum pid_directory_inos { | |
753 | PROC_TGID_ATTR_EXEC, | |
754 | PROC_TGID_ATTR_FSCREATE, | |
755 | #endif | |
756 | + PROC_TGID_VINFO, | |
757 | PROC_TGID_FD_DIR, | |
758 | PROC_TID_INO, | |
759 | PROC_TID_STATUS, | |
760 | @@ -90,6 +92,7 @@ enum pid_directory_inos { | |
761 | PROC_TID_ATTR_EXEC, | |
762 | PROC_TID_ATTR_FSCREATE, | |
763 | #endif | |
764 | + PROC_TID_VINFO, | |
765 | PROC_TID_FD_DIR = 0x8000, /* 0x8000-0xffff */ | |
766 | }; | |
767 | ||
768 | @@ -123,6 +126,7 @@ static struct pid_entry tgid_base_stuff[ | |
769 | #ifdef CONFIG_KALLSYMS | |
770 | E(PROC_TGID_WCHAN, "wchan", S_IFREG|S_IRUGO), | |
771 | #endif | |
772 | + E(PROC_TGID_VINFO, "vinfo", S_IFREG|S_IRUGO), | |
773 | {0,0,NULL,0} | |
774 | }; | |
775 | static struct pid_entry tid_base_stuff[] = { | |
776 | @@ -145,6 +149,7 @@ static struct pid_entry tid_base_stuff[] | |
777 | #ifdef CONFIG_KALLSYMS | |
778 | E(PROC_TID_WCHAN, "wchan", S_IFREG|S_IRUGO), | |
779 | #endif | |
780 | + E(PROC_TID_VINFO, "vinfo", S_IFREG|S_IRUGO), | |
781 | {0,0,NULL,0} | |
782 | }; | |
783 | ||
784 | @@ -181,6 +186,7 @@ int proc_pid_stat(struct task_struct*,ch | |
785 | int proc_pid_status(struct task_struct*,char*); | |
786 | int proc_pid_statm(struct task_struct*,char*); | |
787 | int proc_pid_cpu(struct task_struct*,char*); | |
788 | +// int proc_pid_vinfo(struct task_struct*,char*); | |
789 | ||
790 | static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsmount **mnt) | |
791 | { | |
792 | @@ -963,6 +969,7 @@ static struct inode *proc_pid_make_inode | |
793 | inode->i_uid = task->euid; | |
794 | inode->i_gid = task->egid; | |
795 | } | |
796 | + // inode->i_xid = vx_task_xid(task); | |
797 | security_task_to_inode(task, inode); | |
798 | ||
799 | out: | |
800 | @@ -1392,6 +1399,11 @@ static struct dentry *proc_pident_lookup | |
801 | ei->op.proc_read = proc_pid_wchan; | |
802 | break; | |
803 | #endif | |
804 | + case PROC_TID_VINFO: | |
805 | + case PROC_TGID_VINFO: | |
806 | + inode->i_fop = &proc_info_file_operations; | |
807 | + ei->op.proc_read = proc_pid_vinfo; | |
808 | + break; | |
809 | default: | |
810 | printk("procfs: impossible type (%d)",p->type); | |
811 | iput(inode); | |
812 | @@ -1584,6 +1596,10 @@ struct dentry *proc_pid_lookup(struct in | |
813 | if (!task) | |
814 | goto out; | |
815 | ||
816 | + if (tgid != 1 && !vx_check(vx_task_xid(task), VX_WATCH|VX_IDENT)) { | |
817 | + put_task_struct(task); | |
818 | + goto out; | |
819 | + } | |
820 | inode = proc_pid_make_inode(dir->i_sb, task, PROC_TGID_INO); | |
821 | ||
822 | ||
823 | @@ -1691,6 +1707,10 @@ static int get_tgid_list(int index, unsi | |
824 | for ( ; p != &init_task; p = next_task(p)) { | |
825 | int tgid = p->pid; | |
826 | if (!pid_alive(p)) | |
827 | + continue; | |
828 | + if (tgid != 1 && !vx_check(vx_task_xid(p), VX_WATCH|VX_IDENT)) | |
829 | + continue; | |
830 | + if (current->vx_info && current->vx_info->vx_initpid == tgid) | |
831 | continue; | |
832 | if (--index >= 0) | |
833 | continue; | |
834 | diff -NurpP --minimal linux-2.6.2-rc1/fs/proc/generic.c linux-2.6.2-rc1-vs0.05.1/fs/proc/generic.c | |
835 | --- linux-2.6.2-rc1/fs/proc/generic.c Fri Jan 9 08:00:12 2004 | |
836 | +++ linux-2.6.2-rc1-vs0.05.1/fs/proc/generic.c Sat Jan 24 05:45:59 2004 | |
837 | @@ -15,6 +15,7 @@ | |
838 | #include <linux/module.h> | |
839 | #include <linux/mount.h> | |
840 | #include <linux/smp_lock.h> | |
841 | +#include <linux/vinline.h> | |
842 | #include <asm/uaccess.h> | |
843 | #include <asm/bitops.h> | |
844 | ||
845 | @@ -349,6 +350,8 @@ struct dentry *proc_lookup(struct inode | |
846 | for (de = de->subdir; de ; de = de->next) { | |
847 | if (de->namelen != dentry->d_name.len) | |
848 | continue; | |
849 | + if (!vx_weak_check(0, de->vx_flags)) | |
850 | + continue; | |
851 | if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { | |
852 | int ino = de->low_ino; | |
853 | error = -EINVAL; | |
854 | @@ -424,9 +427,12 @@ int proc_readdir(struct file * filp, | |
855 | } | |
856 | ||
857 | do { | |
858 | + if (!vx_weak_check(0, de->vx_flags)) | |
859 | + goto skip; | |
860 | if (filldir(dirent, de->name, de->namelen, filp->f_pos, | |
861 | de->low_ino, de->mode >> 12) < 0) | |
862 | goto out; | |
863 | + skip: | |
864 | filp->f_pos++; | |
865 | de = de->next; | |
866 | } while (de); | |
867 | @@ -538,6 +544,7 @@ static struct proc_dir_entry *proc_creat | |
868 | ent->namelen = len; | |
869 | ent->mode = mode; | |
870 | ent->nlink = nlink; | |
871 | + ent->vx_flags = VX_ADMIN; | |
872 | out: | |
873 | return ent; | |
874 | } | |
875 | @@ -558,7 +565,8 @@ struct proc_dir_entry *proc_symlink(cons | |
876 | kfree(ent->data); | |
877 | kfree(ent); | |
878 | ent = NULL; | |
879 | - } | |
880 | + } else | |
881 | + ent->vx_flags = 0; | |
882 | } else { | |
883 | kfree(ent); | |
884 | ent = NULL; | |
885 | diff -NurpP --minimal linux-2.6.2-rc1/fs/proc/inode.c linux-2.6.2-rc1-vs0.05.1/fs/proc/inode.c | |
886 | --- linux-2.6.2-rc1/fs/proc/inode.c Fri Jan 9 08:00:02 2004 | |
887 | +++ linux-2.6.2-rc1-vs0.05.1/fs/proc/inode.c Sat Jan 24 05:45:59 2004 | |
888 | @@ -207,6 +207,8 @@ printk("proc_iget: using deleted entry % | |
889 | inode->i_uid = de->uid; | |
890 | inode->i_gid = de->gid; | |
891 | } | |
892 | + if (de->vx_flags) | |
893 | + PROC_I(inode)->vx_flags = de->vx_flags; | |
894 | if (de->size) | |
895 | inode->i_size = de->size; | |
896 | if (de->nlink) | |
897 | diff -NurpP --minimal linux-2.6.2-rc1/fs/proc/root.c linux-2.6.2-rc1-vs0.05.1/fs/proc/root.c | |
898 | --- linux-2.6.2-rc1/fs/proc/root.c Fri Jan 9 07:59:55 2004 | |
899 | +++ linux-2.6.2-rc1-vs0.05.1/fs/proc/root.c Sat Jan 24 05:45:59 2004 | |
900 | @@ -23,6 +23,9 @@ struct proc_dir_entry *proc_net, *proc_b | |
901 | #ifdef CONFIG_SYSCTL | |
902 | struct proc_dir_entry *proc_sys_root; | |
903 | #endif | |
904 | +struct proc_dir_entry *proc_virtual; | |
905 | + | |
906 | +extern void proc_vx_init(void); | |
907 | ||
908 | static struct super_block *proc_get_sb(struct file_system_type *fs_type, | |
909 | int flags, const char *dev_name, void *data) | |
910 | @@ -78,6 +81,7 @@ void __init proc_root_init(void) | |
911 | proc_rtas_init(); | |
912 | #endif | |
913 | proc_bus = proc_mkdir("bus", 0); | |
914 | + proc_vx_init(); | |
915 | } | |
916 | ||
917 | static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd) | |
918 | diff -NurpP --minimal linux-2.6.2-rc1/fs/proc/virtual.c linux-2.6.2-rc1-vs0.05.1/fs/proc/virtual.c | |
919 | --- linux-2.6.2-rc1/fs/proc/virtual.c Thu Jan 1 01:00:00 1970 | |
920 | +++ linux-2.6.2-rc1-vs0.05.1/fs/proc/virtual.c Sat Jan 24 06:42:17 2004 | |
921 | @@ -0,0 +1,548 @@ | |
922 | +/* | |
923 | + * linux/fs/proc/virtual.c | |
924 | + * | |
925 | + * Virtual Context Support | |
926 | + * | |
927 |