2 |
|
|
3 |
Source code for this patch is http://download.opensuse.org/update/11.0/rpm/i586/kernel-source-2.6.25.20-0.1.i586.rpm |
Source code for this patch is http://download.opensuse.org/update/11.0/rpm/i586/kernel-source-2.6.25.20-0.1.i586.rpm |
4 |
--- |
--- |
5 |
arch/ia64/ia32/sys_ia32.c | 9 ++ |
arch/ia64/ia32/sys_ia32.c | 7 ++ |
6 |
arch/mips/kernel/ptrace32.c | 9 ++ |
arch/mips/kernel/ptrace32.c | 7 ++ |
7 |
arch/s390/kernel/ptrace.c | 9 ++ |
arch/s390/kernel/ptrace.c | 7 ++ |
8 |
arch/x86/kernel/ptrace.c | 9 ++ |
arch/x86/kernel/ptrace.c | 7 ++ |
9 |
fs/Kconfig | 2 |
fs/Kconfig | 2 |
10 |
fs/Makefile | 2 |
fs/Makefile | 2 |
11 |
fs/attr.c | 19 ++++++ |
fs/attr.c | 19 ++++++ |
25 |
kernel/kexec.c | 7 ++ |
kernel/kexec.c | 7 ++ |
26 |
kernel/kmod.c | 5 + |
kernel/kmod.c | 5 + |
27 |
kernel/module.c | 11 +++ |
kernel/module.c | 11 +++ |
28 |
kernel/ptrace.c | 15 ++++ |
kernel/ptrace.c | 11 +++ |
29 |
kernel/sched.c | 7 ++ |
kernel/sched.c | 7 ++ |
30 |
kernel/signal.c | 21 ++++++ |
kernel/signal.c | 21 ++++++ |
31 |
kernel/sys.c | 21 ++++++ |
kernel/sys.c | 21 ++++++ |
38 |
net/ipv4/udp.c | 10 +++ |
net/ipv4/udp.c | 10 +++ |
39 |
net/socket.c | 41 +++++++++++++ |
net/socket.c | 41 +++++++++++++ |
40 |
net/unix/af_unix.c | 15 ++++ |
net/unix/af_unix.c | 15 ++++ |
41 |
36 files changed, 626 insertions(+), 2 deletions(-) |
36 files changed, 614 insertions(+), 2 deletions(-) |
42 |
|
|
43 |
--- linux-2.6.25.20-0.1.orig/arch/ia64/ia32/sys_ia32.c |
--- linux-2.6.25.20-0.1.orig/arch/ia64/ia32/sys_ia32.c |
44 |
+++ linux-2.6.25.20-0.1/arch/ia64/ia32/sys_ia32.c |
+++ linux-2.6.25.20-0.1/arch/ia64/ia32/sys_ia32.c |
52 |
|
|
53 |
#include "ia32priv.h" |
#include "ia32priv.h" |
54 |
|
|
55 |
@@ -1753,6 +1756,12 @@ sys32_ptrace (int request, pid_t pid, un |
@@ -1753,6 +1756,10 @@ sys32_ptrace (int request, pid_t pid, un |
56 |
struct task_struct *child; |
struct task_struct *child; |
57 |
unsigned int value, tmp; |
unsigned int value, tmp; |
58 |
long i, ret; |
long i, ret; |
59 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
|
+#ifdef TOMOYO_SYS_PTRACE |
|
60 |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
61 |
+ return -EPERM; |
+ return -EPERM; |
|
+#endif |
|
62 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
63 |
|
|
64 |
lock_kernel(); |
lock_kernel(); |
75 |
|
|
76 |
int ptrace_getregs(struct task_struct *child, __s64 __user *data); |
int ptrace_getregs(struct task_struct *child, __s64 __user *data); |
77 |
int ptrace_setregs(struct task_struct *child, __s64 __user *data); |
int ptrace_setregs(struct task_struct *child, __s64 __user *data); |
78 |
@@ -50,6 +53,12 @@ asmlinkage int sys32_ptrace(int request, |
@@ -50,6 +53,10 @@ asmlinkage int sys32_ptrace(int request, |
79 |
{ |
{ |
80 |
struct task_struct *child; |
struct task_struct *child; |
81 |
int ret; |
int ret; |
82 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
|
+#ifdef TOMOYO_SYS_PTRACE |
|
83 |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
84 |
+ return -EPERM; |
+ return -EPERM; |
|
+#endif |
|
85 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
86 |
|
|
87 |
#if 0 |
#if 0 |
98 |
|
|
99 |
#ifdef CONFIG_COMPAT |
#ifdef CONFIG_COMPAT |
100 |
#include "compat_ptrace.h" |
#include "compat_ptrace.h" |
101 |
@@ -698,6 +701,12 @@ sys_ptrace(long request, long pid, long |
@@ -698,6 +701,10 @@ sys_ptrace(long request, long pid, long |
102 |
struct task_struct *child; |
struct task_struct *child; |
103 |
int ret; |
int ret; |
104 |
|
|
105 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
|
+#ifdef TOMOYO_SYS_PTRACE |
|
106 |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
107 |
+ return -EPERM; |
+ return -EPERM; |
|
+#endif |
|
108 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
109 |
lock_kernel(); |
lock_kernel(); |
110 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |
121 |
|
|
122 |
#include "tls.h" |
#include "tls.h" |
123 |
|
|
124 |
@@ -1240,6 +1243,12 @@ asmlinkage long sys32_ptrace(long reques |
@@ -1240,6 +1243,10 @@ asmlinkage long sys32_ptrace(long reques |
125 |
void __user *datap = compat_ptr(data); |
void __user *datap = compat_ptr(data); |
126 |
int ret; |
int ret; |
127 |
__u32 val; |
__u32 val; |
128 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
|
+#ifdef TOMOYO_SYS_PTRACE |
|
129 |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
130 |
+ return -EPERM; |
+ return -EPERM; |
|
+#endif |
|
131 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
132 |
|
|
133 |
switch (request) { |
switch (request) { |
920 |
|
|
921 |
/* |
/* |
922 |
* ptrace a task: make the debugger its new parent and |
* ptrace a task: make the debugger its new parent and |
923 |
@@ -548,6 +551,12 @@ asmlinkage long sys_ptrace(long request, |
@@ -548,6 +551,10 @@ asmlinkage long sys_ptrace(long request, |
924 |
/* |
/* |
925 |
* This lock_kernel fixes a subtle race with suid exec |
* This lock_kernel fixes a subtle race with suid exec |
926 |
*/ |
*/ |
927 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
|
+#ifdef TOMOYO_SYS_PTRACE |
|
928 |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
929 |
+ return -EPERM; |
+ return -EPERM; |
|
+#endif |
|
930 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
931 |
lock_kernel(); |
lock_kernel(); |
932 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |
933 |
ret = ptrace_traceme(); |
ret = ptrace_traceme(); |
934 |
@@ -655,6 +664,12 @@ asmlinkage long compat_sys_ptrace(compat |
@@ -655,6 +662,10 @@ asmlinkage long compat_sys_ptrace(compat |
935 |
/* |
/* |
936 |
* This lock_kernel fixes a subtle race with suid exec |
* This lock_kernel fixes a subtle race with suid exec |
937 |
*/ |
*/ |
938 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
|
+#ifdef TOMOYO_SYS_PTRACE |
|
939 |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
+ if (!ccs_capable(TOMOYO_SYS_PTRACE)) |
940 |
+ return -EPERM; |
+ return -EPERM; |
|
+#endif |
|
941 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
942 |
lock_kernel(); |
lock_kernel(); |
943 |
if (request == PTRACE_TRACEME) { |
if (request == PTRACE_TRACEME) { |