1 |
This is TOMOYO Linux patch for kernel 2.4.37.9. |
This is TOMOYO Linux patch for kernel 2.4.37.10. |
2 |
|
|
3 |
Source code for this patch is http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.37.9.tar.bz2 |
Source code for this patch is http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.37.10.tar.bz2 |
4 |
--- |
--- |
5 |
Makefile | 8 ++++++++ |
Makefile | 8 ++++++++ |
6 |
arch/alpha/kernel/ptrace.c | 3 +++ |
arch/alpha/kernel/ptrace.c | 3 +++ |
26 |
arch/x86_64/kernel/ptrace.c | 3 +++ |
arch/x86_64/kernel/ptrace.c | 3 +++ |
27 |
fs/Config.in | 3 +++ |
fs/Config.in | 3 +++ |
28 |
fs/exec.c | 12 +++++++++++- |
fs/exec.c | 12 +++++++++++- |
29 |
fs/fcntl.c | 4 ++++ |
fs/fcntl.c | 5 +++++ |
30 |
fs/ioctl.c | 6 ++++++ |
fs/ioctl.c | 6 ++++++ |
31 |
fs/namei.c | 39 +++++++++++++++++++++++++++++++++++++++ |
fs/namei.c | 39 +++++++++++++++++++++++++++++++++++++++ |
32 |
fs/namespace.c | 17 +++++++++++++++++ |
fs/namespace.c | 17 +++++++++++++++++ |
47 |
net/ipv6/tcp_ipv6.c | 3 +++ |
net/ipv6/tcp_ipv6.c | 3 +++ |
48 |
net/ipv6/udp.c | 14 +++++++++++++- |
net/ipv6/udp.c | 14 +++++++++++++- |
49 |
net/socket.c | 23 +++++++++++++++++++++-- |
net/socket.c | 23 +++++++++++++++++++++-- |
50 |
net/unix/af_unix.c | 4 ++++ |
net/unix/af_unix.c | 9 +++++++++ |
51 |
46 files changed, 326 insertions(+), 12 deletions(-) |
46 files changed, 332 insertions(+), 12 deletions(-) |
52 |
|
|
53 |
--- linux-2.4.37.9.orig/Makefile |
--- linux-2.4.37.10.orig/Makefile |
54 |
+++ linux-2.4.37.9/Makefile |
+++ linux-2.4.37.10/Makefile |
55 |
@@ -139,6 +139,14 @@ NETWORKS =net/network.o |
@@ -139,6 +139,14 @@ NETWORKS =net/network.o |
56 |
|
|
57 |
LIBS =$(TOPDIR)/lib/lib.a |
LIBS =$(TOPDIR)/lib/lib.a |
67 |
|
|
68 |
DRIVERS-n := |
DRIVERS-n := |
69 |
DRIVERS-y := |
DRIVERS-y := |
70 |
--- linux-2.4.37.9.orig/arch/alpha/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/alpha/kernel/ptrace.c |
71 |
+++ linux-2.4.37.9/arch/alpha/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/alpha/kernel/ptrace.c |
72 |
@@ -18,6 +18,7 @@ |
@@ -18,6 +18,7 @@ |
73 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
74 |
#include <asm/system.h> |
#include <asm/system.h> |
86 |
|
|
87 |
lock_kernel(); |
lock_kernel(); |
88 |
DBG(DBG_MEM, ("request=%ld pid=%ld addr=0x%lx data=0x%lx\n", |
DBG(DBG_MEM, ("request=%ld pid=%ld addr=0x%lx data=0x%lx\n", |
89 |
--- linux-2.4.37.9.orig/arch/arm/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/arm/kernel/ptrace.c |
90 |
+++ linux-2.4.37.9/arch/arm/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/arm/kernel/ptrace.c |
91 |
@@ -22,6 +22,7 @@ |
@@ -22,6 +22,7 @@ |
92 |
#include <asm/uaccess.h> |
#include <asm/uaccess.h> |
93 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
105 |
|
|
106 |
lock_kernel(); |
lock_kernel(); |
107 |
ret = -EPERM; |
ret = -EPERM; |
108 |
--- linux-2.4.37.9.orig/arch/cris/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/cris/kernel/ptrace.c |
109 |
+++ linux-2.4.37.9/arch/cris/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/cris/kernel/ptrace.c |
110 |
@@ -48,6 +48,7 @@ |
@@ -48,6 +48,7 @@ |
111 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
112 |
#include <asm/system.h> |
#include <asm/system.h> |
124 |
|
|
125 |
lock_kernel(); |
lock_kernel(); |
126 |
ret = -EPERM; |
ret = -EPERM; |
127 |
--- linux-2.4.37.9.orig/arch/i386/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/i386/kernel/ptrace.c |
128 |
+++ linux-2.4.37.9/arch/i386/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/i386/kernel/ptrace.c |
129 |
@@ -20,6 +20,7 @@ |
@@ -20,6 +20,7 @@ |
130 |
#include <asm/processor.h> |
#include <asm/processor.h> |
131 |
#include <asm/i387.h> |
#include <asm/i387.h> |
143 |
|
|
144 |
lock_kernel(); |
lock_kernel(); |
145 |
ret = -EPERM; |
ret = -EPERM; |
146 |
--- linux-2.4.37.9.orig/arch/ia64/ia32/sys_ia32.c |
--- linux-2.4.37.10.orig/arch/ia64/ia32/sys_ia32.c |
147 |
+++ linux-2.4.37.9/arch/ia64/ia32/sys_ia32.c |
+++ linux-2.4.37.10/arch/ia64/ia32/sys_ia32.c |
148 |
@@ -57,6 +57,7 @@ |
@@ -57,6 +57,7 @@ |
149 |
#include <net/scm.h> |
#include <net/scm.h> |
150 |
#include <net/sock.h> |
#include <net/sock.h> |
162 |
|
|
163 |
lock_kernel(); |
lock_kernel(); |
164 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |
165 |
--- linux-2.4.37.9.orig/arch/ia64/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/ia64/kernel/ptrace.c |
166 |
+++ linux-2.4.37.9/arch/ia64/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/ia64/kernel/ptrace.c |
167 |
@@ -27,6 +27,7 @@ |
@@ -27,6 +27,7 @@ |
168 |
#ifdef CONFIG_PERFMON |
#ifdef CONFIG_PERFMON |
169 |
#include <asm/perfmon.h> |
#include <asm/perfmon.h> |
181 |
|
|
182 |
lock_kernel(); |
lock_kernel(); |
183 |
ret = -EPERM; |
ret = -EPERM; |
184 |
--- linux-2.4.37.9.orig/arch/m68k/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/m68k/kernel/ptrace.c |
185 |
+++ linux-2.4.37.9/arch/m68k/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/m68k/kernel/ptrace.c |
186 |
@@ -25,6 +25,7 @@ |
@@ -25,6 +25,7 @@ |
187 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
188 |
#include <asm/system.h> |
#include <asm/system.h> |
200 |
|
|
201 |
lock_kernel(); |
lock_kernel(); |
202 |
ret = -EPERM; |
ret = -EPERM; |
203 |
--- linux-2.4.37.9.orig/arch/mips/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/mips/kernel/ptrace.c |
204 |
+++ linux-2.4.37.9/arch/mips/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/mips/kernel/ptrace.c |
205 |
@@ -28,6 +28,7 @@ |
@@ -28,6 +28,7 @@ |
206 |
#include <asm/bootinfo.h> |
#include <asm/bootinfo.h> |
207 |
#include <asm/cpu.h> |
#include <asm/cpu.h> |
219 |
|
|
220 |
lock_kernel(); |
lock_kernel(); |
221 |
#if 0 |
#if 0 |
222 |
--- linux-2.4.37.9.orig/arch/mips64/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/mips64/kernel/ptrace.c |
223 |
+++ linux-2.4.37.9/arch/mips64/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/mips64/kernel/ptrace.c |
224 |
@@ -30,6 +30,7 @@ |
@@ -30,6 +30,7 @@ |
225 |
#include <asm/system.h> |
#include <asm/system.h> |
226 |
#include <asm/uaccess.h> |
#include <asm/uaccess.h> |
247 |
|
|
248 |
lock_kernel(); |
lock_kernel(); |
249 |
#if 0 |
#if 0 |
250 |
--- linux-2.4.37.9.orig/arch/parisc/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/parisc/kernel/ptrace.c |
251 |
+++ linux-2.4.37.9/arch/parisc/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/parisc/kernel/ptrace.c |
252 |
@@ -21,6 +21,7 @@ |
@@ -21,6 +21,7 @@ |
253 |
#include <asm/system.h> |
#include <asm/system.h> |
254 |
#include <asm/processor.h> |
#include <asm/processor.h> |
266 |
|
|
267 |
lock_kernel(); |
lock_kernel(); |
268 |
ret = -EPERM; |
ret = -EPERM; |
269 |
--- linux-2.4.37.9.orig/arch/ppc/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/ppc/kernel/ptrace.c |
270 |
+++ linux-2.4.37.9/arch/ppc/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/ppc/kernel/ptrace.c |
271 |
@@ -29,6 +29,7 @@ |
@@ -29,6 +29,7 @@ |
272 |
#include <asm/page.h> |
#include <asm/page.h> |
273 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
285 |
|
|
286 |
lock_kernel(); |
lock_kernel(); |
287 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |
288 |
--- linux-2.4.37.9.orig/arch/ppc64/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/ppc64/kernel/ptrace.c |
289 |
+++ linux-2.4.37.9/arch/ppc64/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/ppc64/kernel/ptrace.c |
290 |
@@ -30,6 +30,7 @@ |
@@ -30,6 +30,7 @@ |
291 |
#include <asm/page.h> |
#include <asm/page.h> |
292 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
304 |
|
|
305 |
lock_kernel(); |
lock_kernel(); |
306 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |
307 |
--- linux-2.4.37.9.orig/arch/ppc64/kernel/ptrace32.c |
--- linux-2.4.37.10.orig/arch/ppc64/kernel/ptrace32.c |
308 |
+++ linux-2.4.37.9/arch/ppc64/kernel/ptrace32.c |
+++ linux-2.4.37.10/arch/ppc64/kernel/ptrace32.c |
309 |
@@ -30,6 +30,7 @@ |
@@ -30,6 +30,7 @@ |
310 |
#include <asm/page.h> |
#include <asm/page.h> |
311 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
323 |
|
|
324 |
lock_kernel(); |
lock_kernel(); |
325 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |
326 |
--- linux-2.4.37.9.orig/arch/s390/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/s390/kernel/ptrace.c |
327 |
+++ linux-2.4.37.9/arch/s390/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/s390/kernel/ptrace.c |
328 |
@@ -37,6 +37,7 @@ |
@@ -37,6 +37,7 @@ |
329 |
#include <asm/pgalloc.h> |
#include <asm/pgalloc.h> |
330 |
#include <asm/system.h> |
#include <asm/system.h> |
342 |
|
|
343 |
lock_kernel(); |
lock_kernel(); |
344 |
if (request == PTRACE_TRACEME) |
if (request == PTRACE_TRACEME) |
345 |
--- linux-2.4.37.9.orig/arch/s390x/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/s390x/kernel/ptrace.c |
346 |
+++ linux-2.4.37.9/arch/s390x/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/s390x/kernel/ptrace.c |
347 |
@@ -43,6 +43,7 @@ |
@@ -43,6 +43,7 @@ |
348 |
#else |
#else |
349 |
#define parent_31bit 0 |
#define parent_31bit 0 |
361 |
lock_kernel(); |
lock_kernel(); |
362 |
if (request == PTRACE_TRACEME) |
if (request == PTRACE_TRACEME) |
363 |
{ |
{ |
364 |
--- linux-2.4.37.9.orig/arch/sh/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/sh/kernel/ptrace.c |
365 |
+++ linux-2.4.37.9/arch/sh/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/sh/kernel/ptrace.c |
366 |
@@ -26,6 +26,7 @@ |
@@ -26,6 +26,7 @@ |
367 |
#include <asm/system.h> |
#include <asm/system.h> |
368 |
#include <asm/processor.h> |
#include <asm/processor.h> |
380 |
|
|
381 |
lock_kernel(); |
lock_kernel(); |
382 |
ret = -EPERM; |
ret = -EPERM; |
383 |
--- linux-2.4.37.9.orig/arch/sh64/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/sh64/kernel/ptrace.c |
384 |
+++ linux-2.4.37.9/arch/sh64/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/sh64/kernel/ptrace.c |
385 |
@@ -32,6 +32,7 @@ |
@@ -32,6 +32,7 @@ |
386 |
#include <asm/system.h> |
#include <asm/system.h> |
387 |
#include <asm/processor.h> |
#include <asm/processor.h> |
399 |
|
|
400 |
lock_kernel(); |
lock_kernel(); |
401 |
ret = -EPERM; |
ret = -EPERM; |
402 |
--- linux-2.4.37.9.orig/arch/sparc/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/sparc/kernel/ptrace.c |
403 |
+++ linux-2.4.37.9/arch/sparc/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/sparc/kernel/ptrace.c |
404 |
@@ -21,6 +21,7 @@ |
@@ -21,6 +21,7 @@ |
405 |
#include <asm/pgtable.h> |
#include <asm/pgtable.h> |
406 |
#include <asm/system.h> |
#include <asm/system.h> |
420 |
|
|
421 |
lock_kernel(); |
lock_kernel(); |
422 |
#ifdef DEBUG_PTRACE |
#ifdef DEBUG_PTRACE |
423 |
--- linux-2.4.37.9.orig/arch/sparc64/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/sparc64/kernel/ptrace.c |
424 |
+++ linux-2.4.37.9/arch/sparc64/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/sparc64/kernel/ptrace.c |
425 |
@@ -26,6 +26,7 @@ |
@@ -26,6 +26,7 @@ |
426 |
#include <asm/psrcompat.h> |
#include <asm/psrcompat.h> |
427 |
#include <asm/visasm.h> |
#include <asm/visasm.h> |
441 |
|
|
442 |
if (current->thread.flags & SPARC_FLAG_32BIT) { |
if (current->thread.flags & SPARC_FLAG_32BIT) { |
443 |
addr &= 0xffffffffUL; |
addr &= 0xffffffffUL; |
444 |
--- linux-2.4.37.9.orig/arch/x86_64/ia32/ptrace32.c |
--- linux-2.4.37.10.orig/arch/x86_64/ia32/ptrace32.c |
445 |
+++ linux-2.4.37.9/arch/x86_64/ia32/ptrace32.c |
+++ linux-2.4.37.10/arch/x86_64/ia32/ptrace32.c |
446 |
@@ -24,6 +24,7 @@ |
@@ -24,6 +24,7 @@ |
447 |
#include <asm/i387.h> |
#include <asm/i387.h> |
448 |
#include <asm/fpu32.h> |
#include <asm/fpu32.h> |
460 |
|
|
461 |
switch (request) { |
switch (request) { |
462 |
case PTRACE_TRACEME: |
case PTRACE_TRACEME: |
463 |
--- linux-2.4.37.9.orig/arch/x86_64/kernel/ptrace.c |
--- linux-2.4.37.10.orig/arch/x86_64/kernel/ptrace.c |
464 |
+++ linux-2.4.37.9/arch/x86_64/kernel/ptrace.c |
+++ linux-2.4.37.10/arch/x86_64/kernel/ptrace.c |
465 |
@@ -22,6 +22,7 @@ |
@@ -22,6 +22,7 @@ |
466 |
#include <asm/processor.h> |
#include <asm/processor.h> |
467 |
#include <asm/i387.h> |
#include <asm/i387.h> |
479 |
|
|
480 |
/* This lock_kernel fixes a subtle race with suid exec */ |
/* This lock_kernel fixes a subtle race with suid exec */ |
481 |
lock_kernel(); |
lock_kernel(); |
482 |
--- linux-2.4.37.9.orig/fs/Config.in |
--- linux-2.4.37.10.orig/fs/Config.in |
483 |
+++ linux-2.4.37.9/fs/Config.in |
+++ linux-2.4.37.10/fs/Config.in |
484 |
@@ -176,4 +176,7 @@ comment 'Partition Types' |
@@ -176,4 +176,7 @@ comment 'Partition Types' |
485 |
source fs/partitions/Config.in |
source fs/partitions/Config.in |
486 |
endmenu |
endmenu |
489 |
endmenu |
endmenu |
490 |
+ |
+ |
491 |
+source security/ccsecurity/Config.in |
+source security/ccsecurity/Config.in |
492 |
--- linux-2.4.37.9.orig/fs/exec.c |
--- linux-2.4.37.10.orig/fs/exec.c |
493 |
+++ linux-2.4.37.9/fs/exec.c |
+++ linux-2.4.37.10/fs/exec.c |
494 |
@@ -48,6 +48,8 @@ |
@@ -48,6 +48,8 @@ |
495 |
#include <linux/kmod.h> |
#include <linux/kmod.h> |
496 |
#endif |
#endif |
531 |
if (retval >= 0) |
if (retval >= 0) |
532 |
/* execve success */ |
/* execve success */ |
533 |
return retval; |
return retval; |
534 |
--- linux-2.4.37.9.orig/fs/fcntl.c |
--- linux-2.4.37.10.orig/fs/fcntl.c |
535 |
+++ linux-2.4.37.9/fs/fcntl.c |
+++ linux-2.4.37.10/fs/fcntl.c |
536 |
@@ -16,6 +16,7 @@ |
@@ -16,6 +16,7 @@ |
537 |
#include <asm/poll.h> |
#include <asm/poll.h> |
538 |
#include <asm/siginfo.h> |
#include <asm/siginfo.h> |
541 |
|
|
542 |
extern int sock_fcntl (struct file *, unsigned int cmd, unsigned long arg); |
extern int sock_fcntl (struct file *, unsigned int cmd, unsigned long arg); |
543 |
extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); |
extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); |
544 |
@@ -214,6 +215,9 @@ static int setfl(int fd, struct file * f |
@@ -346,6 +347,8 @@ asmlinkage long sys_fcntl(unsigned int f |
545 |
if (!(arg & O_APPEND) && IS_APPEND(inode)) |
if (!filp) |
546 |
return -EPERM; |
goto out; |
547 |
|
|
548 |
+ if (!(arg & O_APPEND) && ccs_rewrite_permission(filp)) |
+ err = ccs_fcntl_permission(filp, cmd, arg); |
549 |
+ return -EPERM; |
+ if (!err) |
550 |
+ |
err = do_fcntl(fd, cmd, arg, filp); |
551 |
/* Did FASYNC state change? */ |
|
552 |
if ((arg ^ filp->f_flags) & FASYNC) { |
fput(filp); |
553 |
if (filp->f_op && filp->f_op->fasync) { |
@@ -364,6 +367,8 @@ asmlinkage long sys_fcntl64(unsigned int |
554 |
--- linux-2.4.37.9.orig/fs/ioctl.c |
if (!filp) |
555 |
+++ linux-2.4.37.9/fs/ioctl.c |
goto out; |
556 |
|
|
557 |
|
+ err = ccs_fcntl_permission(filp, cmd, arg); |
558 |
|
+ if (!err) |
559 |
|
switch (cmd) { |
560 |
|
case F_GETLK64: |
561 |
|
err = fcntl_getlk64(fd, (struct flock64 *) arg); |
562 |
|
--- linux-2.4.37.10.orig/fs/ioctl.c |
563 |
|
+++ linux-2.4.37.10/fs/ioctl.c |
564 |
@@ -10,6 +10,7 @@ |
@@ -10,6 +10,7 @@ |
565 |
|
|
566 |
#include <asm/uaccess.h> |
#include <asm/uaccess.h> |
581 |
error = 0; |
error = 0; |
582 |
lock_kernel(); |
lock_kernel(); |
583 |
switch (cmd) { |
switch (cmd) { |
584 |
--- linux-2.4.37.9.orig/fs/namei.c |
--- linux-2.4.37.10.orig/fs/namei.c |
585 |
+++ linux-2.4.37.9/fs/namei.c |
+++ linux-2.4.37.10/fs/namei.c |
586 |
@@ -28,6 +28,9 @@ |
@@ -28,6 +28,9 @@ |
587 |
|
|
588 |
#define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE]) |
#define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE]) |
712 |
dput(new_dentry); |
dput(new_dentry); |
713 |
exit4: |
exit4: |
714 |
dput(old_dentry); |
dput(old_dentry); |
715 |
--- linux-2.4.37.9.orig/fs/namespace.c |
--- linux-2.4.37.10.orig/fs/namespace.c |
716 |
+++ linux-2.4.37.9/fs/namespace.c |
+++ linux-2.4.37.10/fs/namespace.c |
717 |
@@ -21,6 +21,8 @@ |
@@ -21,6 +21,8 @@ |
718 |
#include <linux/seq_file.h> |
#include <linux/seq_file.h> |
719 |
#include <linux/namespace.h> |
#include <linux/namespace.h> |
773 |
read_lock(¤t->fs->lock); |
read_lock(¤t->fs->lock); |
774 |
user_nd.mnt = mntget(current->fs->rootmnt); |
user_nd.mnt = mntget(current->fs->rootmnt); |
775 |
user_nd.dentry = dget(current->fs->root); |
user_nd.dentry = dget(current->fs->root); |
776 |
--- linux-2.4.37.9.orig/fs/open.c |
--- linux-2.4.37.10.orig/fs/open.c |
777 |
+++ linux-2.4.37.9/fs/open.c |
+++ linux-2.4.37.10/fs/open.c |
778 |
@@ -20,6 +20,8 @@ |
@@ -20,6 +20,8 @@ |
779 |
|
|
780 |
#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) |
#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) |
880 |
if (capable(CAP_SYS_TTY_CONFIG)) { |
if (capable(CAP_SYS_TTY_CONFIG)) { |
881 |
tty_vhangup(current->tty); |
tty_vhangup(current->tty); |
882 |
return 0; |
return 0; |
883 |
--- linux-2.4.37.9.orig/fs/proc/proc_misc.c |
--- linux-2.4.37.10.orig/fs/proc/proc_misc.c |
884 |
+++ linux-2.4.37.9/fs/proc/proc_misc.c |
+++ linux-2.4.37.10/fs/proc/proc_misc.c |
885 |
@@ -670,4 +670,5 @@ void __init proc_misc_init(void) |
@@ -670,4 +670,5 @@ void __init proc_misc_init(void) |
886 |
entry->proc_fops = &ppc_htab_operations; |
entry->proc_fops = &ppc_htab_operations; |
887 |
} |
} |
888 |
#endif |
#endif |
889 |
+ printk(KERN_INFO "Hook version: 2.4.37.9 2010/07/26\n"); |
+ printk(KERN_INFO "Hook version: 2.4.37.10 2010/09/06\n"); |
890 |
} |
} |
891 |
--- linux-2.4.37.9.orig/include/linux/sched.h |
--- linux-2.4.37.10.orig/include/linux/sched.h |
892 |
+++ linux-2.4.37.9/include/linux/sched.h |
+++ linux-2.4.37.10/include/linux/sched.h |
893 |
@@ -123,6 +123,15 @@ struct completion; |
@@ -123,6 +123,15 @@ struct completion; |
894 |
|
|
895 |
#ifdef __KERNEL__ |
#ifdef __KERNEL__ |
925 |
} |
} |
926 |
|
|
927 |
|
|
928 |
--- linux-2.4.37.9.orig/kernel/kmod.c |
--- linux-2.4.37.10.orig/kernel/kmod.c |
929 |
+++ linux-2.4.37.9/kernel/kmod.c |
+++ linux-2.4.37.10/kernel/kmod.c |
930 |
@@ -134,6 +134,11 @@ int exec_usermodehelper(char *program_pa |
@@ -134,6 +134,11 @@ int exec_usermodehelper(char *program_pa |
931 |
/* Allow execve args to be in kernel space. */ |
/* Allow execve args to be in kernel space. */ |
932 |
set_fs(KERNEL_DS); |
set_fs(KERNEL_DS); |
939 |
/* Go, go, go... */ |
/* Go, go, go... */ |
940 |
if (execve(program_path, argv, envp) < 0) |
if (execve(program_path, argv, envp) < 0) |
941 |
return -errno; |
return -errno; |
942 |
--- linux-2.4.37.9.orig/kernel/module.c |
--- linux-2.4.37.10.orig/kernel/module.c |
943 |
+++ linux-2.4.37.9/kernel/module.c |
+++ linux-2.4.37.10/kernel/module.c |
944 |
@@ -10,6 +10,7 @@ |
@@ -10,6 +10,7 @@ |
945 |
#include <linux/slab.h> |
#include <linux/slab.h> |
946 |
#include <linux/kmod.h> |
#include <linux/kmod.h> |
976 |
|
|
977 |
lock_kernel(); |
lock_kernel(); |
978 |
if (name_user) { |
if (name_user) { |
979 |
--- linux-2.4.37.9.orig/kernel/sched.c |
--- linux-2.4.37.10.orig/kernel/sched.c |
980 |
+++ linux-2.4.37.9/kernel/sched.c |
+++ linux-2.4.37.10/kernel/sched.c |
981 |
@@ -32,6 +32,7 @@ |
@@ -32,6 +32,7 @@ |
982 |
|
|
983 |
#include <asm/uaccess.h> |
#include <asm/uaccess.h> |
995 |
|
|
996 |
/* |
/* |
997 |
* Setpriority might change our priority at the same moment. |
* Setpriority might change our priority at the same moment. |
998 |
--- linux-2.4.37.9.orig/kernel/signal.c |
--- linux-2.4.37.10.orig/kernel/signal.c |
999 |
+++ linux-2.4.37.9/kernel/signal.c |
+++ linux-2.4.37.10/kernel/signal.c |
1000 |
@@ -15,6 +15,7 @@ |
@@ -15,6 +15,7 @@ |
1001 |
#include <linux/sched.h> |
#include <linux/sched.h> |
1002 |
|
|
1032 |
|
|
1033 |
/* POSIX.1b doesn't mention process groups. */ |
/* POSIX.1b doesn't mention process groups. */ |
1034 |
return kill_proc_info(sig, &info, pid); |
return kill_proc_info(sig, &info, pid); |
1035 |
--- linux-2.4.37.9.orig/kernel/sys.c |
--- linux-2.4.37.10.orig/kernel/sys.c |
1036 |
+++ linux-2.4.37.9/kernel/sys.c |
+++ linux-2.4.37.10/kernel/sys.c |
1037 |
@@ -17,6 +17,7 @@ |
@@ -17,6 +17,7 @@ |
1038 |
|
|
1039 |
#include <asm/uaccess.h> |
#include <asm/uaccess.h> |
1078 |
|
|
1079 |
down_write(&uts_sem); |
down_write(&uts_sem); |
1080 |
errno = -EFAULT; |
errno = -EFAULT; |
1081 |
--- linux-2.4.37.9.orig/kernel/sysctl.c |
--- linux-2.4.37.10.orig/kernel/sysctl.c |
1082 |
+++ linux-2.4.37.9/kernel/sysctl.c |
+++ linux-2.4.37.10/kernel/sysctl.c |
1083 |
@@ -33,6 +33,7 @@ |
@@ -33,6 +33,7 @@ |
1084 |
#include <linux/swap.h> |
#include <linux/swap.h> |
1085 |
|
|
1121 |
} |
} |
1122 |
|
|
1123 |
/* |
/* |
1124 |
--- linux-2.4.37.9.orig/kernel/time.c |
--- linux-2.4.37.10.orig/kernel/time.c |
1125 |
+++ linux-2.4.37.9/kernel/time.c |
+++ linux-2.4.37.10/kernel/time.c |
1126 |
@@ -29,6 +29,7 @@ |
@@ -29,6 +29,7 @@ |
1127 |
#include <linux/smp_lock.h> |
#include <linux/smp_lock.h> |
1128 |
|
|
1158 |
|
|
1159 |
/* Now we validate the data before disabling interrupts */ |
/* Now we validate the data before disabling interrupts */ |
1160 |
|
|
1161 |
--- linux-2.4.37.9.orig/net/ipv4/raw.c |
--- linux-2.4.37.10.orig/net/ipv4/raw.c |
1162 |
+++ linux-2.4.37.9/net/ipv4/raw.c |
+++ linux-2.4.37.10/net/ipv4/raw.c |
1163 |
@@ -64,6 +64,7 @@ |
@@ -64,6 +64,7 @@ |
1164 |
#include <net/raw.h> |
#include <net/raw.h> |
1165 |
#include <net/inet_common.h> |
#include <net/inet_common.h> |
1186 |
|
|
1187 |
copied = skb->len; |
copied = skb->len; |
1188 |
if (len < copied) { |
if (len < copied) { |
1189 |
--- linux-2.4.37.9.orig/net/ipv4/tcp_ipv4.c |
--- linux-2.4.37.10.orig/net/ipv4/tcp_ipv4.c |
1190 |
+++ linux-2.4.37.9/net/ipv4/tcp_ipv4.c |
+++ linux-2.4.37.10/net/ipv4/tcp_ipv4.c |
1191 |
@@ -67,6 +67,7 @@ |
@@ -67,6 +67,7 @@ |
1192 |
#include <linux/inet.h> |
#include <linux/inet.h> |
1193 |
#include <linux/stddef.h> |
#include <linux/stddef.h> |
1214 |
|
|
1215 |
/* Does not bother with rcv_saddr checks, |
/* Does not bother with rcv_saddr checks, |
1216 |
* because the established check is already |
* because the established check is already |
1217 |
--- linux-2.4.37.9.orig/net/ipv4/udp.c |
--- linux-2.4.37.10.orig/net/ipv4/udp.c |
1218 |
+++ linux-2.4.37.9/net/ipv4/udp.c |
+++ linux-2.4.37.10/net/ipv4/udp.c |
1219 |
@@ -97,6 +97,7 @@ |
@@ -97,6 +97,7 @@ |
1220 |
#include <net/route.h> |
#include <net/route.h> |
1221 |
#include <net/inet_common.h> |
#include <net/inet_common.h> |
1272 |
|
|
1273 |
/* Clear queue. */ |
/* Clear queue. */ |
1274 |
if (flags&MSG_PEEK) { |
if (flags&MSG_PEEK) { |
1275 |
--- linux-2.4.37.9.orig/net/ipv6/raw.c |
--- linux-2.4.37.10.orig/net/ipv6/raw.c |
1276 |
+++ linux-2.4.37.9/net/ipv6/raw.c |
+++ linux-2.4.37.10/net/ipv6/raw.c |
1277 |
@@ -45,6 +45,7 @@ |
@@ -45,6 +45,7 @@ |
1278 |
#include <net/inet_common.h> |
#include <net/inet_common.h> |
1279 |
|
|
1300 |
|
|
1301 |
copied = skb->len; |
copied = skb->len; |
1302 |
if (copied > len) { |
if (copied > len) { |
1303 |
--- linux-2.4.37.9.orig/net/ipv6/tcp_ipv6.c |
--- linux-2.4.37.10.orig/net/ipv6/tcp_ipv6.c |
1304 |
+++ linux-2.4.37.9/net/ipv6/tcp_ipv6.c |
+++ linux-2.4.37.10/net/ipv6/tcp_ipv6.c |
1305 |
@@ -52,6 +52,7 @@ |
@@ -52,6 +52,7 @@ |
1306 |
#include <net/inet_ecn.h> |
#include <net/inet_ecn.h> |
1307 |
|
|
1319 |
for (tb = head->chain; tb; tb = tb->next) |
for (tb = head->chain; tb; tb = tb->next) |
1320 |
if (tb->port == rover) |
if (tb->port == rover) |
1321 |
goto next; |
goto next; |
1322 |
--- linux-2.4.37.9.orig/net/ipv6/udp.c |
--- linux-2.4.37.10.orig/net/ipv6/udp.c |
1323 |
+++ linux-2.4.37.9/net/ipv6/udp.c |
+++ linux-2.4.37.10/net/ipv6/udp.c |
1324 |
@@ -50,6 +50,7 @@ |
@@ -50,6 +50,7 @@ |
1325 |
#include <net/inet_common.h> |
#include <net/inet_common.h> |
1326 |
|
|
1377 |
return -EAGAIN; |
return -EAGAIN; |
1378 |
} |
} |
1379 |
goto try_again; |
goto try_again; |
1380 |
--- linux-2.4.37.9.orig/net/socket.c |
--- linux-2.4.37.10.orig/net/socket.c |
1381 |
+++ linux-2.4.37.9/net/socket.c |
+++ linux-2.4.37.10/net/socket.c |
1382 |
@@ -84,6 +84,7 @@ |
@@ -84,6 +84,7 @@ |
1383 |
#include <net/sock.h> |
#include <net/sock.h> |
1384 |
#include <net/scm.h> |
#include <net/scm.h> |
1458 |
err = sock->ops->connect(sock, (struct sockaddr *) address, addrlen, |
err = sock->ops->connect(sock, (struct sockaddr *) address, addrlen, |
1459 |
sock->file->f_flags); |
sock->file->f_flags); |
1460 |
out_put: |
out_put: |
1461 |
--- linux-2.4.37.9.orig/net/unix/af_unix.c |
--- linux-2.4.37.10.orig/net/unix/af_unix.c |
1462 |
+++ linux-2.4.37.9/net/unix/af_unix.c |
+++ linux-2.4.37.10/net/unix/af_unix.c |
1463 |
@@ -111,6 +111,7 @@ |
@@ -111,6 +111,7 @@ |
1464 |
#include <linux/rtnetlink.h> |
#include <linux/rtnetlink.h> |
1465 |
|
|
1478 |
err = vfs_mknod(nd.dentry->d_inode, dentry, mode, 0); |
err = vfs_mknod(nd.dentry->d_inode, dentry, mode, 0); |
1479 |
if (err) |
if (err) |
1480 |
goto out_mknod_dput; |
goto out_mknod_dput; |
1481 |
|
@@ -1413,12 +1417,17 @@ static int unix_dgram_recvmsg(struct soc |
1482 |
|
|
1483 |
|
down(&sk->protinfo.af_unix.readsem); |
1484 |
|
|
1485 |
|
+retry: |
1486 |
|
skb = skb_recv_datagram(sk, flags, noblock, &err); |
1487 |
|
if (!skb) |
1488 |
|
goto out_unlock; |
1489 |
|
|
1490 |
|
wake_up_interruptible(&sk->protinfo.af_unix.peer_wait); |
1491 |
|
|
1492 |
|
+ if (ccs_socket_post_recvmsg_permission(sk, skb)) { |
1493 |
|
+ skb_kill_datagram(sk, skb, flags); |
1494 |
|
+ goto retry; |
1495 |
|
+ } |
1496 |
|
if (msg->msg_name) |
1497 |
|
unix_copy_addr(msg, skb->sk); |
1498 |
|
|