linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] switch to using asm-generic for seccomp.h
@ 2015-03-05  1:27 Kees Cook
  2015-03-05  1:27 ` [PATCH v3 1/8] seccomp: allow COMPAT sigreturn overrides Kees Cook
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Most architectures don't need to do much special for the strict-mode
seccomp syscall entries. Remove the redundant headers and reduce the
others.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
v3:
- split patch series by architecture
- fix up architectures that need sigreturn overrides (ingo)
v2:
- use Kbuild "generic-y" instead of explicit #include lines (sfr)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/8] seccomp: allow COMPAT sigreturn overrides
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  1:27 ` [PATCH v3 2/8] arm: use asm-generic for seccomp.h Kees Cook
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Some architectures may need to override the compat sigreturn definition,
as is already possible in the non-compat case.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 include/asm-generic/seccomp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/asm-generic/seccomp.h b/include/asm-generic/seccomp.h
index 9fa1f653ed3b..c9ccafa0d99a 100644
--- a/include/asm-generic/seccomp.h
+++ b/include/asm-generic/seccomp.h
@@ -17,7 +17,9 @@
 #define __NR_seccomp_read_32		__NR_read
 #define __NR_seccomp_write_32		__NR_write
 #define __NR_seccomp_exit_32		__NR_exit
+#ifndef __NR_seccomp_sigreturn_32
 #define __NR_seccomp_sigreturn_32	__NR_rt_sigreturn
+#endif
 #endif /* CONFIG_COMPAT && ! already defined */
 
 #define __NR_seccomp_read		__NR_read
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 2/8] arm: use asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
  2015-03-05  1:27 ` [PATCH v3 1/8] seccomp: allow COMPAT sigreturn overrides Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  1:27 ` [PATCH v3 3/8] microblaze: " Kees Cook
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Switch to using the newly created asm-generic/seccomp.h for the seccomp
strict mode syscall definitions. Definitions were identical.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/arm/include/asm/Kbuild    |  1 +
 arch/arm/include/asm/seccomp.h | 11 -----------
 2 files changed, 1 insertion(+), 11 deletions(-)
 delete mode 100644 arch/arm/include/asm/seccomp.h

diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index fe74c0d1e485..d7be5a9fd171 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -22,6 +22,7 @@ generic-y += preempt.h
 generic-y += resource.h
 generic-y += rwsem.h
 generic-y += scatterlist.h
+generic-y += seccomp.h
 generic-y += sections.h
 generic-y += segment.h
 generic-y += sembuf.h
diff --git a/arch/arm/include/asm/seccomp.h b/arch/arm/include/asm/seccomp.h
deleted file mode 100644
index 52b156b341f5..000000000000
--- a/arch/arm/include/asm/seccomp.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_ARM_SECCOMP_H
-#define _ASM_ARM_SECCOMP_H
-
-#include <linux/unistd.h>
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
-#endif /* _ASM_ARM_SECCOMP_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 3/8] microblaze: use asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
  2015-03-05  1:27 ` [PATCH v3 1/8] seccomp: allow COMPAT sigreturn overrides Kees Cook
  2015-03-05  1:27 ` [PATCH v3 2/8] arm: use asm-generic for seccomp.h Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  1:27 ` [PATCH v3 4/8] mips: switch to using " Kees Cook
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Switch to using the newly created asm-generic/seccomp.h for the seccomp
strict mode syscall definitions. Since microblaze is 32-bit, the COMPAT
seccomp defines are unused and can be dropped. The obsolete sigreturn
for seccomp strict mode is retained as an override. Remaining definitions
are identical.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/microblaze/include/asm/seccomp.h | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/microblaze/include/asm/seccomp.h b/arch/microblaze/include/asm/seccomp.h
index 0d912758a0d7..204618a2ce84 100644
--- a/arch/microblaze/include/asm/seccomp.h
+++ b/arch/microblaze/include/asm/seccomp.h
@@ -3,14 +3,8 @@
 
 #include <linux/unistd.h>
 
-#define __NR_seccomp_read		__NR_read
-#define __NR_seccomp_write		__NR_write
-#define __NR_seccomp_exit		__NR_exit
 #define __NR_seccomp_sigreturn		__NR_sigreturn
 
-#define __NR_seccomp_read_32		__NR_read
-#define __NR_seccomp_write_32		__NR_write
-#define __NR_seccomp_exit_32		__NR_exit
-#define __NR_seccomp_sigreturn_32	__NR_sigreturn
+#include <asm-generic/seccomp.h>
 
 #endif	/* _ASM_MICROBLAZE_SECCOMP_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 4/8] mips: switch to using asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
                   ` (2 preceding siblings ...)
  2015-03-05  1:27 ` [PATCH v3 3/8] microblaze: " Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  1:27 ` [PATCH v3 5/8] parisc: " Kees Cook
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Switch to using the newly created asm-generic/seccomp.h for the seccomp
strict mode syscall definitions. COMPAT definitions retain their overrides
and the remaining definitions were identical.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/mips/include/asm/seccomp.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/seccomp.h b/arch/mips/include/asm/seccomp.h
index f29c75cf83c6..1d8a2e2c75c1 100644
--- a/arch/mips/include/asm/seccomp.h
+++ b/arch/mips/include/asm/seccomp.h
@@ -2,11 +2,6 @@
 
 #include <linux/unistd.h>
 
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
 /*
  * Kludge alert:
  *
@@ -29,4 +24,6 @@
 
 #endif /* CONFIG_MIPS32_O32 */
 
+#include <asm-generic/seccomp.h>
+
 #endif /* __ASM_SECCOMP_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 5/8] parisc: switch to using asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
                   ` (3 preceding siblings ...)
  2015-03-05  1:27 ` [PATCH v3 4/8] mips: switch to using " Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  1:27 ` [PATCH v3 6/8] powerpc: " Kees Cook
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Switch to using the newly created asm-generic/seccomp.h for the seccomp
strict mode syscall definitions. Definitions were identical.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/parisc/include/asm/Kbuild    |  1 +
 arch/parisc/include/asm/seccomp.h | 16 ----------------
 2 files changed, 1 insertion(+), 16 deletions(-)
 delete mode 100644 arch/parisc/include/asm/seccomp.h

diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index 8686237a3c3c..12b341d04f88 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -20,6 +20,7 @@ generic-y += param.h
 generic-y += percpu.h
 generic-y += poll.h
 generic-y += preempt.h
+generic-y += seccomp.h
 generic-y += segment.h
 generic-y += topology.h
 generic-y += trace_clock.h
diff --git a/arch/parisc/include/asm/seccomp.h b/arch/parisc/include/asm/seccomp.h
deleted file mode 100644
index 015f7887aa29..000000000000
--- a/arch/parisc/include/asm/seccomp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_PARISC_SECCOMP_H
-#define _ASM_PARISC_SECCOMP_H
-
-#include <linux/unistd.h>
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
-#define __NR_seccomp_read_32 __NR_read
-#define __NR_seccomp_write_32 __NR_write
-#define __NR_seccomp_exit_32 __NR_exit
-#define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn
-
-#endif	/* _ASM_PARISC_SECCOMP_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 6/8] powerpc: switch to using asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
                   ` (4 preceding siblings ...)
  2015-03-05  1:27 ` [PATCH v3 5/8] parisc: " Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  1:27 ` [PATCH v3 7/8] sparc: " Kees Cook
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Switch to using the newly created asm-generic/seccomp.h for the seccomp
strict mode syscall definitions. The obsolete sigreturn in COMPAT mode
is retained as an override. Remaining definitions are identical, though
they incorrectly appeared in uapi, which has been corrected.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/powerpc/include/asm/seccomp.h      | 10 ++++++++++
 arch/powerpc/include/uapi/asm/Kbuild    |  1 -
 arch/powerpc/include/uapi/asm/seccomp.h | 16 ----------------
 3 files changed, 10 insertions(+), 17 deletions(-)
 create mode 100644 arch/powerpc/include/asm/seccomp.h
 delete mode 100644 arch/powerpc/include/uapi/asm/seccomp.h

diff --git a/arch/powerpc/include/asm/seccomp.h b/arch/powerpc/include/asm/seccomp.h
new file mode 100644
index 000000000000..c1818e35cf02
--- /dev/null
+++ b/arch/powerpc/include/asm/seccomp.h
@@ -0,0 +1,10 @@
+#ifndef _ASM_POWERPC_SECCOMP_H
+#define _ASM_POWERPC_SECCOMP_H
+
+#include <linux/unistd.h>
+
+#define __NR_seccomp_sigreturn_32 __NR_sigreturn
+
+#include <asm-generic/seccomp.h>
+
+#endif	/* _ASM_POWERPC_SECCOMP_H */
diff --git a/arch/powerpc/include/uapi/asm/Kbuild b/arch/powerpc/include/uapi/asm/Kbuild
index 7a3f795ac218..79c4068be278 100644
--- a/arch/powerpc/include/uapi/asm/Kbuild
+++ b/arch/powerpc/include/uapi/asm/Kbuild
@@ -25,7 +25,6 @@ header-y += posix_types.h
 header-y += ps3fb.h
 header-y += ptrace.h
 header-y += resource.h
-header-y += seccomp.h
 header-y += sembuf.h
 header-y += setup.h
 header-y += shmbuf.h
diff --git a/arch/powerpc/include/uapi/asm/seccomp.h b/arch/powerpc/include/uapi/asm/seccomp.h
deleted file mode 100644
index 00c1d9133cfe..000000000000
--- a/arch/powerpc/include/uapi/asm/seccomp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_POWERPC_SECCOMP_H
-#define _ASM_POWERPC_SECCOMP_H
-
-#include <linux/unistd.h>
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
-#define __NR_seccomp_read_32 __NR_read
-#define __NR_seccomp_write_32 __NR_write
-#define __NR_seccomp_exit_32 __NR_exit
-#define __NR_seccomp_sigreturn_32 __NR_sigreturn
-
-#endif	/* _ASM_POWERPC_SECCOMP_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 7/8] sparc: switch to using asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
                   ` (5 preceding siblings ...)
  2015-03-05  1:27 ` [PATCH v3 6/8] powerpc: " Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  1:27 ` [PATCH v3 8/8] x86: " Kees Cook
  2015-03-11 18:59 ` [PATCH v3 0/8] " Kees Cook
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Switch to using the newly created asm-generic/seccomp.h for the seccomp
strict mode syscall definitions. The obsolete sigreturn in COMPAT mode
is retained as an override. Remaining definitions are identical. Also
corrected missing #define for header reinclusion protection.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/sparc/include/asm/seccomp.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/arch/sparc/include/asm/seccomp.h b/arch/sparc/include/asm/seccomp.h
index adca1bce41d4..5ef8826d44f8 100644
--- a/arch/sparc/include/asm/seccomp.h
+++ b/arch/sparc/include/asm/seccomp.h
@@ -1,15 +1,10 @@
 #ifndef _ASM_SECCOMP_H
+#define _ASM_SECCOMP_H
 
 #include <linux/unistd.h>
 
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
-#define __NR_seccomp_read_32 __NR_read
-#define __NR_seccomp_write_32 __NR_write
-#define __NR_seccomp_exit_32 __NR_exit
 #define __NR_seccomp_sigreturn_32 __NR_sigreturn
 
+#include <asm-generic/seccomp.h>
+
 #endif /* _ASM_SECCOMP_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 8/8] x86: switch to using asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
                   ` (6 preceding siblings ...)
  2015-03-05  1:27 ` [PATCH v3 7/8] sparc: " Kees Cook
@ 2015-03-05  1:27 ` Kees Cook
  2015-03-05  6:31   ` Ingo Molnar
  2015-03-11 18:59 ` [PATCH v3 0/8] " Kees Cook
  8 siblings, 1 reply; 11+ messages in thread
From: Kees Cook @ 2015-03-05  1:27 UTC (permalink / raw)
  To: akpm
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch

Switch to using the newly created asm-generic/seccomp.h for the seccomp
strict mode syscall definitions. The obsolete sigreturn syscall override
is retained in 32-bit mode, and the ia32 syscall overrides are used in
the compat case. Remaining definitions were identical.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 arch/x86/include/asm/seccomp.h    | 21 ++++++++++++++++++---
 arch/x86/include/asm/seccomp_32.h | 11 -----------
 arch/x86/include/asm/seccomp_64.h | 17 -----------------
 3 files changed, 18 insertions(+), 31 deletions(-)
 delete mode 100644 arch/x86/include/asm/seccomp_32.h
 delete mode 100644 arch/x86/include/asm/seccomp_64.h

diff --git a/arch/x86/include/asm/seccomp.h b/arch/x86/include/asm/seccomp.h
index 0f3d7f099224..0c8c7c8861b4 100644
--- a/arch/x86/include/asm/seccomp.h
+++ b/arch/x86/include/asm/seccomp.h
@@ -1,5 +1,20 @@
+#ifndef _ASM_X86_SECCOMP_H
+#define _ASM_X86_SECCOMP_H
+
+#include <asm/unistd.h>
+
 #ifdef CONFIG_X86_32
-# include <asm/seccomp_32.h>
-#else
-# include <asm/seccomp_64.h>
+#define __NR_seccomp_sigreturn		__NR_sigreturn
 #endif
+
+#ifdef CONFIG_COMPAT
+#include <asm/ia32_unistd.h>
+#define __NR_seccomp_read_32		__NR_ia32_read
+#define __NR_seccomp_write_32		__NR_ia32_write
+#define __NR_seccomp_exit_32		__NR_ia32_exit
+#define __NR_seccomp_sigreturn_32	__NR_ia32_sigreturn
+#endif
+
+#include <asm-generic/seccomp.h>
+
+#endif /* _ASM_X86_SECCOMP_H */
diff --git a/arch/x86/include/asm/seccomp_32.h b/arch/x86/include/asm/seccomp_32.h
deleted file mode 100644
index b811d6f5780c..000000000000
--- a/arch/x86/include/asm/seccomp_32.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_X86_SECCOMP_32_H
-#define _ASM_X86_SECCOMP_32_H
-
-#include <linux/unistd.h>
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_sigreturn
-
-#endif /* _ASM_X86_SECCOMP_32_H */
diff --git a/arch/x86/include/asm/seccomp_64.h b/arch/x86/include/asm/seccomp_64.h
deleted file mode 100644
index 84ec1bd161a5..000000000000
--- a/arch/x86/include/asm/seccomp_64.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _ASM_X86_SECCOMP_64_H
-#define _ASM_X86_SECCOMP_64_H
-
-#include <linux/unistd.h>
-#include <asm/ia32_unistd.h>
-
-#define __NR_seccomp_read __NR_read
-#define __NR_seccomp_write __NR_write
-#define __NR_seccomp_exit __NR_exit
-#define __NR_seccomp_sigreturn __NR_rt_sigreturn
-
-#define __NR_seccomp_read_32 __NR_ia32_read
-#define __NR_seccomp_write_32 __NR_ia32_write
-#define __NR_seccomp_exit_32 __NR_ia32_exit
-#define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn
-
-#endif /* _ASM_X86_SECCOMP_64_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 8/8] x86: switch to using asm-generic for seccomp.h
  2015-03-05  1:27 ` [PATCH v3 8/8] x86: " Kees Cook
@ 2015-03-05  6:31   ` Ingo Molnar
  0 siblings, 0 replies; 11+ messages in thread
From: Ingo Molnar @ 2015-03-05  6:31 UTC (permalink / raw)
  To: Kees Cook
  Cc: akpm, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	linux-kernel, linux-mips, linux-parisc, linuxppc-dev, sparclinux,
	linux-arch


* Kees Cook <keescook@chromium.org> wrote:

> Switch to using the newly created asm-generic/seccomp.h for the 
> seccomp strict mode syscall definitions. The obsolete sigreturn 
> syscall override is retained in 32-bit mode, and the ia32 syscall 
> overrides are used in the compat case. Remaining definitions were 
> identical.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 0/8] switch to using asm-generic for seccomp.h
  2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
                   ` (7 preceding siblings ...)
  2015-03-05  1:27 ` [PATCH v3 8/8] x86: " Kees Cook
@ 2015-03-11 18:59 ` Kees Cook
  8 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2015-03-11 18:59 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Kees Cook, Ingo Molnar, Russell King, Michal Simek, Ralf Baechle,
	James E.J. Bottomley, Helge Deller, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, David S. Miller, x86,
	Arnd Bergmann, Frederic Weisbecker, Peter Zijlstra, Will Deacon,
	Daniel Borkmann, Laura Abbott, James Hogan, linux-arm-kernel,
	LKML, Linux MIPS Mailing List, linux-parisc, linuxppc-dev,
	sparclinux, linux-arch

On Wed, Mar 4, 2015 at 5:27 PM, Kees Cook <keescook@chromium.org> wrote:
> Most architectures don't need to do much special for the strict-mode
> seccomp syscall entries. Remove the redundant headers and reduce the
> others.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Hi Andrew,

Just a quick ping: are you able to pick up this series, or should I
try to get this in on a per-arch basis?

Thanks!

-Kees

> ---
> v3:
> - split patch series by architecture
> - fix up architectures that need sigreturn overrides (ingo)
> v2:
> - use Kbuild "generic-y" instead of explicit #include lines (sfr)
>



-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-03-11 18:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05  1:27 [PATCH v3 0/8] switch to using asm-generic for seccomp.h Kees Cook
2015-03-05  1:27 ` [PATCH v3 1/8] seccomp: allow COMPAT sigreturn overrides Kees Cook
2015-03-05  1:27 ` [PATCH v3 2/8] arm: use asm-generic for seccomp.h Kees Cook
2015-03-05  1:27 ` [PATCH v3 3/8] microblaze: " Kees Cook
2015-03-05  1:27 ` [PATCH v3 4/8] mips: switch to using " Kees Cook
2015-03-05  1:27 ` [PATCH v3 5/8] parisc: " Kees Cook
2015-03-05  1:27 ` [PATCH v3 6/8] powerpc: " Kees Cook
2015-03-05  1:27 ` [PATCH v3 7/8] sparc: " Kees Cook
2015-03-05  1:27 ` [PATCH v3 8/8] x86: " Kees Cook
2015-03-05  6:31   ` Ingo Molnar
2015-03-11 18:59 ` [PATCH v3 0/8] " Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).