diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-07-25 11:19:33 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-07-31 16:35:21 -0400 |
commit | 293c5bd13f124c325f74f89ad26edf5612ce7235 (patch) | |
tree | 6de7ce919a10c58e29093776c02e61d7127ed12b | |
parent | 01754bbc692929e446e600f69b41013e554399a6 (diff) |
[MIPS] Fixup secure computing stuff.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/Kconfig | 2 | ||||
-rw-r--r-- | arch/mips/kernel/asm-offsets.c | 1 | ||||
-rw-r--r-- | arch/mips/kernel/mips-mt-fpaff.c | 9 | ||||
-rw-r--r-- | arch/mips/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/ptrace.c | 14 | ||||
-rw-r--r-- | arch/mips/kernel/syscall.c | 18 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/unaligned.c | 2 | ||||
-rw-r--r-- | drivers/input/evdev.c | 2 | ||||
-rw-r--r-- | include/asm-mips/a.out.h | 3 | ||||
-rw-r--r-- | include/asm-mips/elf.h | 13 | ||||
-rw-r--r-- | include/asm-mips/processor.h | 20 | ||||
-rw-r--r-- | include/asm-mips/seccomp.h | 37 | ||||
-rw-r--r-- | include/asm-mips/system.h | 8 | ||||
-rw-r--r-- | include/asm-mips/thread_info.h | 12 |
15 files changed, 98 insertions, 47 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 1e3aeccd7322..410b9d185739 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1772,7 +1772,7 @@ config KEXEC | |||
1772 | 1772 | ||
1773 | config SECCOMP | 1773 | config SECCOMP |
1774 | bool "Enable seccomp to safely compute untrusted bytecode" | 1774 | bool "Enable seccomp to safely compute untrusted bytecode" |
1775 | depends on PROC_FS && BROKEN | 1775 | depends on PROC_FS |
1776 | default y | 1776 | default y |
1777 | help | 1777 | help |
1778 | This kernel feature is useful for number crunching applications | 1778 | This kernel feature is useful for number crunching applications |
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 3b27309d54b1..013327286c26 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c | |||
@@ -132,7 +132,6 @@ void output_thread_defines(void) | |||
132 | offset("#define THREAD_ECODE ", struct task_struct, \ | 132 | offset("#define THREAD_ECODE ", struct task_struct, \ |
133 | thread.error_code); | 133 | thread.error_code); |
134 | offset("#define THREAD_TRAPNO ", struct task_struct, thread.trap_no); | 134 | offset("#define THREAD_TRAPNO ", struct task_struct, thread.trap_no); |
135 | offset("#define THREAD_MFLAGS ", struct task_struct, thread.mflags); | ||
136 | offset("#define THREAD_TRAMP ", struct task_struct, \ | 135 | offset("#define THREAD_TRAMP ", struct task_struct, \ |
137 | thread.irix_trampoline); | 136 | thread.irix_trampoline); |
138 | offset("#define THREAD_OLDCTX ", struct task_struct, \ | 137 | offset("#define THREAD_OLDCTX ", struct task_struct, \ |
diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c index ede5d73d652e..892665bb12b1 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c | |||
@@ -50,6 +50,7 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
50 | cpumask_t effective_mask; | 50 | cpumask_t effective_mask; |
51 | int retval; | 51 | int retval; |
52 | struct task_struct *p; | 52 | struct task_struct *p; |
53 | struct thread_info *ti; | ||
53 | 54 | ||
54 | if (len < sizeof(new_mask)) | 55 | if (len < sizeof(new_mask)) |
55 | return -EINVAL; | 56 | return -EINVAL; |
@@ -93,16 +94,16 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
93 | read_unlock(&tasklist_lock); | 94 | read_unlock(&tasklist_lock); |
94 | 95 | ||
95 | /* Compute new global allowed CPU set if necessary */ | 96 | /* Compute new global allowed CPU set if necessary */ |
96 | if ((p->thread.mflags & MF_FPUBOUND) | 97 | ti = task_thread_info(p); |
97 | && cpus_intersects(new_mask, mt_fpu_cpumask)) { | 98 | if (test_ti_thread_flag(ti, TIF_FPUBOUND) && |
99 | cpus_intersects(new_mask, mt_fpu_cpumask)) { | ||
98 | cpus_and(effective_mask, new_mask, mt_fpu_cpumask); | 100 | cpus_and(effective_mask, new_mask, mt_fpu_cpumask); |
99 | retval = set_cpus_allowed(p, effective_mask); | 101 | retval = set_cpus_allowed(p, effective_mask); |
100 | } else { | 102 | } else { |
101 | p->thread.mflags &= ~MF_FPUBOUND; | 103 | clear_ti_thread_flag(ti, TIF_FPUBOUND); |
102 | retval = set_cpus_allowed(p, new_mask); | 104 | retval = set_cpus_allowed(p, new_mask); |
103 | } | 105 | } |
104 | 106 | ||
105 | |||
106 | out_unlock: | 107 | out_unlock: |
107 | put_task_struct(p); | 108 | put_task_struct(p); |
108 | unlock_cpu_hotplug(); | 109 | unlock_cpu_hotplug(); |
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index bd05f5a927ea..e6ce943099a0 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -77,7 +77,7 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp) | |||
77 | status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK); | 77 | status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK); |
78 | #ifdef CONFIG_64BIT | 78 | #ifdef CONFIG_64BIT |
79 | status &= ~ST0_FR; | 79 | status &= ~ST0_FR; |
80 | status |= (current->thread.mflags & MF_32BIT_REGS) ? 0 : ST0_FR; | 80 | status |= test_thread_flag(TIF_32BIT_REGS) ? 0 : ST0_FR; |
81 | #endif | 81 | #endif |
82 | status |= KU_USER; | 82 | status |= KU_USER; |
83 | regs->cp0_status = status; | 83 | regs->cp0_status = status; |
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 893e7bccf226..bbd57b20b43e 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
@@ -20,11 +20,11 @@ | |||
20 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
22 | #include <linux/ptrace.h> | 22 | #include <linux/ptrace.h> |
23 | #include <linux/audit.h> | ||
24 | #include <linux/smp.h> | 23 | #include <linux/smp.h> |
25 | #include <linux/user.h> | 24 | #include <linux/user.h> |
26 | #include <linux/security.h> | 25 | #include <linux/security.h> |
27 | #include <linux/signal.h> | 26 | #include <linux/audit.h> |
27 | #include <linux/seccomp.h> | ||
28 | 28 | ||
29 | #include <asm/byteorder.h> | 29 | #include <asm/byteorder.h> |
30 | #include <asm/cpu.h> | 30 | #include <asm/cpu.h> |
@@ -470,12 +470,17 @@ static inline int audit_arch(void) | |||
470 | */ | 470 | */ |
471 | asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) | 471 | asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) |
472 | { | 472 | { |
473 | /* do the secure computing check first */ | ||
474 | if (!entryexit) | ||
475 | secure_computing(regs->regs[0]); | ||
476 | |||
473 | if (unlikely(current->audit_context) && entryexit) | 477 | if (unlikely(current->audit_context) && entryexit) |
474 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]), | 478 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]), |
475 | regs->regs[2]); | 479 | regs->regs[2]); |
476 | 480 | ||
477 | if (!(current->ptrace & PT_PTRACED)) | 481 | if (!(current->ptrace & PT_PTRACED)) |
478 | goto out; | 482 | goto out; |
483 | |||
479 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 484 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) |
480 | goto out; | 485 | goto out; |
481 | 486 | ||
@@ -493,9 +498,10 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
493 | send_sig(current->exit_code, current, 1); | 498 | send_sig(current->exit_code, current, 1); |
494 | current->exit_code = 0; | 499 | current->exit_code = 0; |
495 | } | 500 | } |
496 | out: | 501 | |
502 | out: | ||
497 | if (unlikely(current->audit_context) && !entryexit) | 503 | if (unlikely(current->audit_context) && !entryexit) |
498 | audit_syscall_entry(audit_arch(), regs->regs[2], | 504 | audit_syscall_entry(audit_arch(), regs->regs[0], |
499 | regs->regs[4], regs->regs[5], | 505 | regs->regs[4], regs->regs[5], |
500 | regs->regs[6], regs->regs[7]); | 506 | regs->regs[6], regs->regs[7]); |
501 | } | 507 | } |
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 541b5005957e..7c800ec3ff55 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -281,16 +281,24 @@ asmlinkage int sys_set_thread_area(unsigned long addr) | |||
281 | 281 | ||
282 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | 282 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) |
283 | { | 283 | { |
284 | int tmp; | 284 | switch (cmd) { |
285 | |||
286 | switch(cmd) { | ||
287 | case MIPS_ATOMIC_SET: | 285 | case MIPS_ATOMIC_SET: |
288 | printk(KERN_CRIT "How did I get here?\n"); | 286 | printk(KERN_CRIT "How did I get here?\n"); |
289 | return -EINVAL; | 287 | return -EINVAL; |
290 | 288 | ||
291 | case MIPS_FIXADE: | 289 | case MIPS_FIXADE: |
292 | tmp = current->thread.mflags & ~3; | 290 | if (arg1 & ~3) |
293 | current->thread.mflags = tmp | (arg1 & 3); | 291 | return -EINVAL; |
292 | |||
293 | if (arg1 & 1) | ||
294 | set_thread_flag(TIF_FIXADE); | ||
295 | else | ||
296 | clear_thread_flag(TIF_FIXADE); | ||
297 | if (arg1 & 2) | ||
298 | set_thread_flag(TIF_LOGADE); | ||
299 | else | ||
300 | clear_thread_flag(TIF_FIXADE); | ||
301 | |||
294 | return 0; | 302 | return 0; |
295 | 303 | ||
296 | case FLUSH_CACHE: | 304 | case FLUSH_CACHE: |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index ce277cb34dd0..c8e291c83057 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -775,7 +775,7 @@ static void mt_ase_fp_affinity(void) | |||
775 | cpus_and(tmask, current->thread.user_cpus_allowed, | 775 | cpus_and(tmask, current->thread.user_cpus_allowed, |
776 | mt_fpu_cpumask); | 776 | mt_fpu_cpumask); |
777 | set_cpus_allowed(current, tmask); | 777 | set_cpus_allowed(current, tmask); |
778 | current->thread.mflags |= MF_FPUBOUND; | 778 | set_thread_flag(TIF_FPUBOUND); |
779 | } | 779 | } |
780 | } | 780 | } |
781 | #endif /* CONFIG_MIPS_MT_FPAFF */ | 781 | #endif /* CONFIG_MIPS_MT_FPAFF */ |
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c index 8b9c34ffae18..5565b89b98e6 100644 --- a/arch/mips/kernel/unaligned.c +++ b/arch/mips/kernel/unaligned.c | |||
@@ -524,7 +524,7 @@ asmlinkage void do_ade(struct pt_regs *regs) | |||
524 | goto sigbus; | 524 | goto sigbus; |
525 | 525 | ||
526 | pc = (unsigned int __user *) exception_epc(regs); | 526 | pc = (unsigned int __user *) exception_epc(regs); |
527 | if (user_mode(regs) && (current->thread.mflags & MF_FIXADE) == 0) | 527 | if (user_mode(regs) && !test_thread_flag(TIF_FIXADE)) |
528 | goto sigbus; | 528 | goto sigbus; |
529 | if (unaligned_action == UNALIGNED_ACTION_SIGNAL) | 529 | if (unaligned_action == UNALIGNED_ACTION_SIGNAL) |
530 | goto sigbus; | 530 | goto sigbus; |
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index ab4b2d9b5327..f1c3d6cebd58 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -186,7 +186,7 @@ struct input_event_compat { | |||
186 | #elif defined(CONFIG_S390) | 186 | #elif defined(CONFIG_S390) |
187 | # define COMPAT_TEST test_thread_flag(TIF_31BIT) | 187 | # define COMPAT_TEST test_thread_flag(TIF_31BIT) |
188 | #elif defined(CONFIG_MIPS) | 188 | #elif defined(CONFIG_MIPS) |
189 | # define COMPAT_TEST (current->thread.mflags & MF_32BIT_ADDR) | 189 | # define COMPAT_TEST test_thread_flag(TIF_32BIT_ADDR) |
190 | #else | 190 | #else |
191 | # define COMPAT_TEST test_thread_flag(TIF_32BIT) | 191 | # define COMPAT_TEST test_thread_flag(TIF_32BIT) |
192 | #endif | 192 | #endif |
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h index 1ad60ba186d0..bf55a5b34bef 100644 --- a/include/asm-mips/a.out.h +++ b/include/asm-mips/a.out.h | |||
@@ -38,7 +38,8 @@ struct exec | |||
38 | #define STACK_TOP TASK_SIZE | 38 | #define STACK_TOP TASK_SIZE |
39 | #endif | 39 | #endif |
40 | #ifdef CONFIG_64BIT | 40 | #ifdef CONFIG_64BIT |
41 | #define STACK_TOP (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE) | 41 | #define STACK_TOP \ |
42 | (test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE) | ||
42 | #endif | 43 | #endif |
43 | #define STACK_TOP_MAX TASK_SIZE | 44 | #define STACK_TOP_MAX TASK_SIZE |
44 | 45 | ||
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h index ebd6bfb19d66..e7d95d48177d 100644 --- a/include/asm-mips/elf.h +++ b/include/asm-mips/elf.h | |||
@@ -265,7 +265,7 @@ do { \ | |||
265 | #ifdef CONFIG_MIPS32_N32 | 265 | #ifdef CONFIG_MIPS32_N32 |
266 | #define __SET_PERSONALITY32_N32() \ | 266 | #define __SET_PERSONALITY32_N32() \ |
267 | do { \ | 267 | do { \ |
268 | current->thread.mflags |= MF_N32; \ | 268 | set_thread_flag(TIF_32BIT_ADDR); \ |
269 | current->thread.abi = &mips_abi_n32; \ | 269 | current->thread.abi = &mips_abi_n32; \ |
270 | } while (0) | 270 | } while (0) |
271 | #else | 271 | #else |
@@ -276,7 +276,8 @@ do { \ | |||
276 | #ifdef CONFIG_MIPS32_O32 | 276 | #ifdef CONFIG_MIPS32_O32 |
277 | #define __SET_PERSONALITY32_O32() \ | 277 | #define __SET_PERSONALITY32_O32() \ |
278 | do { \ | 278 | do { \ |
279 | current->thread.mflags |= MF_O32; \ | 279 | set_thread_flag(TIF_32BIT_REGS); \ |
280 | set_thread_flag(TIF_32BIT_ADDR); \ | ||
280 | current->thread.abi = &mips_abi_32; \ | 281 | current->thread.abi = &mips_abi_32; \ |
281 | } while (0) | 282 | } while (0) |
282 | #else | 283 | #else |
@@ -299,13 +300,13 @@ do { \ | |||
299 | 300 | ||
300 | #define SET_PERSONALITY(ex, ibcs2) \ | 301 | #define SET_PERSONALITY(ex, ibcs2) \ |
301 | do { \ | 302 | do { \ |
302 | current->thread.mflags &= ~MF_ABI_MASK; \ | 303 | clear_thread_flag(TIF_32BIT_REGS); \ |
304 | clear_thread_flag(TIF_32BIT_ADDR); \ | ||
305 | \ | ||
303 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ | 306 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ |
304 | __SET_PERSONALITY32(ex); \ | 307 | __SET_PERSONALITY32(ex); \ |
305 | else { \ | 308 | else \ |
306 | current->thread.mflags |= MF_N64; \ | ||
307 | current->thread.abi = &mips_abi; \ | 309 | current->thread.abi = &mips_abi; \ |
308 | } \ | ||
309 | \ | 310 | \ |
310 | if (ibcs2) \ | 311 | if (ibcs2) \ |
311 | set_personality(PER_SVR4); \ | 312 | set_personality(PER_SVR4); \ |
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 1d8b9a8ae324..83bc94534084 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h | |||
@@ -62,8 +62,9 @@ extern unsigned int vced_count, vcei_count; | |||
62 | * This decides where the kernel will search for a free chunk of vm | 62 | * This decides where the kernel will search for a free chunk of vm |
63 | * space during mmap's. | 63 | * space during mmap's. |
64 | */ | 64 | */ |
65 | #define TASK_UNMAPPED_BASE ((current->thread.mflags & MF_32BIT_ADDR) ? \ | 65 | #define TASK_UNMAPPED_BASE \ |
66 | PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3)) | 66 | (test_thread_flag(TIF_32BIT_ADDR) ? \ |
67 | PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3)) | ||
67 | #endif | 68 | #endif |
68 | 69 | ||
69 | #define NUM_FPU_REGS 32 | 70 | #define NUM_FPU_REGS 32 |
@@ -132,22 +133,11 @@ struct thread_struct { | |||
132 | unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ | 133 | unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ |
133 | unsigned long error_code; | 134 | unsigned long error_code; |
134 | unsigned long trap_no; | 135 | unsigned long trap_no; |
135 | #define MF_FIXADE 1 /* Fix address errors in software */ | ||
136 | #define MF_LOGADE 2 /* Log address errors to syslog */ | ||
137 | #define MF_32BIT_REGS 4 /* also implies 16/32 fprs */ | ||
138 | #define MF_32BIT_ADDR 8 /* 32-bit address space (o32/n32) */ | ||
139 | #define MF_FPUBOUND 0x10 /* thread bound to FPU-full CPU set */ | ||
140 | unsigned long mflags; | ||
141 | unsigned long irix_trampoline; /* Wheee... */ | 136 | unsigned long irix_trampoline; /* Wheee... */ |
142 | unsigned long irix_oldctx; | 137 | unsigned long irix_oldctx; |
143 | struct mips_abi *abi; | 138 | struct mips_abi *abi; |
144 | }; | 139 | }; |
145 | 140 | ||
146 | #define MF_ABI_MASK (MF_32BIT_REGS | MF_32BIT_ADDR) | ||
147 | #define MF_O32 (MF_32BIT_REGS | MF_32BIT_ADDR) | ||
148 | #define MF_N32 MF_32BIT_ADDR | ||
149 | #define MF_N64 0 | ||
150 | |||
151 | #ifdef CONFIG_MIPS_MT_FPAFF | 141 | #ifdef CONFIG_MIPS_MT_FPAFF |
152 | #define FPAFF_INIT \ | 142 | #define FPAFF_INIT \ |
153 | .emulated_fp = 0, \ | 143 | .emulated_fp = 0, \ |
@@ -200,10 +190,6 @@ struct thread_struct { | |||
200 | .cp0_baduaddr = 0, \ | 190 | .cp0_baduaddr = 0, \ |
201 | .error_code = 0, \ | 191 | .error_code = 0, \ |
202 | .trap_no = 0, \ | 192 | .trap_no = 0, \ |
203 | /* \ | ||
204 | * For now the default is to fix address errors \ | ||
205 | */ \ | ||
206 | .mflags = MF_FIXADE, \ | ||
207 | .irix_trampoline = 0, \ | 193 | .irix_trampoline = 0, \ |
208 | .irix_oldctx = 0, \ | 194 | .irix_oldctx = 0, \ |
209 | } | 195 | } |
diff --git a/include/asm-mips/seccomp.h b/include/asm-mips/seccomp.h new file mode 100644 index 000000000000..36ed44070256 --- /dev/null +++ b/include/asm-mips/seccomp.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef __ASM_SECCOMP_H | ||
2 | |||
3 | #include <linux/thread_info.h> | ||
4 | #include <linux/unistd.h> | ||
5 | |||
6 | #define __NR_seccomp_read __NR_read | ||
7 | #define __NR_seccomp_write __NR_write | ||
8 | #define __NR_seccomp_exit __NR_exit | ||
9 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
10 | |||
11 | /* | ||
12 | * Kludge alert: | ||
13 | * | ||
14 | * The generic seccomp code currently allows only a single compat ABI. Until | ||
15 | * this is fixed we priorize O32 as the compat ABI over N32. | ||
16 | */ | ||
17 | #ifdef CONFIG_MIPS32_O32 | ||
18 | |||
19 | #define TIF_32BIT TIF_32BIT_REGS | ||
20 | |||
21 | #define __NR_seccomp_read_32 4003 | ||
22 | #define __NR_seccomp_write_32 4004 | ||
23 | #define __NR_seccomp_exit_32 4001 | ||
24 | #define __NR_seccomp_sigreturn_32 4193 /* rt_sigreturn */ | ||
25 | |||
26 | #elif defined(CONFIG_MIPS32_N32) | ||
27 | |||
28 | #define TIF_32BIT _TIF_32BIT_ADDR | ||
29 | |||
30 | #define __NR_seccomp_read_32 6000 | ||
31 | #define __NR_seccomp_write_32 6001 | ||
32 | #define __NR_seccomp_exit_32 6058 | ||
33 | #define __NR_seccomp_sigreturn_32 6211 /* rt_sigreturn */ | ||
34 | |||
35 | #endif /* CONFIG_MIPS32_O32 */ | ||
36 | |||
37 | #endif /* __ASM_SECCOMP_H */ | ||
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 8d0b1cd4a45e..357251f42518 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -46,10 +46,12 @@ struct task_struct; | |||
46 | 46 | ||
47 | #define __mips_mt_fpaff_switch_to(prev) \ | 47 | #define __mips_mt_fpaff_switch_to(prev) \ |
48 | do { \ | 48 | do { \ |
49 | struct thread_info *__prev_ti = task_thread_info(prev); \ | ||
50 | \ | ||
49 | if (cpu_has_fpu && \ | 51 | if (cpu_has_fpu && \ |
50 | (prev->thread.mflags & MF_FPUBOUND) && \ | 52 | test_ti_thread_flag(__prev_ti, TIF_FPUBOUND) && \ |
51 | (!(KSTK_STATUS(prev) & ST0_CU1))) { \ | 53 | (!(KSTK_STATUS(prev) & ST0_CU1))) { \ |
52 | prev->thread.mflags &= ~MF_FPUBOUND; \ | 54 | clear_ti_thread_flag(__prev_ti, TIF_FPUBOUND); \ |
53 | prev->cpus_allowed = prev->thread.user_cpus_allowed; \ | 55 | prev->cpus_allowed = prev->thread.user_cpus_allowed; \ |
54 | } \ | 56 | } \ |
55 | next->thread.emulated_fp = 0; \ | 57 | next->thread.emulated_fp = 0; \ |
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index fbcda8204473..9676e7d9f52d 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h | |||
@@ -46,7 +46,7 @@ struct thread_info { | |||
46 | { \ | 46 | { \ |
47 | .task = &tsk, \ | 47 | .task = &tsk, \ |
48 | .exec_domain = &default_exec_domain, \ | 48 | .exec_domain = &default_exec_domain, \ |
49 | .flags = 0, \ | 49 | .flags = _TIF_FIXADE, \ |
50 | .cpu = 0, \ | 50 | .cpu = 0, \ |
51 | .preempt_count = 1, \ | 51 | .preempt_count = 1, \ |
52 | .addr_limit = KERNEL_DS, \ | 52 | .addr_limit = KERNEL_DS, \ |
@@ -119,6 +119,11 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
119 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 119 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
120 | #define TIF_MEMDIE 18 | 120 | #define TIF_MEMDIE 18 |
121 | #define TIF_FREEZE 19 | 121 | #define TIF_FREEZE 19 |
122 | #define TIF_FIXADE 20 /* Fix address errors in software */ | ||
123 | #define TIF_LOGADE 21 /* Log address errors to syslog */ | ||
124 | #define TIF_32BIT_REGS 22 /* also implies 16/32 fprs */ | ||
125 | #define TIF_32BIT_ADDR 23 /* 32-bit address space (o32/n32) */ | ||
126 | #define TIF_FPUBOUND 24 /* thread bound to FPU-full CPU set */ | ||
122 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ | 127 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ |
123 | 128 | ||
124 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 129 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
@@ -131,6 +136,11 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
131 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | 136 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) |
132 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 137 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
133 | #define _TIF_FREEZE (1<<TIF_FREEZE) | 138 | #define _TIF_FREEZE (1<<TIF_FREEZE) |
139 | #define _TIF_FIXADE (1<<TIF_FIXADE) | ||
140 | #define _TIF_LOGADE (1<<TIF_LOGADE) | ||
141 | #define _TIF_32BIT_REGS (1<<TIF_32BIT_REGS) | ||
142 | #define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR) | ||
143 | #define _TIF_FPUBOUND (1<<TIF_FPUBOUND) | ||
134 | 144 | ||
135 | /* work to do on interrupt/exception return */ | 145 | /* work to do on interrupt/exception return */ |
136 | #define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) | 146 | #define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) |