Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131903
b: refs/heads/master
c: 5b10174
h: refs/heads/master
i:
  131901: cc9fbc7
  131899: be7cf4e
  131895: 6dc1111
  131887: e07656f
  131871: d543bd5
  131839: 7aaa654
v: v3
  • Loading branch information
Roland McGrath authored and Linus Torvalds committed Mar 2, 2009
1 parent 4fa07b4 commit 4b3169c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ccbe495caa5e604b04d5a31d7459a6f6a76a756c
refs/heads/master: 5b1017404aea6d2e552e991b3fd814d839e9cd67
1 change: 0 additions & 1 deletion trunk/arch/mips/include/asm/seccomp.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#ifndef __ASM_SECCOMP_H

#include <linux/thread_info.h>
#include <linux/unistd.h>

#define __NR_seccomp_read __NR_read
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/powerpc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,10 @@ struct compat_shmid64_ds {
compat_ulong_t __unused6;
};

static inline int is_compat_task(void)
{
return test_thread_flag(TIF_32BIT);
}

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_COMPAT_H */
4 changes: 0 additions & 4 deletions trunk/arch/powerpc/include/asm/seccomp.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef _ASM_POWERPC_SECCOMP_H
#define _ASM_POWERPC_SECCOMP_H

#ifdef __KERNEL__
#include <linux/thread_info.h>
#endif

#include <linux/unistd.h>

#define __NR_seccomp_read __NR_read
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/sparc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,9 @@ struct compat_shmid64_ds {
unsigned int __unused2;
};

static inline int is_compat_task(void)
{
return test_thread_flag(TIF_32BIT);
}

#endif /* _ASM_SPARC64_COMPAT_H */
6 changes: 0 additions & 6 deletions trunk/arch/sparc/include/asm/seccomp.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#ifndef _ASM_SECCOMP_H

#include <linux/thread_info.h> /* already defines TIF_32BIT */

#ifndef TIF_32BIT
#error "unexpected TIF_32BIT on sparc64"
#endif

#include <linux/unistd.h>

#define __NR_seccomp_read __NR_read
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/x86/include/asm/seccomp_32.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#ifndef _ASM_X86_SECCOMP_32_H
#define _ASM_X86_SECCOMP_32_H

#include <linux/thread_info.h>

#ifdef TIF_32BIT
#error "unexpected TIF_32BIT on i386"
#endif

#include <linux/unistd.h>

#define __NR_seccomp_read __NR_read
Expand Down
8 changes: 0 additions & 8 deletions trunk/arch/x86/include/asm/seccomp_64.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#ifndef _ASM_X86_SECCOMP_64_H
#define _ASM_X86_SECCOMP_64_H

#include <linux/thread_info.h>

#ifdef TIF_32BIT
#error "unexpected TIF_32BIT on x86_64"
#else
#define TIF_32BIT TIF_IA32
#endif

#include <linux/unistd.h>
#include <asm/ia32_unistd.h>

Expand Down
7 changes: 4 additions & 3 deletions trunk/kernel/seccomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <linux/seccomp.h>
#include <linux/sched.h>
#include <linux/compat.h>

/* #define SECCOMP_DEBUG 1 */
#define NR_SECCOMP_MODES 1
Expand All @@ -22,7 +23,7 @@ static int mode1_syscalls[] = {
0, /* null terminated */
};

#ifdef TIF_32BIT
#ifdef CONFIG_COMPAT
static int mode1_syscalls_32[] = {
__NR_seccomp_read_32, __NR_seccomp_write_32, __NR_seccomp_exit_32, __NR_seccomp_sigreturn_32,
0, /* null terminated */
Expand All @@ -37,8 +38,8 @@ void __secure_computing(int this_syscall)
switch (mode) {
case 1:
syscall = mode1_syscalls;
#ifdef TIF_32BIT
if (test_thread_flag(TIF_32BIT))
#ifdef CONFIG_COMPAT
if (is_compat_task())
syscall = mode1_syscalls_32;
#endif
do {
Expand Down

0 comments on commit 4b3169c

Please sign in to comment.