All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] all: s390: make compat wrappers the generic solution
@ 2016-01-25 16:57 ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

The problem that makes us use wrappers is that some compat
architectures allows user code to access top halves of registers.
This is not a problem for syscalls that are already handled by compat
code, or for that who has types of the same size in kernel and
userspace. In case of s390 and lp64/ilp32 the problem is in pointer
types, long, unsigned long. 

S390 folks already have the solution for it. In this patchset,
it is turned to be general, as arm64/ilp32 needs it too.

This patchset is created as the part of the work of enabling arm64
with ILP32 user mode. See details here:
http://thread.gmane.org/gmane.linux.kernel/2126946

Build-tested on s390.

Yury Norov (5):
  all: s390: move wrapper infrastructure to generic headers
  all: declare new wrappers
  all: s390: redefine wrappers in generic code
  all: non-obvious wrappers
  introduce COMPAT_WRAPPER option and enable it for S390

 arch/Kconfig                      |   4 +
 arch/s390/Kconfig                 |   1 +
 arch/s390/include/asm/compat.h    |  17 ++-
 arch/s390/kernel/Makefile         |   2 +-
 arch/s390/kernel/compat_wrapper.c | 179 ------------------------
 arch/s390/kernel/entry.h          |   2 +
 arch/s390/pci/pci_mmio.c          |   5 +-
 drivers/char/random.c             |   3 +-
 fs/aio.c                          |   4 +-
 fs/buffer.c                       |   3 +-
 fs/dcache.c                       |   3 +-
 fs/eventpoll.c                    |   4 +-
 fs/exec.c                         |   2 +-
 fs/fhandle.c                      |   3 +-
 fs/filesystems.c                  |   3 +-
 fs/namei.c                        |  29 ++--
 fs/namespace.c                    |   7 +-
 fs/notify/inotify/inotify_user.c  |   3 +-
 fs/open.c                         |  20 +--
 fs/pipe.c                         |   5 +-
 fs/quota/quota.c                  |   3 +-
 fs/read_write.c                   |   2 +-
 fs/readdir.c                      |   6 +
 fs/select.c                       |   3 +-
 fs/splice.c                       |   4 +-
 fs/stat.c                         |   5 +-
 fs/xattr.c                        |  25 ++--
 include/linux/compat.h            | 280 ++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h          |  57 +-------
 include/linux/syscalls_structs.h  |  60 ++++++++
 include/uapi/asm-generic/unistd.h | 224 +++++++++++++++---------------
 ipc/mqueue.c                      |   3 +-
 kernel/acct.c                     |   3 +-
 kernel/bpf/syscall.c              |   3 +-
 kernel/capability.c               |   5 +-
 kernel/events/core.c              |   2 +-
 kernel/fork.c                     |  12 +-
 kernel/groups.c                   |   5 +-
 kernel/kcmp.c                     |   3 +-
 kernel/module.c                   |   7 +-
 kernel/printk/printk.c            |   3 +-
 kernel/reboot.c                   |   3 +-
 kernel/sched/core.c               |  11 +-
 kernel/seccomp.c                  |   2 +-
 kernel/signal.c                   |   6 +-
 kernel/sys.c                      |  16 +--
 kernel/sys_ni.c                   | 104 +++++++-------
 mm/madvise.c                      |   3 +-
 mm/mincore.c                      |   3 +-
 mm/mlock.c                        |   7 +-
 mm/mmap.c                         |   7 +-
 mm/mprotect.c                     |   3 +-
 mm/mremap.c                       |   3 +-
 mm/msync.c                        |   3 +-
 mm/nommu.c                        |   7 +-
 mm/shmem.c                        |   3 +-
 mm/swapfile.c                     |   5 +-
 net/socket.c                      |  14 +-
 security/keys/keyctl.c            |   5 +-
 59 files changed, 699 insertions(+), 520 deletions(-)
 delete mode 100644 arch/s390/kernel/compat_wrapper.c
 create mode 100644 include/linux/syscalls_structs.h

-- 
2.5.0

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

* [PATCH 0/5] all: s390: make compat wrappers the generic solution
@ 2016-01-25 16:57 ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: pinskia, Prasun.Kapoor, Nathan_Lynch, agraf, klimov.linux,
	broonie, Yury Norov, joseph, christoph.muellner

The problem that makes us use wrappers is that some compat
architectures allows user code to access top halves of registers.
This is not a problem for syscalls that are already handled by compat
code, or for that who has types of the same size in kernel and
userspace. In case of s390 and lp64/ilp32 the problem is in pointer
types, long, unsigned long. 

S390 folks already have the solution for it. In this patchset,
it is turned to be general, as arm64/ilp32 needs it too.

This patchset is created as the part of the work of enabling arm64
with ILP32 user mode. See details here:
http://thread.gmane.org/gmane.linux.kernel/2126946

Build-tested on s390.

Yury Norov (5):
  all: s390: move wrapper infrastructure to generic headers
  all: declare new wrappers
  all: s390: redefine wrappers in generic code
  all: non-obvious wrappers
  introduce COMPAT_WRAPPER option and enable it for S390

 arch/Kconfig                      |   4 +
 arch/s390/Kconfig                 |   1 +
 arch/s390/include/asm/compat.h    |  17 ++-
 arch/s390/kernel/Makefile         |   2 +-
 arch/s390/kernel/compat_wrapper.c | 179 ------------------------
 arch/s390/kernel/entry.h          |   2 +
 arch/s390/pci/pci_mmio.c          |   5 +-
 drivers/char/random.c             |   3 +-
 fs/aio.c                          |   4 +-
 fs/buffer.c                       |   3 +-
 fs/dcache.c                       |   3 +-
 fs/eventpoll.c                    |   4 +-
 fs/exec.c                         |   2 +-
 fs/fhandle.c                      |   3 +-
 fs/filesystems.c                  |   3 +-
 fs/namei.c                        |  29 ++--
 fs/namespace.c                    |   7 +-
 fs/notify/inotify/inotify_user.c  |   3 +-
 fs/open.c                         |  20 +--
 fs/pipe.c                         |   5 +-
 fs/quota/quota.c                  |   3 +-
 fs/read_write.c                   |   2 +-
 fs/readdir.c                      |   6 +
 fs/select.c                       |   3 +-
 fs/splice.c                       |   4 +-
 fs/stat.c                         |   5 +-
 fs/xattr.c                        |  25 ++--
 include/linux/compat.h            | 280 ++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h          |  57 +-------
 include/linux/syscalls_structs.h  |  60 ++++++++
 include/uapi/asm-generic/unistd.h | 224 +++++++++++++++---------------
 ipc/mqueue.c                      |   3 +-
 kernel/acct.c                     |   3 +-
 kernel/bpf/syscall.c              |   3 +-
 kernel/capability.c               |   5 +-
 kernel/events/core.c              |   2 +-
 kernel/fork.c                     |  12 +-
 kernel/groups.c                   |   5 +-
 kernel/kcmp.c                     |   3 +-
 kernel/module.c                   |   7 +-
 kernel/printk/printk.c            |   3 +-
 kernel/reboot.c                   |   3 +-
 kernel/sched/core.c               |  11 +-
 kernel/seccomp.c                  |   2 +-
 kernel/signal.c                   |   6 +-
 kernel/sys.c                      |  16 +--
 kernel/sys_ni.c                   | 104 +++++++-------
 mm/madvise.c                      |   3 +-
 mm/mincore.c                      |   3 +-
 mm/mlock.c                        |   7 +-
 mm/mmap.c                         |   7 +-
 mm/mprotect.c                     |   3 +-
 mm/mremap.c                       |   3 +-
 mm/msync.c                        |   3 +-
 mm/nommu.c                        |   7 +-
 mm/shmem.c                        |   3 +-
 mm/swapfile.c                     |   5 +-
 net/socket.c                      |  14 +-
 security/keys/keyctl.c            |   5 +-
 59 files changed, 699 insertions(+), 520 deletions(-)
 delete mode 100644 arch/s390/kernel/compat_wrapper.c
 create mode 100644 include/linux/syscalls_structs.h

-- 
2.5.0

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

* [PATCH 0/5] all: s390: make compat wrappers the generic solution
@ 2016-01-25 16:57 ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

The problem that makes us use wrappers is that some compat
architectures allows user code to access top halves of registers.
This is not a problem for syscalls that are already handled by compat
code, or for that who has types of the same size in kernel and
userspace. In case of s390 and lp64/ilp32 the problem is in pointer
types, long, unsigned long. 

S390 folks already have the solution for it. In this patchset,
it is turned to be general, as arm64/ilp32 needs it too.

This patchset is created as the part of the work of enabling arm64
with ILP32 user mode. See details here:
http://thread.gmane.org/gmane.linux.kernel/2126946

Build-tested on s390.

Yury Norov (5):
  all: s390: move wrapper infrastructure to generic headers
  all: declare new wrappers
  all: s390: redefine wrappers in generic code
  all: non-obvious wrappers
  introduce COMPAT_WRAPPER option and enable it for S390

 arch/Kconfig                      |   4 +
 arch/s390/Kconfig                 |   1 +
 arch/s390/include/asm/compat.h    |  17 ++-
 arch/s390/kernel/Makefile         |   2 +-
 arch/s390/kernel/compat_wrapper.c | 179 ------------------------
 arch/s390/kernel/entry.h          |   2 +
 arch/s390/pci/pci_mmio.c          |   5 +-
 drivers/char/random.c             |   3 +-
 fs/aio.c                          |   4 +-
 fs/buffer.c                       |   3 +-
 fs/dcache.c                       |   3 +-
 fs/eventpoll.c                    |   4 +-
 fs/exec.c                         |   2 +-
 fs/fhandle.c                      |   3 +-
 fs/filesystems.c                  |   3 +-
 fs/namei.c                        |  29 ++--
 fs/namespace.c                    |   7 +-
 fs/notify/inotify/inotify_user.c  |   3 +-
 fs/open.c                         |  20 +--
 fs/pipe.c                         |   5 +-
 fs/quota/quota.c                  |   3 +-
 fs/read_write.c                   |   2 +-
 fs/readdir.c                      |   6 +
 fs/select.c                       |   3 +-
 fs/splice.c                       |   4 +-
 fs/stat.c                         |   5 +-
 fs/xattr.c                        |  25 ++--
 include/linux/compat.h            | 280 ++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h          |  57 +-------
 include/linux/syscalls_structs.h  |  60 ++++++++
 include/uapi/asm-generic/unistd.h | 224 +++++++++++++++---------------
 ipc/mqueue.c                      |   3 +-
 kernel/acct.c                     |   3 +-
 kernel/bpf/syscall.c              |   3 +-
 kernel/capability.c               |   5 +-
 kernel/events/core.c              |   2 +-
 kernel/fork.c                     |  12 +-
 kernel/groups.c                   |   5 +-
 kernel/kcmp.c                     |   3 +-
 kernel/module.c                   |   7 +-
 kernel/printk/printk.c            |   3 +-
 kernel/reboot.c                   |   3 +-
 kernel/sched/core.c               |  11 +-
 kernel/seccomp.c                  |   2 +-
 kernel/signal.c                   |   6 +-
 kernel/sys.c                      |  16 +--
 kernel/sys_ni.c                   | 104 +++++++-------
 mm/madvise.c                      |   3 +-
 mm/mincore.c                      |   3 +-
 mm/mlock.c                        |   7 +-
 mm/mmap.c                         |   7 +-
 mm/mprotect.c                     |   3 +-
 mm/mremap.c                       |   3 +-
 mm/msync.c                        |   3 +-
 mm/nommu.c                        |   7 +-
 mm/shmem.c                        |   3 +-
 mm/swapfile.c                     |   5 +-
 net/socket.c                      |  14 +-
 security/keys/keyctl.c            |   5 +-
 59 files changed, 699 insertions(+), 520 deletions(-)
 delete mode 100644 arch/s390/kernel/compat_wrapper.c
 create mode 100644 include/linux/syscalls_structs.h

-- 
2.5.0


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

* [PATCH 0/5] all: s390: make compat wrappers the generic solution
@ 2016-01-25 16:57 ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

The problem that makes us use wrappers is that some compat
architectures allows user code to access top halves of registers.
This is not a problem for syscalls that are already handled by compat
code, or for that who has types of the same size in kernel and
userspace. In case of s390 and lp64/ilp32 the problem is in pointer
types, long, unsigned long. 

S390 folks already have the solution for it. In this patchset,
it is turned to be general, as arm64/ilp32 needs it too.

This patchset is created as the part of the work of enabling arm64
with ILP32 user mode. See details here:
http://thread.gmane.org/gmane.linux.kernel/2126946

Build-tested on s390.

Yury Norov (5):
  all: s390: move wrapper infrastructure to generic headers
  all: declare new wrappers
  all: s390: redefine wrappers in generic code
  all: non-obvious wrappers
  introduce COMPAT_WRAPPER option and enable it for S390

 arch/Kconfig                      |   4 +
 arch/s390/Kconfig                 |   1 +
 arch/s390/include/asm/compat.h    |  17 ++-
 arch/s390/kernel/Makefile         |   2 +-
 arch/s390/kernel/compat_wrapper.c | 179 ------------------------
 arch/s390/kernel/entry.h          |   2 +
 arch/s390/pci/pci_mmio.c          |   5 +-
 drivers/char/random.c             |   3 +-
 fs/aio.c                          |   4 +-
 fs/buffer.c                       |   3 +-
 fs/dcache.c                       |   3 +-
 fs/eventpoll.c                    |   4 +-
 fs/exec.c                         |   2 +-
 fs/fhandle.c                      |   3 +-
 fs/filesystems.c                  |   3 +-
 fs/namei.c                        |  29 ++--
 fs/namespace.c                    |   7 +-
 fs/notify/inotify/inotify_user.c  |   3 +-
 fs/open.c                         |  20 +--
 fs/pipe.c                         |   5 +-
 fs/quota/quota.c                  |   3 +-
 fs/read_write.c                   |   2 +-
 fs/readdir.c                      |   6 +
 fs/select.c                       |   3 +-
 fs/splice.c                       |   4 +-
 fs/stat.c                         |   5 +-
 fs/xattr.c                        |  25 ++--
 include/linux/compat.h            | 280 ++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h          |  57 +-------
 include/linux/syscalls_structs.h  |  60 ++++++++
 include/uapi/asm-generic/unistd.h | 224 +++++++++++++++---------------
 ipc/mqueue.c                      |   3 +-
 kernel/acct.c                     |   3 +-
 kernel/bpf/syscall.c              |   3 +-
 kernel/capability.c               |   5 +-
 kernel/events/core.c              |   2 +-
 kernel/fork.c                     |  12 +-
 kernel/groups.c                   |   5 +-
 kernel/kcmp.c                     |   3 +-
 kernel/module.c                   |   7 +-
 kernel/printk/printk.c            |   3 +-
 kernel/reboot.c                   |   3 +-
 kernel/sched/core.c               |  11 +-
 kernel/seccomp.c                  |   2 +-
 kernel/signal.c                   |   6 +-
 kernel/sys.c                      |  16 +--
 kernel/sys_ni.c                   | 104 +++++++-------
 mm/madvise.c                      |   3 +-
 mm/mincore.c                      |   3 +-
 mm/mlock.c                        |   7 +-
 mm/mmap.c                         |   7 +-
 mm/mprotect.c                     |   3 +-
 mm/mremap.c                       |   3 +-
 mm/msync.c                        |   3 +-
 mm/nommu.c                        |   7 +-
 mm/shmem.c                        |   3 +-
 mm/swapfile.c                     |   5 +-
 net/socket.c                      |  14 +-
 security/keys/keyctl.c            |   5 +-
 59 files changed, 699 insertions(+), 520 deletions(-)
 delete mode 100644 arch/s390/kernel/compat_wrapper.c
 create mode 100644 include/linux/syscalls_structs.h

-- 
2.5.0

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-01-25 16:57 ` Yury Norov
  (?)
@ 2016-01-25 16:57   ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

__SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
unsigned long and pointer types are all 32-bit length.

linux/syscalls_structs.h header is introduced, because from now (see next patch)
structure types listed there are needed for both normal and compat mode.

cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
compat wrappers are enabled.

Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
asm-generated syscall table. But architectures that generate that tables with
C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/include/asm/compat.h    | 17 +++++++++--
 arch/s390/kernel/compat_wrapper.c | 51 -------------------------------
 include/linux/compat.h            | 63 +++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h          | 57 +----------------------------------
 include/linux/syscalls_structs.h  | 60 +++++++++++++++++++++++++++++++++++++
 include/uapi/asm-generic/unistd.h |  4 +++
 kernel/sys_ni.c                   |  8 +++++
 7 files changed, 151 insertions(+), 109 deletions(-)
 create mode 100644 include/linux/syscalls_structs.h

diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index d350ed9..46cb4be 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -7,13 +7,26 @@
 #include <linux/sched.h>
 #include <linux/thread_info.h>
 
-#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
-
 #define __SC_DELOUSE(t,v) ({ \
 	BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
 	(t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
 })
 
+#define __SC_COMPAT_CAST(t, a)						\
+({									\
+	long __ReS = a;							\
+									\
+	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
+		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
+	if (__TYPE_IS_L(t))						\
+		__ReS = (s32)a;						\
+	if (__TYPE_IS_UL(t))						\
+		__ReS = (u32)a;						\
+	if (__TYPE_IS_PTR(t))						\
+		__ReS = a & 0x7fffffff;					\
+	(t)__ReS;							\
+})
+
 #define PSW32_MASK_PER		0x40000000UL
 #define PSW32_MASK_DAT		0x04000000UL
 #define PSW32_MASK_IO		0x02000000UL
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c
index fac4eed..527f75d 100644
--- a/arch/s390/kernel/compat_wrapper.c
+++ b/arch/s390/kernel/compat_wrapper.c
@@ -8,57 +8,6 @@
 #include <linux/compat.h>
 #include "entry.h"
 
-#define COMPAT_SYSCALL_WRAP1(name, ...) \
-	COMPAT_SYSCALL_WRAPx(1, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP2(name, ...) \
-	COMPAT_SYSCALL_WRAPx(2, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP3(name, ...) \
-	COMPAT_SYSCALL_WRAPx(3, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP4(name, ...) \
-	COMPAT_SYSCALL_WRAPx(4, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP5(name, ...) \
-	COMPAT_SYSCALL_WRAPx(5, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP6(name, ...) \
-	COMPAT_SYSCALL_WRAPx(6, _##name, __VA_ARGS__)
-
-#define __SC_COMPAT_TYPE(t, a) \
-	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
-
-#define __SC_COMPAT_CAST(t, a)						\
-({									\
-	long __ReS = a;							\
-									\
-	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
-		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
-	if (__TYPE_IS_L(t))						\
-		__ReS = (s32)a;						\
-	if (__TYPE_IS_UL(t))						\
-		__ReS = (u32)a;						\
-	if (__TYPE_IS_PTR(t))						\
-		__ReS = a & 0x7fffffff;					\
-	(t)__ReS;							\
-})
-
-/*
- * The COMPAT_SYSCALL_WRAP macro generates system call wrappers to be used by
- * compat tasks. These wrappers will only be used for system calls where only
- * the system call arguments need sign or zero extension or zeroing of the upper
- * 33 bits of pointers.
- * Note: since the wrapper function will afterwards call a system call which
- * again performs zero and sign extension for all system call arguments with
- * a size of less than eight bytes, these compat wrappers only touch those
- * system call arguments with a size of eight bytes ((unsigned) long and
- * pointers). Zero and sign extension for e.g. int parameters will be done by
- * the regular system call wrappers.
- */
-#define COMPAT_SYSCALL_WRAPx(x, name, ...)					\
-asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));			\
-asmlinkage long notrace compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));\
-asmlinkage long notrace compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))	\
-{										\
-	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));		\
-}
-
 COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
 COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
 COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
diff --git a/include/linux/compat.h b/include/linux/compat.h
index a76c917..1a761ea 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -718,4 +718,67 @@ asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32,
 #define is_compat_task() (0)
 
 #endif /* CONFIG_COMPAT */
+
+#ifdef CONFIG_COMPAT_WRAPPER
+
+#ifndef __TYPE_IS_PTR
+#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
+#endif
+
+#ifndef __SC_COMPAT_TYPE
+#define __SC_COMPAT_TYPE(t, a) \
+	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
+#endif
+
+#ifndef __SC_COMPAT_CAST
+#define __SC_COMPAT_CAST(t, a) ({					\
+	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
+		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
+	((t) ((t)(-1) < 0 ? (s64)(s32)(a) : (u64)(u32)(a)));		\
+})
+#endif
+
+#ifndef SYSCALL_DEFINE_WRAPx
+/*
+ * The SYSCALL_DEFINE_WRAP macro generates system call wrappers to be used by
+ * compat tasks. These wrappers will only be used for system calls where only
+ * the system call arguments need sign or zero extension or zeroing of upper
+ * bits of pointers.
+ * Note: since the wrapper function will afterwards call a system call which
+ * again performs zero and sign extension for all system call arguments with
+ * a size of less than eight bytes, these compat wrappers only touch those
+ * system call arguments with a size of eight bytes ((unsigned) long and
+ * pointers). Zero and sign extension for e.g. int parameters will be done by
+ * the regular system call wrappers.
+ */
+#define SYSCALL_DEFINE_WRAPx(x, name, ...)						\
+asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));				\
+asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))			\
+		__attribute__((alias(__stringify(compat_SyS##name))));			\
+asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));		\
+asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))			\
+{											\
+	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));			\
+}											\
+SYSCALL_DEFINEx(x, name, __VA_ARGS__)
+#endif
+
+#define SYSCALL_DEFINE_WRAP1(name, ...) SYSCALL_DEFINE_WRAPx(1, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP2(name, ...) SYSCALL_DEFINE_WRAPx(2, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP3(name, ...) SYSCALL_DEFINE_WRAPx(3, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP4(name, ...) SYSCALL_DEFINE_WRAPx(4, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
+
+#else
+
+#define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
+#define SYSCALL_DEFINE_WRAP2    SYSCALL_DEFINE2
+#define SYSCALL_DEFINE_WRAP3    SYSCALL_DEFINE3
+#define SYSCALL_DEFINE_WRAP4    SYSCALL_DEFINE4
+#define SYSCALL_DEFINE_WRAP5    SYSCALL_DEFINE5
+#define SYSCALL_DEFINE_WRAP6    SYSCALL_DEFINE6
+
+#endif /* CONFIG_COMPAT_WRAPPER */
+
 #endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index c2b66a2..1942cf4 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -11,62 +11,7 @@
 #ifndef _LINUX_SYSCALLS_H
 #define _LINUX_SYSCALLS_H
 
-struct epoll_event;
-struct iattr;
-struct inode;
-struct iocb;
-struct io_event;
-struct iovec;
-struct itimerspec;
-struct itimerval;
-struct kexec_segment;
-struct linux_dirent;
-struct linux_dirent64;
-struct list_head;
-struct mmap_arg_struct;
-struct msgbuf;
-struct user_msghdr;
-struct mmsghdr;
-struct msqid_ds;
-struct new_utsname;
-struct nfsctl_arg;
-struct __old_kernel_stat;
-struct oldold_utsname;
-struct old_utsname;
-struct pollfd;
-struct rlimit;
-struct rlimit64;
-struct rusage;
-struct sched_param;
-struct sched_attr;
-struct sel_arg_struct;
-struct semaphore;
-struct sembuf;
-struct shmid_ds;
-struct sockaddr;
-struct stat;
-struct stat64;
-struct statfs;
-struct statfs64;
-struct __sysctl_args;
-struct sysinfo;
-struct timespec;
-struct timeval;
-struct timex;
-struct timezone;
-struct tms;
-struct utimbuf;
-struct mq_attr;
-struct compat_stat;
-struct compat_timeval;
-struct robust_list_head;
-struct getcpu_cache;
-struct old_linux_dirent;
-struct perf_event_attr;
-struct file_handle;
-struct sigaltstack;
-union bpf_attr;
-
+#include <linux/syscalls_structs.h>
 #include <linux/types.h>
 #include <linux/aio_abi.h>
 #include <linux/capability.h>
diff --git a/include/linux/syscalls_structs.h b/include/linux/syscalls_structs.h
new file mode 100644
index 0000000..a920cbc
--- /dev/null
+++ b/include/linux/syscalls_structs.h
@@ -0,0 +1,60 @@
+#ifndef _LINUX_SYSCALL_STRUCTS_H
+#define _LINUX_SYSCALL_STRUCTS_H
+
+struct epoll_event;
+struct iattr;
+struct inode;
+struct iocb;
+struct io_event;
+struct iovec;
+struct itimerspec;
+struct itimerval;
+struct kexec_segment;
+struct linux_dirent;
+struct linux_dirent64;
+struct list_head;
+struct mmap_arg_struct;
+struct msgbuf;
+struct user_msghdr;
+struct mmsghdr;
+struct msqid_ds;
+struct new_utsname;
+struct nfsctl_arg;
+struct __old_kernel_stat;
+struct oldold_utsname;
+struct old_utsname;
+struct pollfd;
+struct rlimit;
+struct rlimit64;
+struct rusage;
+struct sched_param;
+struct sched_attr;
+struct sel_arg_struct;
+struct semaphore;
+struct sembuf;
+struct shmid_ds;
+struct sockaddr;
+struct stat;
+struct stat64;
+struct statfs;
+struct statfs64;
+struct __sysctl_args;
+struct sysinfo;
+struct timespec;
+struct timeval;
+struct timex;
+struct timezone;
+struct tms;
+struct utimbuf;
+struct mq_attr;
+struct compat_stat;
+struct compat_timeval;
+struct robust_list_head;
+struct getcpu_cache;
+struct old_linux_dirent;
+struct perf_event_attr;
+struct file_handle;
+struct sigaltstack;
+union bpf_attr;
+
+#endif /* _LINUX_SYSCALL_STRUCTS_H */
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index 1324b02..a8380ad 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -29,6 +29,10 @@
 #define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64)
 #endif
 
+#ifndef __SC_WRAP
+#define __SC_WRAP __SYSCALL
+#endif
+
 #define __NR_io_setup 0
 __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
 #define __NR_io_destroy 1
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 0623787..8c99a45 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -16,6 +16,14 @@ asmlinkage long sys_ni_syscall(void)
 	return -ENOSYS;
 }
 
+#ifdef CONFIG_COMPAT_WRAPPER
+#define cond_syscall_wrapped(name)	\
+	cond_syscall(name);		\
+	cond_syscall(compat_##name);
+#else
+#define cond_syscall_wrapped	cond_syscall
+#endif
+
 cond_syscall(sys_quotactl);
 cond_syscall(sys32_quotactl);
 cond_syscall(sys_acct);
-- 
2.5.0

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

__SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
unsigned long and pointer types are all 32-bit length.

linux/syscalls_structs.h header is introduced, because from now (see next patch)
structure types listed there are needed for both normal and compat mode.

cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
compat wrappers are enabled.

Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
asm-generated syscall table. But architectures that generate that tables with
C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/include/asm/compat.h    | 17 +++++++++--
 arch/s390/kernel/compat_wrapper.c | 51 -------------------------------
 include/linux/compat.h            | 63 +++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h          | 57 +----------------------------------
 include/linux/syscalls_structs.h  | 60 +++++++++++++++++++++++++++++++++++++
 include/uapi/asm-generic/unistd.h |  4 +++
 kernel/sys_ni.c                   |  8 +++++
 7 files changed, 151 insertions(+), 109 deletions(-)
 create mode 100644 include/linux/syscalls_structs.h

diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index d350ed9..46cb4be 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -7,13 +7,26 @@
 #include <linux/sched.h>
 #include <linux/thread_info.h>
 
-#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
-
 #define __SC_DELOUSE(t,v) ({ \
 	BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
 	(t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
 })
 
+#define __SC_COMPAT_CAST(t, a)						\
+({									\
+	long __ReS = a;							\
+									\
+	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
+		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
+	if (__TYPE_IS_L(t))						\
+		__ReS = (s32)a;						\
+	if (__TYPE_IS_UL(t))						\
+		__ReS = (u32)a;						\
+	if (__TYPE_IS_PTR(t))						\
+		__ReS = a & 0x7fffffff;					\
+	(t)__ReS;							\
+})
+
 #define PSW32_MASK_PER		0x40000000UL
 #define PSW32_MASK_DAT		0x04000000UL
 #define PSW32_MASK_IO		0x02000000UL
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c
index fac4eed..527f75d 100644
--- a/arch/s390/kernel/compat_wrapper.c
+++ b/arch/s390/kernel/compat_wrapper.c
@@ -8,57 +8,6 @@
 #include <linux/compat.h>
 #include "entry.h"
 
-#define COMPAT_SYSCALL_WRAP1(name, ...) \
-	COMPAT_SYSCALL_WRAPx(1, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP2(name, ...) \
-	COMPAT_SYSCALL_WRAPx(2, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP3(name, ...) \
-	COMPAT_SYSCALL_WRAPx(3, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP4(name, ...) \
-	COMPAT_SYSCALL_WRAPx(4, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP5(name, ...) \
-	COMPAT_SYSCALL_WRAPx(5, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP6(name, ...) \
-	COMPAT_SYSCALL_WRAPx(6, _##name, __VA_ARGS__)
-
-#define __SC_COMPAT_TYPE(t, a) \
-	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
-
-#define __SC_COMPAT_CAST(t, a)						\
-({									\
-	long __ReS = a;							\
-									\
-	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
-		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
-	if (__TYPE_IS_L(t))						\
-		__ReS = (s32)a;						\
-	if (__TYPE_IS_UL(t))						\
-		__ReS = (u32)a;						\
-	if (__TYPE_IS_PTR(t))						\
-		__ReS = a & 0x7fffffff;					\
-	(t)__ReS;							\
-})
-
-/*
- * The COMPAT_SYSCALL_WRAP macro generates system call wrappers to be used by
- * compat tasks. These wrappers will only be used for system calls where only
- * the system call arguments need sign or zero extension or zeroing of the upper
- * 33 bits of pointers.
- * Note: since the wrapper function will afterwards call a system call which
- * again performs zero and sign extension for all system call arguments with
- * a size of less than eight bytes, these compat wrappers only touch those
- * system call arguments with a size of eight bytes ((unsigned) long and
- * pointers). Zero and sign extension for e.g. int parameters will be done by
- * the regular system call wrappers.
- */
-#define COMPAT_SYSCALL_WRAPx(x, name, ...)					\
-asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));			\
-asmlinkage long notrace compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));\
-asmlinkage long notrace compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))	\
-{										\
-	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));		\
-}
-
 COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
 COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
 COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
diff --git a/include/linux/compat.h b/include/linux/compat.h
index a76c917..1a761ea 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -718,4 +718,67 @@ asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32,
 #define is_compat_task() (0)
 
 #endif /* CONFIG_COMPAT */
+
+#ifdef CONFIG_COMPAT_WRAPPER
+
+#ifndef __TYPE_IS_PTR
+#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
+#endif
+
+#ifndef __SC_COMPAT_TYPE
+#define __SC_COMPAT_TYPE(t, a) \
+	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
+#endif
+
+#ifndef __SC_COMPAT_CAST
+#define __SC_COMPAT_CAST(t, a) ({					\
+	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
+		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
+	((t) ((t)(-1) < 0 ? (s64)(s32)(a) : (u64)(u32)(a)));		\
+})
+#endif
+
+#ifndef SYSCALL_DEFINE_WRAPx
+/*
+ * The SYSCALL_DEFINE_WRAP macro generates system call wrappers to be used by
+ * compat tasks. These wrappers will only be used for system calls where only
+ * the system call arguments need sign or zero extension or zeroing of upper
+ * bits of pointers.
+ * Note: since the wrapper function will afterwards call a system call which
+ * again performs zero and sign extension for all system call arguments with
+ * a size of less than eight bytes, these compat wrappers only touch those
+ * system call arguments with a size of eight bytes ((unsigned) long and
+ * pointers). Zero and sign extension for e.g. int parameters will be done by
+ * the regular system call wrappers.
+ */
+#define SYSCALL_DEFINE_WRAPx(x, name, ...)						\
+asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));				\
+asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))			\
+		__attribute__((alias(__stringify(compat_SyS##name))));			\
+asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));		\
+asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))			\
+{											\
+	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));			\
+}											\
+SYSCALL_DEFINEx(x, name, __VA_ARGS__)
+#endif
+
+#define SYSCALL_DEFINE_WRAP1(name, ...) SYSCALL_DEFINE_WRAPx(1, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP2(name, ...) SYSCALL_DEFINE_WRAPx(2, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP3(name, ...) SYSCALL_DEFINE_WRAPx(3, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP4(name, ...) SYSCALL_DEFINE_WRAPx(4, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
+
+#else
+
+#define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
+#define SYSCALL_DEFINE_WRAP2    SYSCALL_DEFINE2
+#define SYSCALL_DEFINE_WRAP3    SYSCALL_DEFINE3
+#define SYSCALL_DEFINE_WRAP4    SYSCALL_DEFINE4
+#define SYSCALL_DEFINE_WRAP5    SYSCALL_DEFINE5
+#define SYSCALL_DEFINE_WRAP6    SYSCALL_DEFINE6
+
+#endif /* CONFIG_COMPAT_WRAPPER */
+
 #endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index c2b66a2..1942cf4 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -11,62 +11,7 @@
 #ifndef _LINUX_SYSCALLS_H
 #define _LINUX_SYSCALLS_H
 
-struct epoll_event;
-struct iattr;
-struct inode;
-struct iocb;
-struct io_event;
-struct iovec;
-struct itimerspec;
-struct itimerval;
-struct kexec_segment;
-struct linux_dirent;
-struct linux_dirent64;
-struct list_head;
-struct mmap_arg_struct;
-struct msgbuf;
-struct user_msghdr;
-struct mmsghdr;
-struct msqid_ds;
-struct new_utsname;
-struct nfsctl_arg;
-struct __old_kernel_stat;
-struct oldold_utsname;
-struct old_utsname;
-struct pollfd;
-struct rlimit;
-struct rlimit64;
-struct rusage;
-struct sched_param;
-struct sched_attr;
-struct sel_arg_struct;
-struct semaphore;
-struct sembuf;
-struct shmid_ds;
-struct sockaddr;
-struct stat;
-struct stat64;
-struct statfs;
-struct statfs64;
-struct __sysctl_args;
-struct sysinfo;
-struct timespec;
-struct timeval;
-struct timex;
-struct timezone;
-struct tms;
-struct utimbuf;
-struct mq_attr;
-struct compat_stat;
-struct compat_timeval;
-struct robust_list_head;
-struct getcpu_cache;
-struct old_linux_dirent;
-struct perf_event_attr;
-struct file_handle;
-struct sigaltstack;
-union bpf_attr;
-
+#include <linux/syscalls_structs.h>
 #include <linux/types.h>
 #include <linux/aio_abi.h>
 #include <linux/capability.h>
diff --git a/include/linux/syscalls_structs.h b/include/linux/syscalls_structs.h
new file mode 100644
index 0000000..a920cbc
--- /dev/null
+++ b/include/linux/syscalls_structs.h
@@ -0,0 +1,60 @@
+#ifndef _LINUX_SYSCALL_STRUCTS_H
+#define _LINUX_SYSCALL_STRUCTS_H
+
+struct epoll_event;
+struct iattr;
+struct inode;
+struct iocb;
+struct io_event;
+struct iovec;
+struct itimerspec;
+struct itimerval;
+struct kexec_segment;
+struct linux_dirent;
+struct linux_dirent64;
+struct list_head;
+struct mmap_arg_struct;
+struct msgbuf;
+struct user_msghdr;
+struct mmsghdr;
+struct msqid_ds;
+struct new_utsname;
+struct nfsctl_arg;
+struct __old_kernel_stat;
+struct oldold_utsname;
+struct old_utsname;
+struct pollfd;
+struct rlimit;
+struct rlimit64;
+struct rusage;
+struct sched_param;
+struct sched_attr;
+struct sel_arg_struct;
+struct semaphore;
+struct sembuf;
+struct shmid_ds;
+struct sockaddr;
+struct stat;
+struct stat64;
+struct statfs;
+struct statfs64;
+struct __sysctl_args;
+struct sysinfo;
+struct timespec;
+struct timeval;
+struct timex;
+struct timezone;
+struct tms;
+struct utimbuf;
+struct mq_attr;
+struct compat_stat;
+struct compat_timeval;
+struct robust_list_head;
+struct getcpu_cache;
+struct old_linux_dirent;
+struct perf_event_attr;
+struct file_handle;
+struct sigaltstack;
+union bpf_attr;
+
+#endif /* _LINUX_SYSCALL_STRUCTS_H */
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index 1324b02..a8380ad 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -29,6 +29,10 @@
 #define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64)
 #endif
 
+#ifndef __SC_WRAP
+#define __SC_WRAP __SYSCALL
+#endif
+
 #define __NR_io_setup 0
 __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
 #define __NR_io_destroy 1
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 0623787..8c99a45 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -16,6 +16,14 @@ asmlinkage long sys_ni_syscall(void)
 	return -ENOSYS;
 }
 
+#ifdef CONFIG_COMPAT_WRAPPER
+#define cond_syscall_wrapped(name)	\
+	cond_syscall(name);		\
+	cond_syscall(compat_##name);
+#else
+#define cond_syscall_wrapped	cond_syscall
+#endif
+
 cond_syscall(sys_quotactl);
 cond_syscall(sys32_quotactl);
 cond_syscall(sys_acct);
-- 
2.5.0

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

__SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
unsigned long and pointer types are all 32-bit length.

linux/syscalls_structs.h header is introduced, because from now (see next patch)
structure types listed there are needed for both normal and compat mode.

cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
compat wrappers are enabled.

Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
asm-generated syscall table. But architectures that generate that tables with
C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/include/asm/compat.h    | 17 +++++++++--
 arch/s390/kernel/compat_wrapper.c | 51 -------------------------------
 include/linux/compat.h            | 63 +++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h          | 57 +----------------------------------
 include/linux/syscalls_structs.h  | 60 +++++++++++++++++++++++++++++++++++++
 include/uapi/asm-generic/unistd.h |  4 +++
 kernel/sys_ni.c                   |  8 +++++
 7 files changed, 151 insertions(+), 109 deletions(-)
 create mode 100644 include/linux/syscalls_structs.h

diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index d350ed9..46cb4be 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -7,13 +7,26 @@
 #include <linux/sched.h>
 #include <linux/thread_info.h>
 
-#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
-
 #define __SC_DELOUSE(t,v) ({ \
 	BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
 	(t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
 })
 
+#define __SC_COMPAT_CAST(t, a)						\
+({									\
+	long __ReS = a;							\
+									\
+	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
+		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
+	if (__TYPE_IS_L(t))						\
+		__ReS = (s32)a;						\
+	if (__TYPE_IS_UL(t))						\
+		__ReS = (u32)a;						\
+	if (__TYPE_IS_PTR(t))						\
+		__ReS = a & 0x7fffffff;					\
+	(t)__ReS;							\
+})
+
 #define PSW32_MASK_PER		0x40000000UL
 #define PSW32_MASK_DAT		0x04000000UL
 #define PSW32_MASK_IO		0x02000000UL
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c
index fac4eed..527f75d 100644
--- a/arch/s390/kernel/compat_wrapper.c
+++ b/arch/s390/kernel/compat_wrapper.c
@@ -8,57 +8,6 @@
 #include <linux/compat.h>
 #include "entry.h"
 
-#define COMPAT_SYSCALL_WRAP1(name, ...) \
-	COMPAT_SYSCALL_WRAPx(1, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP2(name, ...) \
-	COMPAT_SYSCALL_WRAPx(2, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP3(name, ...) \
-	COMPAT_SYSCALL_WRAPx(3, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP4(name, ...) \
-	COMPAT_SYSCALL_WRAPx(4, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP5(name, ...) \
-	COMPAT_SYSCALL_WRAPx(5, _##name, __VA_ARGS__)
-#define COMPAT_SYSCALL_WRAP6(name, ...) \
-	COMPAT_SYSCALL_WRAPx(6, _##name, __VA_ARGS__)
-
-#define __SC_COMPAT_TYPE(t, a) \
-	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
-
-#define __SC_COMPAT_CAST(t, a)						\
-({									\
-	long __ReS = a;							\
-									\
-	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
-		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
-	if (__TYPE_IS_L(t))						\
-		__ReS = (s32)a;						\
-	if (__TYPE_IS_UL(t))						\
-		__ReS = (u32)a;						\
-	if (__TYPE_IS_PTR(t))						\
-		__ReS = a & 0x7fffffff;					\
-	(t)__ReS;							\
-})
-
-/*
- * The COMPAT_SYSCALL_WRAP macro generates system call wrappers to be used by
- * compat tasks. These wrappers will only be used for system calls where only
- * the system call arguments need sign or zero extension or zeroing of the upper
- * 33 bits of pointers.
- * Note: since the wrapper function will afterwards call a system call which
- * again performs zero and sign extension for all system call arguments with
- * a size of less than eight bytes, these compat wrappers only touch those
- * system call arguments with a size of eight bytes ((unsigned) long and
- * pointers). Zero and sign extension for e.g. int parameters will be done by
- * the regular system call wrappers.
- */
-#define COMPAT_SYSCALL_WRAPx(x, name, ...)					\
-asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));			\
-asmlinkage long notrace compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));\
-asmlinkage long notrace compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))	\
-{										\
-	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));		\
-}
-
 COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
 COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
 COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
diff --git a/include/linux/compat.h b/include/linux/compat.h
index a76c917..1a761ea 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -718,4 +718,67 @@ asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32,
 #define is_compat_task() (0)
 
 #endif /* CONFIG_COMPAT */
+
+#ifdef CONFIG_COMPAT_WRAPPER
+
+#ifndef __TYPE_IS_PTR
+#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
+#endif
+
+#ifndef __SC_COMPAT_TYPE
+#define __SC_COMPAT_TYPE(t, a) \
+	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
+#endif
+
+#ifndef __SC_COMPAT_CAST
+#define __SC_COMPAT_CAST(t, a) ({					\
+	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
+		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
+	((t) ((t)(-1) < 0 ? (s64)(s32)(a) : (u64)(u32)(a)));		\
+})
+#endif
+
+#ifndef SYSCALL_DEFINE_WRAPx
+/*
+ * The SYSCALL_DEFINE_WRAP macro generates system call wrappers to be used by
+ * compat tasks. These wrappers will only be used for system calls where only
+ * the system call arguments need sign or zero extension or zeroing of upper
+ * bits of pointers.
+ * Note: since the wrapper function will afterwards call a system call which
+ * again performs zero and sign extension for all system call arguments with
+ * a size of less than eight bytes, these compat wrappers only touch those
+ * system call arguments with a size of eight bytes ((unsigned) long and
+ * pointers). Zero and sign extension for e.g. int parameters will be done by
+ * the regular system call wrappers.
+ */
+#define SYSCALL_DEFINE_WRAPx(x, name, ...)						\
+asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));				\
+asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))			\
+		__attribute__((alias(__stringify(compat_SyS##name))));			\
+asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));		\
+asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))			\
+{											\
+	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));			\
+}											\
+SYSCALL_DEFINEx(x, name, __VA_ARGS__)
+#endif
+
+#define SYSCALL_DEFINE_WRAP1(name, ...) SYSCALL_DEFINE_WRAPx(1, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP2(name, ...) SYSCALL_DEFINE_WRAPx(2, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP3(name, ...) SYSCALL_DEFINE_WRAPx(3, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP4(name, ...) SYSCALL_DEFINE_WRAPx(4, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
+#define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
+
+#else
+
+#define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
+#define SYSCALL_DEFINE_WRAP2    SYSCALL_DEFINE2
+#define SYSCALL_DEFINE_WRAP3    SYSCALL_DEFINE3
+#define SYSCALL_DEFINE_WRAP4    SYSCALL_DEFINE4
+#define SYSCALL_DEFINE_WRAP5    SYSCALL_DEFINE5
+#define SYSCALL_DEFINE_WRAP6    SYSCALL_DEFINE6
+
+#endif /* CONFIG_COMPAT_WRAPPER */
+
 #endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index c2b66a2..1942cf4 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -11,62 +11,7 @@
 #ifndef _LINUX_SYSCALLS_H
 #define _LINUX_SYSCALLS_H
 
-struct epoll_event;
-struct iattr;
-struct inode;
-struct iocb;
-struct io_event;
-struct iovec;
-struct itimerspec;
-struct itimerval;
-struct kexec_segment;
-struct linux_dirent;
-struct linux_dirent64;
-struct list_head;
-struct mmap_arg_struct;
-struct msgbuf;
-struct user_msghdr;
-struct mmsghdr;
-struct msqid_ds;
-struct new_utsname;
-struct nfsctl_arg;
-struct __old_kernel_stat;
-struct oldold_utsname;
-struct old_utsname;
-struct pollfd;
-struct rlimit;
-struct rlimit64;
-struct rusage;
-struct sched_param;
-struct sched_attr;
-struct sel_arg_struct;
-struct semaphore;
-struct sembuf;
-struct shmid_ds;
-struct sockaddr;
-struct stat;
-struct stat64;
-struct statfs;
-struct statfs64;
-struct __sysctl_args;
-struct sysinfo;
-struct timespec;
-struct timeval;
-struct timex;
-struct timezone;
-struct tms;
-struct utimbuf;
-struct mq_attr;
-struct compat_stat;
-struct compat_timeval;
-struct robust_list_head;
-struct getcpu_cache;
-struct old_linux_dirent;
-struct perf_event_attr;
-struct file_handle;
-struct sigaltstack;
-union bpf_attr;
-
+#include <linux/syscalls_structs.h>
 #include <linux/types.h>
 #include <linux/aio_abi.h>
 #include <linux/capability.h>
diff --git a/include/linux/syscalls_structs.h b/include/linux/syscalls_structs.h
new file mode 100644
index 0000000..a920cbc
--- /dev/null
+++ b/include/linux/syscalls_structs.h
@@ -0,0 +1,60 @@
+#ifndef _LINUX_SYSCALL_STRUCTS_H
+#define _LINUX_SYSCALL_STRUCTS_H
+
+struct epoll_event;
+struct iattr;
+struct inode;
+struct iocb;
+struct io_event;
+struct iovec;
+struct itimerspec;
+struct itimerval;
+struct kexec_segment;
+struct linux_dirent;
+struct linux_dirent64;
+struct list_head;
+struct mmap_arg_struct;
+struct msgbuf;
+struct user_msghdr;
+struct mmsghdr;
+struct msqid_ds;
+struct new_utsname;
+struct nfsctl_arg;
+struct __old_kernel_stat;
+struct oldold_utsname;
+struct old_utsname;
+struct pollfd;
+struct rlimit;
+struct rlimit64;
+struct rusage;
+struct sched_param;
+struct sched_attr;
+struct sel_arg_struct;
+struct semaphore;
+struct sembuf;
+struct shmid_ds;
+struct sockaddr;
+struct stat;
+struct stat64;
+struct statfs;
+struct statfs64;
+struct __sysctl_args;
+struct sysinfo;
+struct timespec;
+struct timeval;
+struct timex;
+struct timezone;
+struct tms;
+struct utimbuf;
+struct mq_attr;
+struct compat_stat;
+struct compat_timeval;
+struct robust_list_head;
+struct getcpu_cache;
+struct old_linux_dirent;
+struct perf_event_attr;
+struct file_handle;
+struct sigaltstack;
+union bpf_attr;
+
+#endif /* _LINUX_SYSCALL_STRUCTS_H */
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index 1324b02..a8380ad 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -29,6 +29,10 @@
 #define __SC_COMP_3264(_nr, _32, _64, _comp) __SC_3264(_nr, _32, _64)
 #endif
 
+#ifndef __SC_WRAP
+#define __SC_WRAP __SYSCALL
+#endif
+
 #define __NR_io_setup 0
 __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
 #define __NR_io_destroy 1
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 0623787..8c99a45 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -16,6 +16,14 @@ asmlinkage long sys_ni_syscall(void)
 	return -ENOSYS;
 }
 
+#ifdef CONFIG_COMPAT_WRAPPER
+#define cond_syscall_wrapped(name)	\
+	cond_syscall(name);		\
+	cond_syscall(compat_##name);
+#else
+#define cond_syscall_wrapped	cond_syscall
+#endif
+
 cond_syscall(sys_quotactl);
 cond_syscall(sys32_quotactl);
 cond_syscall(sys_acct);
-- 
2.5.0

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

* [PATCH 2/5] all: declare new wrappers
  2016-01-25 16:57 ` Yury Norov
  (?)
@ 2016-01-25 16:57   ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

For arches that generate syscall table in C code declarations are
needed. Conditional wrappers are also introduced.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/kernel/entry.h |   2 +
 include/linux/compat.h   | 221 +++++++++++++++++++++++++++++++++++++++++++++++
 kernel/sys_ni.c          |  96 ++++++++++----------
 3 files changed, 271 insertions(+), 48 deletions(-)

diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index b7019ab..484a925 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -74,5 +74,7 @@ long sys_sigreturn(void);
 long sys_s390_personality(unsigned int personality);
 long sys_s390_runtime_instr(int command, int signum);
 long sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t);
+long compat_sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t);
 long sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
+long compat_sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
 #endif /* _ENTRY_H */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 1a761ea..9c57559 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -770,6 +770,227 @@ SYSCALL_DEFINEx(x, name, __VA_ARGS__)
 #define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
 #define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
 
+/* Compat wrappers */
+#include <linux/syscalls_structs.h>
+asmlinkage long compat_sys_creat(const char __user *pathname, umode_t mode);
+asmlinkage long compat_sys_link(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long compat_sys_chdir(const char __user *filename);
+asmlinkage long compat_sys_mknod(const char __user *filename, umode_t mode,
+				unsigned dev);
+asmlinkage long compat_sys_chmod(const char __user *filename, umode_t mode);
+asmlinkage long compat_sys_oldumount(char __user *name);
+asmlinkage long compat_sys_access(const char __user *filename, int mode);
+asmlinkage long compat_sys_rename(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long compat_sys_mkdir(const char __user *pathname, umode_t mode);
+asmlinkage long compat_sys_rmdir(const char __user *pathname);
+asmlinkage long compat_sys_pipe(int __user *fildes);
+asmlinkage long compat_sys_brk(unsigned long brk);
+asmlinkage long compat_sys_signal(int sig, __sighandler_t handler);
+asmlinkage long compat_sys_acct(const char __user *name);
+asmlinkage long compat_sys_umount(char __user *name, int flags);
+asmlinkage long compat_sys_chroot(const char __user *filename);
+
+#ifdef CONFIG_OLD_SIGSUSPEND
+asmlinkage long compat_sys_sigsuspend(old_sigset_t mask);
+#endif
+
+#ifdef CONFIG_OLD_SIGSUSPEND3
+asmlinkage long compat_sys_sigsuspend(int unused1, int unused2, old_sigset_t mask);
+#endif
+
+asmlinkage long compat_sys_sethostname(char __user *name, int len);
+asmlinkage long compat_sys_symlink(const char __user *old, const char __user *new);
+asmlinkage long compat_sys_readlink(const char __user *path,
+				char __user *buf, int bufsiz);
+asmlinkage long compat_sys_uselib(const char __user *library);
+asmlinkage long compat_sys_swapon(const char __user *specialfile, int swap_flags);
+asmlinkage long compat_sys_reboot(int magic1, int magic2, unsigned int cmd,
+				void __user *arg);
+asmlinkage long compat_sys_munmap(unsigned long addr, size_t len);
+asmlinkage long compat_sys_munmap(unsigned long addr, size_t len);
+asmlinkage long compat_sys_syslog(int type, char __user *buf, int len);
+asmlinkage long compat_sys_swapoff(const char __user *specialfile);
+asmlinkage long compat_sys_setdomainname(char __user *name, int len);
+asmlinkage long compat_sys_newuname(struct new_utsname __user *name);
+asmlinkage long compat_sys_mprotect(unsigned long start, size_t len,
+				unsigned long prot);
+asmlinkage long compat_sys_init_module(void __user *umod, unsigned long len,
+				const char __user *uargs);
+asmlinkage long compat_sys_delete_module(const char __user *name_user,
+				unsigned int flags);
+asmlinkage long compat_sys_quotactl(unsigned int cmd, const char __user *special,
+				qid_t id, void __user *addr);
+asmlinkage long compat_sys_bdflush(int func, long data);
+asmlinkage long compat_sys_sysfs(int option,
+				unsigned long arg1, unsigned long arg2);
+asmlinkage long compat_sys_llseek(unsigned int fd, unsigned long offset_high,
+			unsigned long offset_low, loff_t __user *result,
+			unsigned int whence);
+asmlinkage long compat_sys_msync(unsigned long start, size_t len, int flags);
+asmlinkage long compat_sys_mlock(unsigned long start, size_t len);
+asmlinkage long compat_sys_munlock(unsigned long start, size_t len);
+asmlinkage long compat_sys_sched_setparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_sched_getparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_sched_setscheduler(pid_t pid, int policy,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_mremap(unsigned long addr,
+			   unsigned long old_len, unsigned long new_len,
+			   unsigned long flags, unsigned long new_addr);
+asmlinkage long compat_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
+				int timeout);
+asmlinkage long compat_sys_prctl(int option, unsigned long arg2, unsigned long arg3,
+			unsigned long arg4, unsigned long arg5);
+asmlinkage long compat_sys_getcwd(char __user *buf, unsigned long size);
+asmlinkage long compat_sys_capget(cap_user_header_t header,
+				cap_user_data_t dataptr);
+asmlinkage long compat_sys_capset(cap_user_header_t header,
+				const cap_user_data_t data);
+asmlinkage long compat_sys_lchown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long compat_sys_getgroups(int gidsetsize, gid_t __user *grouplist);
+asmlinkage long compat_sys_setgroups(int gidsetsize, gid_t __user *grouplist);
+asmlinkage long compat_sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid);
+asmlinkage long compat_sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid);
+asmlinkage long compat_sys_chown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long compat_sys_pivot_root(const char __user *new_root,
+				const char __user *put_old);
+asmlinkage long compat_sys_mincore(unsigned long start, size_t len,
+				unsigned char __user * vec);
+asmlinkage long compat_sys_madvise(unsigned long start, size_t len, int behavior);
+asmlinkage long compat_sys_setxattr(const char __user *path, const char __user *name,
+			     const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_lsetxattr(const char __user *path, const char __user *name,
+			      const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_fsetxattr(int fd, const char __user *name,
+			      const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_getdents64(unsigned int fd,
+				struct linux_dirent64 __user *dirent,
+				unsigned int count);
+asmlinkage long compat_sys_getxattr(const char __user *path, const char __user *name,
+			     void __user *value, size_t size);
+asmlinkage long compat_sys_lgetxattr(const char __user *path, const char __user *name,
+			      void __user *value, size_t size);
+asmlinkage long compat_sys_fgetxattr(int fd, const char __user *name,
+			      void __user *value, size_t size);
+asmlinkage long compat_sys_listxattr(const char __user *path, char __user *list,
+			      size_t size);
+asmlinkage long compat_sys_llistxattr(const char __user *path, char __user *list,
+			       size_t size);
+asmlinkage long compat_sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long compat_sys_listxattr(const char __user *path, char __user *list,
+			      size_t size);
+asmlinkage long compat_sys_llistxattr(const char __user *path, char __user *list,
+			       size_t size);
+asmlinkage long compat_sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long compat_sys_removexattr(const char __user *path,
+				const char __user *name);
+asmlinkage long compat_sys_lremovexattr(const char __user *path,
+				 const char __user *name);
+asmlinkage long compat_sys_fremovexattr(int fd, const char __user *name);
+asmlinkage long compat_sys_set_tid_address(int __user *tidptr);
+asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
+				struct epoll_event __user *event);
+asmlinkage long compat_sys_epoll_wait(int epfd, struct epoll_event __user *events,
+				int maxevents, int timeout);
+asmlinkage long compat_sys_io_destroy(aio_context_t ctx);
+asmlinkage long compat_sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
+			      struct io_event __user *result);
+asmlinkage long compat_sys_mq_unlink(const char __user *name);
+asmlinkage long compat_sys_add_key(const char __user *_type,
+			    const char __user *_description,
+			    const void __user *_payload,
+			    size_t plen,
+			    key_serial_t destringid);
+asmlinkage long compat_sys_request_key(const char __user *_type,
+				const char __user *_description,
+				const char __user *_callout_info,
+				key_serial_t destringid);
+asmlinkage long compat_sys_remap_file_pages(unsigned long start, unsigned long size,
+			unsigned long prot, unsigned long pgoff,
+			unsigned long flags);
+asmlinkage long compat_sys_inotify_add_watch(int fd, const char __user *path,
+					u32 mask);
+asmlinkage long compat_sys_mknodat(int dfd, const char __user * filename, umode_t mode,
+			    unsigned dev);
+asmlinkage long compat_sys_mkdirat(int dfd, const char __user * pathname, umode_t mode);
+asmlinkage long compat_sys_fchownat(int dfd, const char __user *filename, uid_t user,
+			     gid_t group, int flag);
+asmlinkage long compat_sys_unlinkat(int dfd, const char __user * pathname, int flag);
+asmlinkage long compat_sys_renameat(int olddfd, const char __user * oldname,
+			     int newdfd, const char __user * newname);
+asmlinkage long compat_sys_symlinkat(const char __user * oldname,
+			      int newdfd, const char __user * newname);
+asmlinkage long compat_sys_linkat(int olddfd, const char __user *oldname,
+			   int newdfd, const char __user *newname, int flags);
+asmlinkage long compat_sys_readlinkat(int dfd, const char __user *path, char __user *buf,
+			       int bufsiz);
+asmlinkage long compat_sys_fchmodat(int dfd, const char __user * filename,
+			     umode_t mode);
+asmlinkage long compat_sys_faccessat(int dfd, const char __user *filename, int mode);
+asmlinkage long compat_sys_unshare(unsigned long unshare_flags);
+asmlinkage long compat_sys_splice(int fd_in, loff_t __user *off_in,
+			   int fd_out, loff_t __user *off_out,
+			   size_t len, unsigned int flags);
+asmlinkage long compat_sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
+asmlinkage long compat_sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
+asmlinkage long compat_sys_pipe2(int __user *fildes, int flags);
+asmlinkage long compat_sys_perf_event_open(
+		struct perf_event_attr __user *attr_uptr,
+		pid_t pid, int cpu, int group_fd, unsigned long flags);
+
+#ifdef CONFIG_CLONE_BACKWARDS
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int __user *, unsigned long,
+	       int __user *);
+#else
+#ifdef CONFIG_CLONE_BACKWARDS3
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int, int __user *,
+			  int __user *, unsigned long);
+#else
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int __user *,
+	       int __user *, unsigned long);
+#endif
+#endif
+
+asmlinkage long compat_sys_prlimit64(pid_t pid, unsigned int resource,
+				const struct rlimit64 __user *new_rlim,
+				struct rlimit64 __user *old_rlim);
+asmlinkage long compat_sys_name_to_handle_at(int dfd, const char __user *name,
+				      struct file_handle __user *handle,
+				      int __user *mnt_id, int flag);
+asmlinkage long compat_sys_kcmp(pid_t pid1, pid_t pid2, int type,
+			 unsigned long idx1, unsigned long idx2);
+asmlinkage long compat_sys_finit_module(int fd, const char __user *uargs, int flags);
+asmlinkage long compat_sys_sched_setattr(pid_t pid,
+					struct sched_attr __user *attr,
+					unsigned int flags);
+asmlinkage long compat_sys_sched_getattr(pid_t pid,
+					struct sched_attr __user *attr,
+					unsigned int size,
+					unsigned int flags);
+asmlinkage long compat_sys_renameat2(int olddfd, const char __user *oldname,
+			      int newdfd, const char __user *newname,
+			      unsigned int flags);
+asmlinkage long compat_sys_seccomp(unsigned int op, unsigned int flags,
+			    const char __user *uargs);
+asmlinkage long compat_sys_getrandom(char __user *buf, size_t count,
+			      unsigned int flags);
+asmlinkage long compat_sys_memfd_create(const char __user *uname_ptr, unsigned int flags);
+asmlinkage long compat_sys_bpf(int cmd, union bpf_attr *attr, unsigned int size);
+asmlinkage long compat_sys_socketpair(int, int, int, int __user *);
+asmlinkage long compat_sys_bind(int, struct sockaddr __user *, int);
+asmlinkage long compat_sys_connect(int, struct sockaddr __user *, int);
+asmlinkage long compat_sys_accept4(int, struct sockaddr __user *, int __user *, int);
+asmlinkage long compat_sys_getsockname(int, struct sockaddr __user *, int __user *);
+asmlinkage long compat_sys_getpeername(int, struct sockaddr __user *, int __user *);
+asmlinkage long compat_sys_sendto(int, void __user *, size_t, unsigned,
+				struct sockaddr __user *, int);
+asmlinkage long compat_sys_mlock2(unsigned long start, size_t len, int flags);
+
 #else
 
 #define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 8c99a45..fdf689b 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -24,28 +24,28 @@ asmlinkage long sys_ni_syscall(void)
 #define cond_syscall_wrapped	cond_syscall
 #endif
 
-cond_syscall(sys_quotactl);
+cond_syscall_wrapped(sys_quotactl);
 cond_syscall(sys32_quotactl);
-cond_syscall(sys_acct);
+cond_syscall_wrapped(sys_acct);
 cond_syscall(sys_lookup_dcookie);
 cond_syscall(compat_sys_lookup_dcookie);
-cond_syscall(sys_swapon);
-cond_syscall(sys_swapoff);
+cond_syscall_wrapped(sys_swapon);
+cond_syscall_wrapped(sys_swapoff);
 cond_syscall(sys_kexec_load);
 cond_syscall(compat_sys_kexec_load);
 cond_syscall(sys_kexec_file_load);
-cond_syscall(sys_init_module);
-cond_syscall(sys_finit_module);
-cond_syscall(sys_delete_module);
-cond_syscall(sys_socketpair);
-cond_syscall(sys_bind);
+cond_syscall_wrapped(sys_init_module);
+cond_syscall_wrapped(sys_finit_module);
+cond_syscall_wrapped(sys_delete_module);
+cond_syscall_wrapped(sys_socketpair);
+cond_syscall_wrapped(sys_bind);
 cond_syscall(sys_listen);
 cond_syscall(sys_accept);
-cond_syscall(sys_accept4);
-cond_syscall(sys_connect);
-cond_syscall(sys_getsockname);
-cond_syscall(sys_getpeername);
-cond_syscall(sys_sendto);
+cond_syscall_wrapped(sys_accept4);
+cond_syscall_wrapped(sys_connect);
+cond_syscall_wrapped(sys_getsockname);
+cond_syscall_wrapped(sys_getpeername);
+cond_syscall_wrapped(sys_sendto);
 cond_syscall(sys_send);
 cond_syscall(sys_recvfrom);
 cond_syscall(sys_recv);
@@ -74,8 +74,8 @@ cond_syscall(sys_get_robust_list);
 cond_syscall(compat_sys_get_robust_list);
 cond_syscall(sys_epoll_create);
 cond_syscall(sys_epoll_create1);
-cond_syscall(sys_epoll_ctl);
-cond_syscall(sys_epoll_wait);
+cond_syscall_wrapped(sys_epoll_ctl);
+cond_syscall_wrapped(sys_epoll_wait);
 cond_syscall(sys_epoll_pwait);
 cond_syscall(compat_sys_epoll_pwait);
 cond_syscall(sys_semget);
@@ -98,7 +98,7 @@ cond_syscall(sys_shmdt);
 cond_syscall(sys_shmctl);
 cond_syscall(compat_sys_shmctl);
 cond_syscall(sys_mq_open);
-cond_syscall(sys_mq_unlink);
+cond_syscall_wrapped(sys_mq_unlink);
 cond_syscall(sys_mq_timedsend);
 cond_syscall(sys_mq_timedreceive);
 cond_syscall(sys_mq_notify);
@@ -114,14 +114,14 @@ cond_syscall(sys_set_mempolicy);
 cond_syscall(compat_sys_mbind);
 cond_syscall(compat_sys_get_mempolicy);
 cond_syscall(compat_sys_set_mempolicy);
-cond_syscall(sys_add_key);
-cond_syscall(sys_request_key);
+cond_syscall_wrapped(sys_add_key);
+cond_syscall_wrapped(sys_request_key);
 cond_syscall(sys_keyctl);
 cond_syscall(compat_sys_keyctl);
 cond_syscall(compat_sys_socketcall);
 cond_syscall(sys_inotify_init);
 cond_syscall(sys_inotify_init1);
-cond_syscall(sys_inotify_add_watch);
+cond_syscall_wrapped(sys_inotify_add_watch);
 cond_syscall(sys_inotify_rm_watch);
 cond_syscall(sys_migrate_pages);
 cond_syscall(sys_move_pages);
@@ -154,12 +154,12 @@ cond_syscall(compat_sys_ipc);
 cond_syscall(compat_sys_sysctl);
 cond_syscall(sys_flock);
 cond_syscall(sys_io_setup);
-cond_syscall(sys_io_destroy);
+cond_syscall_wrapped(sys_io_destroy);
 cond_syscall(sys_io_submit);
-cond_syscall(sys_io_cancel);
+cond_syscall_wrapped(sys_io_cancel);
 cond_syscall(sys_io_getevents);
-cond_syscall(sys_sysfs);
-cond_syscall(sys_syslog);
+cond_syscall_wrapped(sys_sysfs);
+cond_syscall_wrapped(sys_syslog);
 cond_syscall(sys_process_vm_readv);
 cond_syscall(sys_process_vm_writev);
 cond_syscall(compat_sys_process_vm_readv);
@@ -173,15 +173,15 @@ cond_syscall(sys_setregid);
 cond_syscall(sys_setgid);
 cond_syscall(sys_setreuid);
 cond_syscall(sys_setresuid);
-cond_syscall(sys_getresuid);
+cond_syscall_wrapped(sys_getresuid);
 cond_syscall(sys_setresgid);
-cond_syscall(sys_getresgid);
-cond_syscall(sys_setgroups);
-cond_syscall(sys_getgroups);
+cond_syscall_wrapped(sys_getresgid);
+cond_syscall_wrapped(sys_setgroups);
+cond_syscall_wrapped(sys_getgroups);
 cond_syscall(sys_setfsuid);
 cond_syscall(sys_setfsgid);
-cond_syscall(sys_capget);
-cond_syscall(sys_capset);
+cond_syscall_wrapped(sys_capget);
+cond_syscall_wrapped(sys_capset);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
@@ -192,26 +192,26 @@ cond_syscall(ppc_rtas);
 cond_syscall(sys_spu_run);
 cond_syscall(sys_spu_create);
 cond_syscall(sys_subpage_prot);
-cond_syscall(sys_s390_pci_mmio_read);
-cond_syscall(sys_s390_pci_mmio_write);
+cond_syscall_wrapped(sys_s390_pci_mmio_read);
+cond_syscall_wrapped(sys_s390_pci_mmio_write);
 
 /* mmu depending weak syscall entries */
-cond_syscall(sys_mprotect);
-cond_syscall(sys_msync);
-cond_syscall(sys_mlock);
-cond_syscall(sys_munlock);
+cond_syscall_wrapped(sys_mprotect);
+cond_syscall_wrapped(sys_msync);
+cond_syscall_wrapped(sys_mlock);
+cond_syscall_wrapped(sys_munlock);
 cond_syscall(sys_mlockall);
 cond_syscall(sys_munlockall);
-cond_syscall(sys_mlock2);
-cond_syscall(sys_mincore);
-cond_syscall(sys_madvise);
-cond_syscall(sys_mremap);
-cond_syscall(sys_remap_file_pages);
+cond_syscall_wrapped(sys_mlock2);
+cond_syscall_wrapped(sys_mincore);
+cond_syscall_wrapped(sys_madvise);
+cond_syscall_wrapped(sys_mremap);
+cond_syscall_wrapped(sys_remap_file_pages);
 cond_syscall(compat_sys_move_pages);
 cond_syscall(compat_sys_migrate_pages);
 
 /* block-layer dependent */
-cond_syscall(sys_bdflush);
+cond_syscall_wrapped(sys_bdflush);
 cond_syscall(sys_ioprio_set);
 cond_syscall(sys_ioprio_get);
 
@@ -227,11 +227,11 @@ cond_syscall(compat_sys_timerfd_settime);
 cond_syscall(compat_sys_timerfd_gettime);
 cond_syscall(sys_eventfd);
 cond_syscall(sys_eventfd2);
-cond_syscall(sys_memfd_create);
+cond_syscall_wrapped(sys_memfd_create);
 cond_syscall(sys_userfaultfd);
 
 /* performance counters: */
-cond_syscall(sys_perf_event_open);
+cond_syscall_wrapped(sys_perf_event_open);
 
 /* fanotify! */
 cond_syscall(sys_fanotify_init);
@@ -239,18 +239,18 @@ cond_syscall(sys_fanotify_mark);
 cond_syscall(compat_sys_fanotify_mark);
 
 /* open by handle */
-cond_syscall(sys_name_to_handle_at);
+cond_syscall_wrapped(sys_name_to_handle_at);
 cond_syscall(sys_open_by_handle_at);
 cond_syscall(compat_sys_open_by_handle_at);
 
 /* compare kernel pointers */
-cond_syscall(sys_kcmp);
+cond_syscall_wrapped(sys_kcmp);
 
 /* operate on Secure Computing state */
-cond_syscall(sys_seccomp);
+cond_syscall_wrapped(sys_seccomp);
 
 /* access BPF programs and maps */
-cond_syscall(sys_bpf);
+cond_syscall_wrapped(sys_bpf);
 
 /* execveat */
 cond_syscall(sys_execveat);
-- 
2.5.0

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

* [PATCH 2/5] all: declare new wrappers
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

For arches that generate syscall table in C code declarations are
needed. Conditional wrappers are also introduced.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/kernel/entry.h |   2 +
 include/linux/compat.h   | 221 +++++++++++++++++++++++++++++++++++++++++++++++
 kernel/sys_ni.c          |  96 ++++++++++----------
 3 files changed, 271 insertions(+), 48 deletions(-)

diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index b7019ab..484a925 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -74,5 +74,7 @@ long sys_sigreturn(void);
 long sys_s390_personality(unsigned int personality);
 long sys_s390_runtime_instr(int command, int signum);
 long sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t);
+long compat_sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t);
 long sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
+long compat_sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
 #endif /* _ENTRY_H */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 1a761ea..9c57559 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -770,6 +770,227 @@ SYSCALL_DEFINEx(x, name, __VA_ARGS__)
 #define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
 #define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
 
+/* Compat wrappers */
+#include <linux/syscalls_structs.h>
+asmlinkage long compat_sys_creat(const char __user *pathname, umode_t mode);
+asmlinkage long compat_sys_link(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long compat_sys_chdir(const char __user *filename);
+asmlinkage long compat_sys_mknod(const char __user *filename, umode_t mode,
+				unsigned dev);
+asmlinkage long compat_sys_chmod(const char __user *filename, umode_t mode);
+asmlinkage long compat_sys_oldumount(char __user *name);
+asmlinkage long compat_sys_access(const char __user *filename, int mode);
+asmlinkage long compat_sys_rename(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long compat_sys_mkdir(const char __user *pathname, umode_t mode);
+asmlinkage long compat_sys_rmdir(const char __user *pathname);
+asmlinkage long compat_sys_pipe(int __user *fildes);
+asmlinkage long compat_sys_brk(unsigned long brk);
+asmlinkage long compat_sys_signal(int sig, __sighandler_t handler);
+asmlinkage long compat_sys_acct(const char __user *name);
+asmlinkage long compat_sys_umount(char __user *name, int flags);
+asmlinkage long compat_sys_chroot(const char __user *filename);
+
+#ifdef CONFIG_OLD_SIGSUSPEND
+asmlinkage long compat_sys_sigsuspend(old_sigset_t mask);
+#endif
+
+#ifdef CONFIG_OLD_SIGSUSPEND3
+asmlinkage long compat_sys_sigsuspend(int unused1, int unused2, old_sigset_t mask);
+#endif
+
+asmlinkage long compat_sys_sethostname(char __user *name, int len);
+asmlinkage long compat_sys_symlink(const char __user *old, const char __user *new);
+asmlinkage long compat_sys_readlink(const char __user *path,
+				char __user *buf, int bufsiz);
+asmlinkage long compat_sys_uselib(const char __user *library);
+asmlinkage long compat_sys_swapon(const char __user *specialfile, int swap_flags);
+asmlinkage long compat_sys_reboot(int magic1, int magic2, unsigned int cmd,
+				void __user *arg);
+asmlinkage long compat_sys_munmap(unsigned long addr, size_t len);
+asmlinkage long compat_sys_munmap(unsigned long addr, size_t len);
+asmlinkage long compat_sys_syslog(int type, char __user *buf, int len);
+asmlinkage long compat_sys_swapoff(const char __user *specialfile);
+asmlinkage long compat_sys_setdomainname(char __user *name, int len);
+asmlinkage long compat_sys_newuname(struct new_utsname __user *name);
+asmlinkage long compat_sys_mprotect(unsigned long start, size_t len,
+				unsigned long prot);
+asmlinkage long compat_sys_init_module(void __user *umod, unsigned long len,
+				const char __user *uargs);
+asmlinkage long compat_sys_delete_module(const char __user *name_user,
+				unsigned int flags);
+asmlinkage long compat_sys_quotactl(unsigned int cmd, const char __user *special,
+				qid_t id, void __user *addr);
+asmlinkage long compat_sys_bdflush(int func, long data);
+asmlinkage long compat_sys_sysfs(int option,
+				unsigned long arg1, unsigned long arg2);
+asmlinkage long compat_sys_llseek(unsigned int fd, unsigned long offset_high,
+			unsigned long offset_low, loff_t __user *result,
+			unsigned int whence);
+asmlinkage long compat_sys_msync(unsigned long start, size_t len, int flags);
+asmlinkage long compat_sys_mlock(unsigned long start, size_t len);
+asmlinkage long compat_sys_munlock(unsigned long start, size_t len);
+asmlinkage long compat_sys_sched_setparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_sched_getparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_sched_setscheduler(pid_t pid, int policy,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_mremap(unsigned long addr,
+			   unsigned long old_len, unsigned long new_len,
+			   unsigned long flags, unsigned long new_addr);
+asmlinkage long compat_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
+				int timeout);
+asmlinkage long compat_sys_prctl(int option, unsigned long arg2, unsigned long arg3,
+			unsigned long arg4, unsigned long arg5);
+asmlinkage long compat_sys_getcwd(char __user *buf, unsigned long size);
+asmlinkage long compat_sys_capget(cap_user_header_t header,
+				cap_user_data_t dataptr);
+asmlinkage long compat_sys_capset(cap_user_header_t header,
+				const cap_user_data_t data);
+asmlinkage long compat_sys_lchown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long compat_sys_getgroups(int gidsetsize, gid_t __user *grouplist);
+asmlinkage long compat_sys_setgroups(int gidsetsize, gid_t __user *grouplist);
+asmlinkage long compat_sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid);
+asmlinkage long compat_sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid);
+asmlinkage long compat_sys_chown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long compat_sys_pivot_root(const char __user *new_root,
+				const char __user *put_old);
+asmlinkage long compat_sys_mincore(unsigned long start, size_t len,
+				unsigned char __user * vec);
+asmlinkage long compat_sys_madvise(unsigned long start, size_t len, int behavior);
+asmlinkage long compat_sys_setxattr(const char __user *path, const char __user *name,
+			     const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_lsetxattr(const char __user *path, const char __user *name,
+			      const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_fsetxattr(int fd, const char __user *name,
+			      const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_getdents64(unsigned int fd,
+				struct linux_dirent64 __user *dirent,
+				unsigned int count);
+asmlinkage long compat_sys_getxattr(const char __user *path, const char __user *name,
+			     void __user *value, size_t size);
+asmlinkage long compat_sys_lgetxattr(const char __user *path, const char __user *name,
+			      void __user *value, size_t size);
+asmlinkage long compat_sys_fgetxattr(int fd, const char __user *name,
+			      void __user *value, size_t size);
+asmlinkage long compat_sys_listxattr(const char __user *path, char __user *list,
+			      size_t size);
+asmlinkage long compat_sys_llistxattr(const char __user *path, char __user *list,
+			       size_t size);
+asmlinkage long compat_sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long compat_sys_listxattr(const char __user *path, char __user *list,
+			      size_t size);
+asmlinkage long compat_sys_llistxattr(const char __user *path, char __user *list,
+			       size_t size);
+asmlinkage long compat_sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long compat_sys_removexattr(const char __user *path,
+				const char __user *name);
+asmlinkage long compat_sys_lremovexattr(const char __user *path,
+				 const char __user *name);
+asmlinkage long compat_sys_fremovexattr(int fd, const char __user *name);
+asmlinkage long compat_sys_set_tid_address(int __user *tidptr);
+asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
+				struct epoll_event __user *event);
+asmlinkage long compat_sys_epoll_wait(int epfd, struct epoll_event __user *events,
+				int maxevents, int timeout);
+asmlinkage long compat_sys_io_destroy(aio_context_t ctx);
+asmlinkage long compat_sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
+			      struct io_event __user *result);
+asmlinkage long compat_sys_mq_unlink(const char __user *name);
+asmlinkage long compat_sys_add_key(const char __user *_type,
+			    const char __user *_description,
+			    const void __user *_payload,
+			    size_t plen,
+			    key_serial_t destringid);
+asmlinkage long compat_sys_request_key(const char __user *_type,
+				const char __user *_description,
+				const char __user *_callout_info,
+				key_serial_t destringid);
+asmlinkage long compat_sys_remap_file_pages(unsigned long start, unsigned long size,
+			unsigned long prot, unsigned long pgoff,
+			unsigned long flags);
+asmlinkage long compat_sys_inotify_add_watch(int fd, const char __user *path,
+					u32 mask);
+asmlinkage long compat_sys_mknodat(int dfd, const char __user * filename, umode_t mode,
+			    unsigned dev);
+asmlinkage long compat_sys_mkdirat(int dfd, const char __user * pathname, umode_t mode);
+asmlinkage long compat_sys_fchownat(int dfd, const char __user *filename, uid_t user,
+			     gid_t group, int flag);
+asmlinkage long compat_sys_unlinkat(int dfd, const char __user * pathname, int flag);
+asmlinkage long compat_sys_renameat(int olddfd, const char __user * oldname,
+			     int newdfd, const char __user * newname);
+asmlinkage long compat_sys_symlinkat(const char __user * oldname,
+			      int newdfd, const char __user * newname);
+asmlinkage long compat_sys_linkat(int olddfd, const char __user *oldname,
+			   int newdfd, const char __user *newname, int flags);
+asmlinkage long compat_sys_readlinkat(int dfd, const char __user *path, char __user *buf,
+			       int bufsiz);
+asmlinkage long compat_sys_fchmodat(int dfd, const char __user * filename,
+			     umode_t mode);
+asmlinkage long compat_sys_faccessat(int dfd, const char __user *filename, int mode);
+asmlinkage long compat_sys_unshare(unsigned long unshare_flags);
+asmlinkage long compat_sys_splice(int fd_in, loff_t __user *off_in,
+			   int fd_out, loff_t __user *off_out,
+			   size_t len, unsigned int flags);
+asmlinkage long compat_sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
+asmlinkage long compat_sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
+asmlinkage long compat_sys_pipe2(int __user *fildes, int flags);
+asmlinkage long compat_sys_perf_event_open(
+		struct perf_event_attr __user *attr_uptr,
+		pid_t pid, int cpu, int group_fd, unsigned long flags);
+
+#ifdef CONFIG_CLONE_BACKWARDS
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int __user *, unsigned long,
+	       int __user *);
+#else
+#ifdef CONFIG_CLONE_BACKWARDS3
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int, int __user *,
+			  int __user *, unsigned long);
+#else
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int __user *,
+	       int __user *, unsigned long);
+#endif
+#endif
+
+asmlinkage long compat_sys_prlimit64(pid_t pid, unsigned int resource,
+				const struct rlimit64 __user *new_rlim,
+				struct rlimit64 __user *old_rlim);
+asmlinkage long compat_sys_name_to_handle_at(int dfd, const char __user *name,
+				      struct file_handle __user *handle,
+				      int __user *mnt_id, int flag);
+asmlinkage long compat_sys_kcmp(pid_t pid1, pid_t pid2, int type,
+			 unsigned long idx1, unsigned long idx2);
+asmlinkage long compat_sys_finit_module(int fd, const char __user *uargs, int flags);
+asmlinkage long compat_sys_sched_setattr(pid_t pid,
+					struct sched_attr __user *attr,
+					unsigned int flags);
+asmlinkage long compat_sys_sched_getattr(pid_t pid,
+					struct sched_attr __user *attr,
+					unsigned int size,
+					unsigned int flags);
+asmlinkage long compat_sys_renameat2(int olddfd, const char __user *oldname,
+			      int newdfd, const char __user *newname,
+			      unsigned int flags);
+asmlinkage long compat_sys_seccomp(unsigned int op, unsigned int flags,
+			    const char __user *uargs);
+asmlinkage long compat_sys_getrandom(char __user *buf, size_t count,
+			      unsigned int flags);
+asmlinkage long compat_sys_memfd_create(const char __user *uname_ptr, unsigned int flags);
+asmlinkage long compat_sys_bpf(int cmd, union bpf_attr *attr, unsigned int size);
+asmlinkage long compat_sys_socketpair(int, int, int, int __user *);
+asmlinkage long compat_sys_bind(int, struct sockaddr __user *, int);
+asmlinkage long compat_sys_connect(int, struct sockaddr __user *, int);
+asmlinkage long compat_sys_accept4(int, struct sockaddr __user *, int __user *, int);
+asmlinkage long compat_sys_getsockname(int, struct sockaddr __user *, int __user *);
+asmlinkage long compat_sys_getpeername(int, struct sockaddr __user *, int __user *);
+asmlinkage long compat_sys_sendto(int, void __user *, size_t, unsigned,
+				struct sockaddr __user *, int);
+asmlinkage long compat_sys_mlock2(unsigned long start, size_t len, int flags);
+
 #else
 
 #define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 8c99a45..fdf689b 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -24,28 +24,28 @@ asmlinkage long sys_ni_syscall(void)
 #define cond_syscall_wrapped	cond_syscall
 #endif
 
-cond_syscall(sys_quotactl);
+cond_syscall_wrapped(sys_quotactl);
 cond_syscall(sys32_quotactl);
-cond_syscall(sys_acct);
+cond_syscall_wrapped(sys_acct);
 cond_syscall(sys_lookup_dcookie);
 cond_syscall(compat_sys_lookup_dcookie);
-cond_syscall(sys_swapon);
-cond_syscall(sys_swapoff);
+cond_syscall_wrapped(sys_swapon);
+cond_syscall_wrapped(sys_swapoff);
 cond_syscall(sys_kexec_load);
 cond_syscall(compat_sys_kexec_load);
 cond_syscall(sys_kexec_file_load);
-cond_syscall(sys_init_module);
-cond_syscall(sys_finit_module);
-cond_syscall(sys_delete_module);
-cond_syscall(sys_socketpair);
-cond_syscall(sys_bind);
+cond_syscall_wrapped(sys_init_module);
+cond_syscall_wrapped(sys_finit_module);
+cond_syscall_wrapped(sys_delete_module);
+cond_syscall_wrapped(sys_socketpair);
+cond_syscall_wrapped(sys_bind);
 cond_syscall(sys_listen);
 cond_syscall(sys_accept);
-cond_syscall(sys_accept4);
-cond_syscall(sys_connect);
-cond_syscall(sys_getsockname);
-cond_syscall(sys_getpeername);
-cond_syscall(sys_sendto);
+cond_syscall_wrapped(sys_accept4);
+cond_syscall_wrapped(sys_connect);
+cond_syscall_wrapped(sys_getsockname);
+cond_syscall_wrapped(sys_getpeername);
+cond_syscall_wrapped(sys_sendto);
 cond_syscall(sys_send);
 cond_syscall(sys_recvfrom);
 cond_syscall(sys_recv);
@@ -74,8 +74,8 @@ cond_syscall(sys_get_robust_list);
 cond_syscall(compat_sys_get_robust_list);
 cond_syscall(sys_epoll_create);
 cond_syscall(sys_epoll_create1);
-cond_syscall(sys_epoll_ctl);
-cond_syscall(sys_epoll_wait);
+cond_syscall_wrapped(sys_epoll_ctl);
+cond_syscall_wrapped(sys_epoll_wait);
 cond_syscall(sys_epoll_pwait);
 cond_syscall(compat_sys_epoll_pwait);
 cond_syscall(sys_semget);
@@ -98,7 +98,7 @@ cond_syscall(sys_shmdt);
 cond_syscall(sys_shmctl);
 cond_syscall(compat_sys_shmctl);
 cond_syscall(sys_mq_open);
-cond_syscall(sys_mq_unlink);
+cond_syscall_wrapped(sys_mq_unlink);
 cond_syscall(sys_mq_timedsend);
 cond_syscall(sys_mq_timedreceive);
 cond_syscall(sys_mq_notify);
@@ -114,14 +114,14 @@ cond_syscall(sys_set_mempolicy);
 cond_syscall(compat_sys_mbind);
 cond_syscall(compat_sys_get_mempolicy);
 cond_syscall(compat_sys_set_mempolicy);
-cond_syscall(sys_add_key);
-cond_syscall(sys_request_key);
+cond_syscall_wrapped(sys_add_key);
+cond_syscall_wrapped(sys_request_key);
 cond_syscall(sys_keyctl);
 cond_syscall(compat_sys_keyctl);
 cond_syscall(compat_sys_socketcall);
 cond_syscall(sys_inotify_init);
 cond_syscall(sys_inotify_init1);
-cond_syscall(sys_inotify_add_watch);
+cond_syscall_wrapped(sys_inotify_add_watch);
 cond_syscall(sys_inotify_rm_watch);
 cond_syscall(sys_migrate_pages);
 cond_syscall(sys_move_pages);
@@ -154,12 +154,12 @@ cond_syscall(compat_sys_ipc);
 cond_syscall(compat_sys_sysctl);
 cond_syscall(sys_flock);
 cond_syscall(sys_io_setup);
-cond_syscall(sys_io_destroy);
+cond_syscall_wrapped(sys_io_destroy);
 cond_syscall(sys_io_submit);
-cond_syscall(sys_io_cancel);
+cond_syscall_wrapped(sys_io_cancel);
 cond_syscall(sys_io_getevents);
-cond_syscall(sys_sysfs);
-cond_syscall(sys_syslog);
+cond_syscall_wrapped(sys_sysfs);
+cond_syscall_wrapped(sys_syslog);
 cond_syscall(sys_process_vm_readv);
 cond_syscall(sys_process_vm_writev);
 cond_syscall(compat_sys_process_vm_readv);
@@ -173,15 +173,15 @@ cond_syscall(sys_setregid);
 cond_syscall(sys_setgid);
 cond_syscall(sys_setreuid);
 cond_syscall(sys_setresuid);
-cond_syscall(sys_getresuid);
+cond_syscall_wrapped(sys_getresuid);
 cond_syscall(sys_setresgid);
-cond_syscall(sys_getresgid);
-cond_syscall(sys_setgroups);
-cond_syscall(sys_getgroups);
+cond_syscall_wrapped(sys_getresgid);
+cond_syscall_wrapped(sys_setgroups);
+cond_syscall_wrapped(sys_getgroups);
 cond_syscall(sys_setfsuid);
 cond_syscall(sys_setfsgid);
-cond_syscall(sys_capget);
-cond_syscall(sys_capset);
+cond_syscall_wrapped(sys_capget);
+cond_syscall_wrapped(sys_capset);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
@@ -192,26 +192,26 @@ cond_syscall(ppc_rtas);
 cond_syscall(sys_spu_run);
 cond_syscall(sys_spu_create);
 cond_syscall(sys_subpage_prot);
-cond_syscall(sys_s390_pci_mmio_read);
-cond_syscall(sys_s390_pci_mmio_write);
+cond_syscall_wrapped(sys_s390_pci_mmio_read);
+cond_syscall_wrapped(sys_s390_pci_mmio_write);
 
 /* mmu depending weak syscall entries */
-cond_syscall(sys_mprotect);
-cond_syscall(sys_msync);
-cond_syscall(sys_mlock);
-cond_syscall(sys_munlock);
+cond_syscall_wrapped(sys_mprotect);
+cond_syscall_wrapped(sys_msync);
+cond_syscall_wrapped(sys_mlock);
+cond_syscall_wrapped(sys_munlock);
 cond_syscall(sys_mlockall);
 cond_syscall(sys_munlockall);
-cond_syscall(sys_mlock2);
-cond_syscall(sys_mincore);
-cond_syscall(sys_madvise);
-cond_syscall(sys_mremap);
-cond_syscall(sys_remap_file_pages);
+cond_syscall_wrapped(sys_mlock2);
+cond_syscall_wrapped(sys_mincore);
+cond_syscall_wrapped(sys_madvise);
+cond_syscall_wrapped(sys_mremap);
+cond_syscall_wrapped(sys_remap_file_pages);
 cond_syscall(compat_sys_move_pages);
 cond_syscall(compat_sys_migrate_pages);
 
 /* block-layer dependent */
-cond_syscall(sys_bdflush);
+cond_syscall_wrapped(sys_bdflush);
 cond_syscall(sys_ioprio_set);
 cond_syscall(sys_ioprio_get);
 
@@ -227,11 +227,11 @@ cond_syscall(compat_sys_timerfd_settime);
 cond_syscall(compat_sys_timerfd_gettime);
 cond_syscall(sys_eventfd);
 cond_syscall(sys_eventfd2);
-cond_syscall(sys_memfd_create);
+cond_syscall_wrapped(sys_memfd_create);
 cond_syscall(sys_userfaultfd);
 
 /* performance counters: */
-cond_syscall(sys_perf_event_open);
+cond_syscall_wrapped(sys_perf_event_open);
 
 /* fanotify! */
 cond_syscall(sys_fanotify_init);
@@ -239,18 +239,18 @@ cond_syscall(sys_fanotify_mark);
 cond_syscall(compat_sys_fanotify_mark);
 
 /* open by handle */
-cond_syscall(sys_name_to_handle_at);
+cond_syscall_wrapped(sys_name_to_handle_at);
 cond_syscall(sys_open_by_handle_at);
 cond_syscall(compat_sys_open_by_handle_at);
 
 /* compare kernel pointers */
-cond_syscall(sys_kcmp);
+cond_syscall_wrapped(sys_kcmp);
 
 /* operate on Secure Computing state */
-cond_syscall(sys_seccomp);
+cond_syscall_wrapped(sys_seccomp);
 
 /* access BPF programs and maps */
-cond_syscall(sys_bpf);
+cond_syscall_wrapped(sys_bpf);
 
 /* execveat */
 cond_syscall(sys_execveat);
-- 
2.5.0

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

* [PATCH 2/5] all: declare new wrappers
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

For arches that generate syscall table in C code declarations are
needed. Conditional wrappers are also introduced.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/kernel/entry.h |   2 +
 include/linux/compat.h   | 221 +++++++++++++++++++++++++++++++++++++++++++++++
 kernel/sys_ni.c          |  96 ++++++++++----------
 3 files changed, 271 insertions(+), 48 deletions(-)

diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index b7019ab..484a925 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -74,5 +74,7 @@ long sys_sigreturn(void);
 long sys_s390_personality(unsigned int personality);
 long sys_s390_runtime_instr(int command, int signum);
 long sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t);
+long compat_sys_s390_pci_mmio_write(unsigned long, const void __user *, size_t);
 long sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
+long compat_sys_s390_pci_mmio_read(unsigned long, void __user *, size_t);
 #endif /* _ENTRY_H */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 1a761ea..9c57559 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -770,6 +770,227 @@ SYSCALL_DEFINEx(x, name, __VA_ARGS__)
 #define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
 #define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
 
+/* Compat wrappers */
+#include <linux/syscalls_structs.h>
+asmlinkage long compat_sys_creat(const char __user *pathname, umode_t mode);
+asmlinkage long compat_sys_link(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long compat_sys_chdir(const char __user *filename);
+asmlinkage long compat_sys_mknod(const char __user *filename, umode_t mode,
+				unsigned dev);
+asmlinkage long compat_sys_chmod(const char __user *filename, umode_t mode);
+asmlinkage long compat_sys_oldumount(char __user *name);
+asmlinkage long compat_sys_access(const char __user *filename, int mode);
+asmlinkage long compat_sys_rename(const char __user *oldname,
+				const char __user *newname);
+asmlinkage long compat_sys_mkdir(const char __user *pathname, umode_t mode);
+asmlinkage long compat_sys_rmdir(const char __user *pathname);
+asmlinkage long compat_sys_pipe(int __user *fildes);
+asmlinkage long compat_sys_brk(unsigned long brk);
+asmlinkage long compat_sys_signal(int sig, __sighandler_t handler);
+asmlinkage long compat_sys_acct(const char __user *name);
+asmlinkage long compat_sys_umount(char __user *name, int flags);
+asmlinkage long compat_sys_chroot(const char __user *filename);
+
+#ifdef CONFIG_OLD_SIGSUSPEND
+asmlinkage long compat_sys_sigsuspend(old_sigset_t mask);
+#endif
+
+#ifdef CONFIG_OLD_SIGSUSPEND3
+asmlinkage long compat_sys_sigsuspend(int unused1, int unused2, old_sigset_t mask);
+#endif
+
+asmlinkage long compat_sys_sethostname(char __user *name, int len);
+asmlinkage long compat_sys_symlink(const char __user *old, const char __user *new);
+asmlinkage long compat_sys_readlink(const char __user *path,
+				char __user *buf, int bufsiz);
+asmlinkage long compat_sys_uselib(const char __user *library);
+asmlinkage long compat_sys_swapon(const char __user *specialfile, int swap_flags);
+asmlinkage long compat_sys_reboot(int magic1, int magic2, unsigned int cmd,
+				void __user *arg);
+asmlinkage long compat_sys_munmap(unsigned long addr, size_t len);
+asmlinkage long compat_sys_munmap(unsigned long addr, size_t len);
+asmlinkage long compat_sys_syslog(int type, char __user *buf, int len);
+asmlinkage long compat_sys_swapoff(const char __user *specialfile);
+asmlinkage long compat_sys_setdomainname(char __user *name, int len);
+asmlinkage long compat_sys_newuname(struct new_utsname __user *name);
+asmlinkage long compat_sys_mprotect(unsigned long start, size_t len,
+				unsigned long prot);
+asmlinkage long compat_sys_init_module(void __user *umod, unsigned long len,
+				const char __user *uargs);
+asmlinkage long compat_sys_delete_module(const char __user *name_user,
+				unsigned int flags);
+asmlinkage long compat_sys_quotactl(unsigned int cmd, const char __user *special,
+				qid_t id, void __user *addr);
+asmlinkage long compat_sys_bdflush(int func, long data);
+asmlinkage long compat_sys_sysfs(int option,
+				unsigned long arg1, unsigned long arg2);
+asmlinkage long compat_sys_llseek(unsigned int fd, unsigned long offset_high,
+			unsigned long offset_low, loff_t __user *result,
+			unsigned int whence);
+asmlinkage long compat_sys_msync(unsigned long start, size_t len, int flags);
+asmlinkage long compat_sys_mlock(unsigned long start, size_t len);
+asmlinkage long compat_sys_munlock(unsigned long start, size_t len);
+asmlinkage long compat_sys_sched_setparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_sched_getparam(pid_t pid,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_sched_setscheduler(pid_t pid, int policy,
+					struct sched_param __user *param);
+asmlinkage long compat_sys_mremap(unsigned long addr,
+			   unsigned long old_len, unsigned long new_len,
+			   unsigned long flags, unsigned long new_addr);
+asmlinkage long compat_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
+				int timeout);
+asmlinkage long compat_sys_prctl(int option, unsigned long arg2, unsigned long arg3,
+			unsigned long arg4, unsigned long arg5);
+asmlinkage long compat_sys_getcwd(char __user *buf, unsigned long size);
+asmlinkage long compat_sys_capget(cap_user_header_t header,
+				cap_user_data_t dataptr);
+asmlinkage long compat_sys_capset(cap_user_header_t header,
+				const cap_user_data_t data);
+asmlinkage long compat_sys_lchown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long compat_sys_getgroups(int gidsetsize, gid_t __user *grouplist);
+asmlinkage long compat_sys_setgroups(int gidsetsize, gid_t __user *grouplist);
+asmlinkage long compat_sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t __user *suid);
+asmlinkage long compat_sys_getresgid(gid_t __user *rgid, gid_t __user *egid, gid_t __user *sgid);
+asmlinkage long compat_sys_chown(const char __user *filename,
+				uid_t user, gid_t group);
+asmlinkage long compat_sys_pivot_root(const char __user *new_root,
+				const char __user *put_old);
+asmlinkage long compat_sys_mincore(unsigned long start, size_t len,
+				unsigned char __user * vec);
+asmlinkage long compat_sys_madvise(unsigned long start, size_t len, int behavior);
+asmlinkage long compat_sys_setxattr(const char __user *path, const char __user *name,
+			     const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_lsetxattr(const char __user *path, const char __user *name,
+			      const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_fsetxattr(int fd, const char __user *name,
+			      const void __user *value, size_t size, int flags);
+asmlinkage long compat_sys_getdents64(unsigned int fd,
+				struct linux_dirent64 __user *dirent,
+				unsigned int count);
+asmlinkage long compat_sys_getxattr(const char __user *path, const char __user *name,
+			     void __user *value, size_t size);
+asmlinkage long compat_sys_lgetxattr(const char __user *path, const char __user *name,
+			      void __user *value, size_t size);
+asmlinkage long compat_sys_fgetxattr(int fd, const char __user *name,
+			      void __user *value, size_t size);
+asmlinkage long compat_sys_listxattr(const char __user *path, char __user *list,
+			      size_t size);
+asmlinkage long compat_sys_llistxattr(const char __user *path, char __user *list,
+			       size_t size);
+asmlinkage long compat_sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long compat_sys_listxattr(const char __user *path, char __user *list,
+			      size_t size);
+asmlinkage long compat_sys_llistxattr(const char __user *path, char __user *list,
+			       size_t size);
+asmlinkage long compat_sys_flistxattr(int fd, char __user *list, size_t size);
+asmlinkage long compat_sys_removexattr(const char __user *path,
+				const char __user *name);
+asmlinkage long compat_sys_lremovexattr(const char __user *path,
+				 const char __user *name);
+asmlinkage long compat_sys_fremovexattr(int fd, const char __user *name);
+asmlinkage long compat_sys_set_tid_address(int __user *tidptr);
+asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
+				struct epoll_event __user *event);
+asmlinkage long compat_sys_epoll_wait(int epfd, struct epoll_event __user *events,
+				int maxevents, int timeout);
+asmlinkage long compat_sys_io_destroy(aio_context_t ctx);
+asmlinkage long compat_sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb,
+			      struct io_event __user *result);
+asmlinkage long compat_sys_mq_unlink(const char __user *name);
+asmlinkage long compat_sys_add_key(const char __user *_type,
+			    const char __user *_description,
+			    const void __user *_payload,
+			    size_t plen,
+			    key_serial_t destringid);
+asmlinkage long compat_sys_request_key(const char __user *_type,
+				const char __user *_description,
+				const char __user *_callout_info,
+				key_serial_t destringid);
+asmlinkage long compat_sys_remap_file_pages(unsigned long start, unsigned long size,
+			unsigned long prot, unsigned long pgoff,
+			unsigned long flags);
+asmlinkage long compat_sys_inotify_add_watch(int fd, const char __user *path,
+					u32 mask);
+asmlinkage long compat_sys_mknodat(int dfd, const char __user * filename, umode_t mode,
+			    unsigned dev);
+asmlinkage long compat_sys_mkdirat(int dfd, const char __user * pathname, umode_t mode);
+asmlinkage long compat_sys_fchownat(int dfd, const char __user *filename, uid_t user,
+			     gid_t group, int flag);
+asmlinkage long compat_sys_unlinkat(int dfd, const char __user * pathname, int flag);
+asmlinkage long compat_sys_renameat(int olddfd, const char __user * oldname,
+			     int newdfd, const char __user * newname);
+asmlinkage long compat_sys_symlinkat(const char __user * oldname,
+			      int newdfd, const char __user * newname);
+asmlinkage long compat_sys_linkat(int olddfd, const char __user *oldname,
+			   int newdfd, const char __user *newname, int flags);
+asmlinkage long compat_sys_readlinkat(int dfd, const char __user *path, char __user *buf,
+			       int bufsiz);
+asmlinkage long compat_sys_fchmodat(int dfd, const char __user * filename,
+			     umode_t mode);
+asmlinkage long compat_sys_faccessat(int dfd, const char __user *filename, int mode);
+asmlinkage long compat_sys_unshare(unsigned long unshare_flags);
+asmlinkage long compat_sys_splice(int fd_in, loff_t __user *off_in,
+			   int fd_out, loff_t __user *off_out,
+			   size_t len, unsigned int flags);
+asmlinkage long compat_sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
+asmlinkage long compat_sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
+asmlinkage long compat_sys_pipe2(int __user *fildes, int flags);
+asmlinkage long compat_sys_perf_event_open(
+		struct perf_event_attr __user *attr_uptr,
+		pid_t pid, int cpu, int group_fd, unsigned long flags);
+
+#ifdef CONFIG_CLONE_BACKWARDS
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int __user *, unsigned long,
+	       int __user *);
+#else
+#ifdef CONFIG_CLONE_BACKWARDS3
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int, int __user *,
+			  int __user *, unsigned long);
+#else
+asmlinkage long compat_sys_clone(unsigned long, unsigned long, int __user *,
+	       int __user *, unsigned long);
+#endif
+#endif
+
+asmlinkage long compat_sys_prlimit64(pid_t pid, unsigned int resource,
+				const struct rlimit64 __user *new_rlim,
+				struct rlimit64 __user *old_rlim);
+asmlinkage long compat_sys_name_to_handle_at(int dfd, const char __user *name,
+				      struct file_handle __user *handle,
+				      int __user *mnt_id, int flag);
+asmlinkage long compat_sys_kcmp(pid_t pid1, pid_t pid2, int type,
+			 unsigned long idx1, unsigned long idx2);
+asmlinkage long compat_sys_finit_module(int fd, const char __user *uargs, int flags);
+asmlinkage long compat_sys_sched_setattr(pid_t pid,
+					struct sched_attr __user *attr,
+					unsigned int flags);
+asmlinkage long compat_sys_sched_getattr(pid_t pid,
+					struct sched_attr __user *attr,
+					unsigned int size,
+					unsigned int flags);
+asmlinkage long compat_sys_renameat2(int olddfd, const char __user *oldname,
+			      int newdfd, const char __user *newname,
+			      unsigned int flags);
+asmlinkage long compat_sys_seccomp(unsigned int op, unsigned int flags,
+			    const char __user *uargs);
+asmlinkage long compat_sys_getrandom(char __user *buf, size_t count,
+			      unsigned int flags);
+asmlinkage long compat_sys_memfd_create(const char __user *uname_ptr, unsigned int flags);
+asmlinkage long compat_sys_bpf(int cmd, union bpf_attr *attr, unsigned int size);
+asmlinkage long compat_sys_socketpair(int, int, int, int __user *);
+asmlinkage long compat_sys_bind(int, struct sockaddr __user *, int);
+asmlinkage long compat_sys_connect(int, struct sockaddr __user *, int);
+asmlinkage long compat_sys_accept4(int, struct sockaddr __user *, int __user *, int);
+asmlinkage long compat_sys_getsockname(int, struct sockaddr __user *, int __user *);
+asmlinkage long compat_sys_getpeername(int, struct sockaddr __user *, int __user *);
+asmlinkage long compat_sys_sendto(int, void __user *, size_t, unsigned,
+				struct sockaddr __user *, int);
+asmlinkage long compat_sys_mlock2(unsigned long start, size_t len, int flags);
+
 #else
 
 #define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 8c99a45..fdf689b 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -24,28 +24,28 @@ asmlinkage long sys_ni_syscall(void)
 #define cond_syscall_wrapped	cond_syscall
 #endif
 
-cond_syscall(sys_quotactl);
+cond_syscall_wrapped(sys_quotactl);
 cond_syscall(sys32_quotactl);
-cond_syscall(sys_acct);
+cond_syscall_wrapped(sys_acct);
 cond_syscall(sys_lookup_dcookie);
 cond_syscall(compat_sys_lookup_dcookie);
-cond_syscall(sys_swapon);
-cond_syscall(sys_swapoff);
+cond_syscall_wrapped(sys_swapon);
+cond_syscall_wrapped(sys_swapoff);
 cond_syscall(sys_kexec_load);
 cond_syscall(compat_sys_kexec_load);
 cond_syscall(sys_kexec_file_load);
-cond_syscall(sys_init_module);
-cond_syscall(sys_finit_module);
-cond_syscall(sys_delete_module);
-cond_syscall(sys_socketpair);
-cond_syscall(sys_bind);
+cond_syscall_wrapped(sys_init_module);
+cond_syscall_wrapped(sys_finit_module);
+cond_syscall_wrapped(sys_delete_module);
+cond_syscall_wrapped(sys_socketpair);
+cond_syscall_wrapped(sys_bind);
 cond_syscall(sys_listen);
 cond_syscall(sys_accept);
-cond_syscall(sys_accept4);
-cond_syscall(sys_connect);
-cond_syscall(sys_getsockname);
-cond_syscall(sys_getpeername);
-cond_syscall(sys_sendto);
+cond_syscall_wrapped(sys_accept4);
+cond_syscall_wrapped(sys_connect);
+cond_syscall_wrapped(sys_getsockname);
+cond_syscall_wrapped(sys_getpeername);
+cond_syscall_wrapped(sys_sendto);
 cond_syscall(sys_send);
 cond_syscall(sys_recvfrom);
 cond_syscall(sys_recv);
@@ -74,8 +74,8 @@ cond_syscall(sys_get_robust_list);
 cond_syscall(compat_sys_get_robust_list);
 cond_syscall(sys_epoll_create);
 cond_syscall(sys_epoll_create1);
-cond_syscall(sys_epoll_ctl);
-cond_syscall(sys_epoll_wait);
+cond_syscall_wrapped(sys_epoll_ctl);
+cond_syscall_wrapped(sys_epoll_wait);
 cond_syscall(sys_epoll_pwait);
 cond_syscall(compat_sys_epoll_pwait);
 cond_syscall(sys_semget);
@@ -98,7 +98,7 @@ cond_syscall(sys_shmdt);
 cond_syscall(sys_shmctl);
 cond_syscall(compat_sys_shmctl);
 cond_syscall(sys_mq_open);
-cond_syscall(sys_mq_unlink);
+cond_syscall_wrapped(sys_mq_unlink);
 cond_syscall(sys_mq_timedsend);
 cond_syscall(sys_mq_timedreceive);
 cond_syscall(sys_mq_notify);
@@ -114,14 +114,14 @@ cond_syscall(sys_set_mempolicy);
 cond_syscall(compat_sys_mbind);
 cond_syscall(compat_sys_get_mempolicy);
 cond_syscall(compat_sys_set_mempolicy);
-cond_syscall(sys_add_key);
-cond_syscall(sys_request_key);
+cond_syscall_wrapped(sys_add_key);
+cond_syscall_wrapped(sys_request_key);
 cond_syscall(sys_keyctl);
 cond_syscall(compat_sys_keyctl);
 cond_syscall(compat_sys_socketcall);
 cond_syscall(sys_inotify_init);
 cond_syscall(sys_inotify_init1);
-cond_syscall(sys_inotify_add_watch);
+cond_syscall_wrapped(sys_inotify_add_watch);
 cond_syscall(sys_inotify_rm_watch);
 cond_syscall(sys_migrate_pages);
 cond_syscall(sys_move_pages);
@@ -154,12 +154,12 @@ cond_syscall(compat_sys_ipc);
 cond_syscall(compat_sys_sysctl);
 cond_syscall(sys_flock);
 cond_syscall(sys_io_setup);
-cond_syscall(sys_io_destroy);
+cond_syscall_wrapped(sys_io_destroy);
 cond_syscall(sys_io_submit);
-cond_syscall(sys_io_cancel);
+cond_syscall_wrapped(sys_io_cancel);
 cond_syscall(sys_io_getevents);
-cond_syscall(sys_sysfs);
-cond_syscall(sys_syslog);
+cond_syscall_wrapped(sys_sysfs);
+cond_syscall_wrapped(sys_syslog);
 cond_syscall(sys_process_vm_readv);
 cond_syscall(sys_process_vm_writev);
 cond_syscall(compat_sys_process_vm_readv);
@@ -173,15 +173,15 @@ cond_syscall(sys_setregid);
 cond_syscall(sys_setgid);
 cond_syscall(sys_setreuid);
 cond_syscall(sys_setresuid);
-cond_syscall(sys_getresuid);
+cond_syscall_wrapped(sys_getresuid);
 cond_syscall(sys_setresgid);
-cond_syscall(sys_getresgid);
-cond_syscall(sys_setgroups);
-cond_syscall(sys_getgroups);
+cond_syscall_wrapped(sys_getresgid);
+cond_syscall_wrapped(sys_setgroups);
+cond_syscall_wrapped(sys_getgroups);
 cond_syscall(sys_setfsuid);
 cond_syscall(sys_setfsgid);
-cond_syscall(sys_capget);
-cond_syscall(sys_capset);
+cond_syscall_wrapped(sys_capget);
+cond_syscall_wrapped(sys_capset);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
@@ -192,26 +192,26 @@ cond_syscall(ppc_rtas);
 cond_syscall(sys_spu_run);
 cond_syscall(sys_spu_create);
 cond_syscall(sys_subpage_prot);
-cond_syscall(sys_s390_pci_mmio_read);
-cond_syscall(sys_s390_pci_mmio_write);
+cond_syscall_wrapped(sys_s390_pci_mmio_read);
+cond_syscall_wrapped(sys_s390_pci_mmio_write);
 
 /* mmu depending weak syscall entries */
-cond_syscall(sys_mprotect);
-cond_syscall(sys_msync);
-cond_syscall(sys_mlock);
-cond_syscall(sys_munlock);
+cond_syscall_wrapped(sys_mprotect);
+cond_syscall_wrapped(sys_msync);
+cond_syscall_wrapped(sys_mlock);
+cond_syscall_wrapped(sys_munlock);
 cond_syscall(sys_mlockall);
 cond_syscall(sys_munlockall);
-cond_syscall(sys_mlock2);
-cond_syscall(sys_mincore);
-cond_syscall(sys_madvise);
-cond_syscall(sys_mremap);
-cond_syscall(sys_remap_file_pages);
+cond_syscall_wrapped(sys_mlock2);
+cond_syscall_wrapped(sys_mincore);
+cond_syscall_wrapped(sys_madvise);
+cond_syscall_wrapped(sys_mremap);
+cond_syscall_wrapped(sys_remap_file_pages);
 cond_syscall(compat_sys_move_pages);
 cond_syscall(compat_sys_migrate_pages);
 
 /* block-layer dependent */
-cond_syscall(sys_bdflush);
+cond_syscall_wrapped(sys_bdflush);
 cond_syscall(sys_ioprio_set);
 cond_syscall(sys_ioprio_get);
 
@@ -227,11 +227,11 @@ cond_syscall(compat_sys_timerfd_settime);
 cond_syscall(compat_sys_timerfd_gettime);
 cond_syscall(sys_eventfd);
 cond_syscall(sys_eventfd2);
-cond_syscall(sys_memfd_create);
+cond_syscall_wrapped(sys_memfd_create);
 cond_syscall(sys_userfaultfd);
 
 /* performance counters: */
-cond_syscall(sys_perf_event_open);
+cond_syscall_wrapped(sys_perf_event_open);
 
 /* fanotify! */
 cond_syscall(sys_fanotify_init);
@@ -239,18 +239,18 @@ cond_syscall(sys_fanotify_mark);
 cond_syscall(compat_sys_fanotify_mark);
 
 /* open by handle */
-cond_syscall(sys_name_to_handle_at);
+cond_syscall_wrapped(sys_name_to_handle_at);
 cond_syscall(sys_open_by_handle_at);
 cond_syscall(compat_sys_open_by_handle_at);
 
 /* compare kernel pointers */
-cond_syscall(sys_kcmp);
+cond_syscall_wrapped(sys_kcmp);
 
 /* operate on Secure Computing state */
-cond_syscall(sys_seccomp);
+cond_syscall_wrapped(sys_seccomp);
 
 /* access BPF programs and maps */
-cond_syscall(sys_bpf);
+cond_syscall_wrapped(sys_bpf);
 
 /* execveat */
 cond_syscall(sys_execveat);
-- 
2.5.0

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

* [PATCH 3/5] all: s390: redefine wrappers in generic code
  2016-01-25 16:57 ` Yury Norov
  (?)
@ 2016-01-25 16:57   ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

With new COMPAT_SYSCALL_WRAPx macro, we declare both sys_foo(),
and compat_sys_foo() system calls. The later clears top halves of 64-bit
registers to eliminate possible damage from garbage there.

With the only exception (handled in next patch), this is mechanical work.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/kernel/Makefile         |   2 +-
 arch/s390/kernel/compat_wrapper.c | 128 ----------------------
 arch/s390/pci/pci_mmio.c          |   5 +-
 drivers/char/random.c             |   3 +-
 fs/aio.c                          |   4 +-
 fs/buffer.c                       |   3 +-
 fs/dcache.c                       |   3 +-
 fs/eventpoll.c                    |   4 +-
 fs/exec.c                         |   2 +-
 fs/fhandle.c                      |   3 +-
 fs/filesystems.c                  |   3 +-
 fs/namei.c                        |  29 ++---
 fs/namespace.c                    |   7 +-
 fs/notify/inotify/inotify_user.c  |   3 +-
 fs/open.c                         |  20 ++--
 fs/pipe.c                         |   5 +-
 fs/quota/quota.c                  |   3 +-
 fs/read_write.c                   |   2 +-
 fs/select.c                       |   3 +-
 fs/splice.c                       |   4 +-
 fs/stat.c                         |   5 +-
 fs/xattr.c                        |  25 ++---
 include/uapi/asm-generic/unistd.h | 220 +++++++++++++++++++-------------------
 ipc/mqueue.c                      |   3 +-
 kernel/acct.c                     |   3 +-
 kernel/bpf/syscall.c              |   3 +-
 kernel/capability.c               |   5 +-
 kernel/events/core.c              |   2 +-
 kernel/fork.c                     |  12 +--
 kernel/groups.c                   |   5 +-
 kernel/kcmp.c                     |   3 +-
 kernel/module.c                   |   7 +-
 kernel/printk/printk.c            |   3 +-
 kernel/reboot.c                   |   3 +-
 kernel/sched/core.c               |  11 +-
 kernel/seccomp.c                  |   2 +-
 kernel/signal.c                   |   6 +-
 kernel/sys.c                      |  16 +--
 mm/madvise.c                      |   3 +-
 mm/mincore.c                      |   3 +-
 mm/mlock.c                        |   7 +-
 mm/mmap.c                         |   7 +-
 mm/mprotect.c                     |   3 +-
 mm/mremap.c                       |   3 +-
 mm/msync.c                        |   3 +-
 mm/nommu.c                        |   7 +-
 mm/shmem.c                        |   3 +-
 mm/swapfile.c                     |   5 +-
 net/socket.c                      |  14 +--
 security/keys/keyctl.c            |   5 +-
 50 files changed, 270 insertions(+), 363 deletions(-)
 delete mode 100644 arch/s390/kernel/compat_wrapper.c

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index dc167a2..185cd88 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -55,7 +55,7 @@ obj-$(CONFIG_HIBERNATION)	+= suspend.o swsusp.o
 obj-$(CONFIG_AUDIT)		+= audit.o
 compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
 obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o
-obj-$(CONFIG_COMPAT)		+= compat_wrapper.o $(compat-obj-y)
+obj-$(CONFIG_COMPAT)		+= $(compat-obj-y)
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c
deleted file mode 100644
index 527f75d..0000000
--- a/arch/s390/kernel/compat_wrapper.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *  Compat system call wrappers.
- *
- *    Copyright IBM Corp. 2014
- */
-
-#include <linux/syscalls.h>
-#include <linux/compat.h>
-#include "entry.h"
-
-COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
-COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
-COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
-COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
-COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
-COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
-COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
-COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
-COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
-COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
-COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk);
-COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
-COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
-COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
-COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask);
-COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
-COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
-COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
-COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
-COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
-COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
-COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len);
-COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
-COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
-COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
-COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
-COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot);
-COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs);
-COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
-COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data);
-COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2);
-COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence);
-COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags);
-COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len);
-COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len);
-COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr);
-COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout);
-COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5);
-COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size);
-COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr);
-COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data);
-COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group);
-COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist);
-COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist);
-COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid);
-COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid);
-COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group);
-COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old);
-COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec);
-COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior);
-COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count);
-COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name);
-COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr);
-COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event);
-COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout);
-COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx);
-COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result);
-COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name);
-COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id);
-COMPAT_SYSCALL_WRAP4(request_key, const char __user *, tp, const char __user *, dsc, const char __user *, info, key_serial_t, id);
-COMPAT_SYSCALL_WRAP5(remap_file_pages, unsigned long, start, unsigned long, size, unsigned long, prot, unsigned long, pgoff, unsigned long, flags);
-COMPAT_SYSCALL_WRAP3(inotify_add_watch, int, fd, const char __user *, path, u32, mask);
-COMPAT_SYSCALL_WRAP3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, unsigned, dev);
-COMPAT_SYSCALL_WRAP5(fchownat, int, dfd, const char __user *, filename, uid_t, user, gid_t, group, int, flag);
-COMPAT_SYSCALL_WRAP3(unlinkat, int, dfd, const char __user *, pathname, int, flag);
-COMPAT_SYSCALL_WRAP4(renameat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname);
-COMPAT_SYSCALL_WRAP5(linkat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, int, flags);
-COMPAT_SYSCALL_WRAP3(symlinkat, const char __user *, oldname, int, newdfd, const char __user *, newname);
-COMPAT_SYSCALL_WRAP4(readlinkat, int, dfd, const char __user *, path, char __user *, buf, int, bufsiz);
-COMPAT_SYSCALL_WRAP3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode);
-COMPAT_SYSCALL_WRAP3(faccessat, int, dfd, const char __user *, filename, int, mode);
-COMPAT_SYSCALL_WRAP1(unshare, unsigned long, unshare_flags);
-COMPAT_SYSCALL_WRAP6(splice, int, fd_in, loff_t __user *, off_in, int, fd_out, loff_t __user *, off_out, size_t, len, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags);
-COMPAT_SYSCALL_WRAP3(getcpu, unsigned __user *, cpu, unsigned __user *, node, struct getcpu_cache __user *, cache);
-COMPAT_SYSCALL_WRAP2(pipe2, int __user *, fildes, int, flags);
-COMPAT_SYSCALL_WRAP5(perf_event_open, struct perf_event_attr __user *, attr_uptr, pid_t, pid, int, cpu, int, group_fd, unsigned long, flags);
-COMPAT_SYSCALL_WRAP5(clone, unsigned long, newsp, unsigned long, clone_flags, int __user *, parent_tidptr, int __user *, child_tidptr, unsigned long, tls);
-COMPAT_SYSCALL_WRAP4(prlimit64, pid_t, pid, unsigned int, resource, const struct rlimit64 __user *, new_rlim, struct rlimit64 __user *, old_rlim);
-COMPAT_SYSCALL_WRAP5(name_to_handle_at, int, dfd, const char __user *, name, struct file_handle __user *, handle, int __user *, mnt_id, int, flag);
-COMPAT_SYSCALL_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, idx1, unsigned long, idx2);
-COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags);
-COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags);
-COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags);
-COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char __user *, uargs)
-COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags)
-COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags)
-COMPAT_SYSCALL_WRAP3(bpf, int, cmd, union bpf_attr *, attr, unsigned int, size);
-COMPAT_SYSCALL_WRAP3(s390_pci_mmio_write, const unsigned long, mmio_addr, const void __user *, user_buffer, const size_t, length);
-COMPAT_SYSCALL_WRAP3(s390_pci_mmio_read, const unsigned long, mmio_addr, void __user *, user_buffer, const size_t, length);
-COMPAT_SYSCALL_WRAP4(socketpair, int, family, int, type, int, protocol, int __user *, usockvec);
-COMPAT_SYSCALL_WRAP3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen);
-COMPAT_SYSCALL_WRAP3(connect, int, fd, struct sockaddr __user *, uservaddr, int, addrlen);
-COMPAT_SYSCALL_WRAP4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, int __user *, upeer_addrlen, int, flags);
-COMPAT_SYSCALL_WRAP3(getsockname, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
-COMPAT_SYSCALL_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
-COMPAT_SYSCALL_WRAP6(sendto, int, fd, void __user *, buff, size_t, len, unsigned int, flags, struct sockaddr __user *, addr, int, addr_len);
-COMPAT_SYSCALL_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags);
diff --git a/arch/s390/pci/pci_mmio.c b/arch/s390/pci/pci_mmio.c
index b1bb2b7..3627070 100644
--- a/arch/s390/pci/pci_mmio.c
+++ b/arch/s390/pci/pci_mmio.c
@@ -6,6 +6,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
@@ -31,7 +32,7 @@ out:
 	return ret;
 }
 
-SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
+SYSCALL_DEFINE_WRAP3(s390_pci_mmio_write, unsigned long, mmio_addr,
 		const void __user *, user_buffer, size_t, length)
 {
 	u8 local_buf[64];
@@ -71,7 +72,7 @@ out:
 	return ret;
 }
 
-SYSCALL_DEFINE3(s390_pci_mmio_read, unsigned long, mmio_addr,
+SYSCALL_DEFINE_WRAP3(s390_pci_mmio_read, unsigned long, mmio_addr,
 		void __user *, user_buffer, size_t, length)
 {
 	u8 local_buf[64];
diff --git a/drivers/char/random.c b/drivers/char/random.c
index d0da5d8..4484cad 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -259,6 +259,7 @@
 #include <linux/workqueue.h>
 #include <linux/irq.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/completion.h>
 
 #include <asm/processor.h>
@@ -1598,7 +1599,7 @@ const struct file_operations urandom_fops = {
 	.llseek = noop_llseek,
 };
 
-SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count,
+SYSCALL_DEFINE_WRAP3(getrandom, char __user *, buf, size_t, count,
 		unsigned int, flags)
 {
 	if (flags & ~(GRND_NONBLOCK|GRND_RANDOM))
diff --git a/fs/aio.c b/fs/aio.c
index 155f842..c6d1e70 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1349,7 +1349,7 @@ out:
  *	implemented.  May fail with -EINVAL if the context pointed to
  *	is invalid.
  */
-SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
+SYSCALL_DEFINE_WRAP1(io_destroy, aio_context_t, ctx)
 {
 	struct kioctx *ioctx = lookup_ioctx(ctx);
 	if (likely(NULL != ioctx)) {
@@ -1671,7 +1671,7 @@ lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, u32 key)
  *	invalid.  May fail with -EAGAIN if the iocb specified was not
  *	cancelled.  Will fail with -ENOSYS if not implemented.
  */
-SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
+SYSCALL_DEFINE_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
 		struct io_event __user *, result)
 {
 	struct kioctx *ctx;
diff --git a/fs/buffer.c b/fs/buffer.c
index 4f4cd95..394a365 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -20,6 +20,7 @@
 
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/percpu.h>
@@ -3267,7 +3268,7 @@ EXPORT_SYMBOL(try_to_free_buffers);
  * Use of bdflush() is deprecated and will be removed in a future kernel.
  * The `flush-X' kernel threads fully replace bdflush daemons and this call.
  */
-SYSCALL_DEFINE2(bdflush, int, func, long, data)
+SYSCALL_DEFINE_WRAP2(bdflush, int, func, long, data)
 {
 	static int msg_count;
 
diff --git a/fs/dcache.c b/fs/dcache.c
index 5c33aeb..6a83cc5 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -15,6 +15,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
@@ -3244,7 +3245,7 @@ static void get_fs_root_and_pwd_rcu(struct fs_struct *fs, struct path *root,
  *		return NULL;
  *	}
  */
-SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
+SYSCALL_DEFINE_WRAP2(getcwd, char __user *, buf, unsigned long, size)
 {
 	int error;
 	struct path pwd, root;
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 1e009ca..01348a2 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1817,7 +1817,7 @@ SYSCALL_DEFINE1(epoll_create, int, size)
  * the eventpoll file that enables the insertion/removal/change of
  * file descriptors inside the interest set.
  */
-SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
+SYSCALL_DEFINE_WRAP4(epoll_ctl, int, epfd, int, op, int, fd,
 		struct epoll_event __user *, event)
 {
 	int error;
@@ -1958,7 +1958,7 @@ error_return:
  * Implement the event wait interface for the eventpoll file. It is the kernel
  * part of the user space epoll_wait(2).
  */
-SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
+SYSCALL_DEFINE_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events,
 		int, maxevents, int, timeout)
 {
 	int error;
diff --git a/fs/exec.c b/fs/exec.c
index b06623a..2e43e47 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -111,7 +111,7 @@ bool path_noexec(const struct path *path)
  *
  * Also note that we take the address to load from from the file itself.
  */
-SYSCALL_DEFINE1(uselib, const char __user *, library)
+SYSCALL_DEFINE_WRAP1(uselib, const char __user *, library)
 {
 	struct linux_binfmt *fmt;
 	struct file *file;
diff --git a/fs/fhandle.c b/fs/fhandle.c
index d59712d..048a4ee 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -1,4 +1,5 @@
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/file.h>
@@ -89,7 +90,7 @@ static long do_sys_name_to_handle(struct path *path,
  * enough space, the field is updated to return the minimum
  * value required.
  */
-SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
+SYSCALL_DEFINE_WRAP5(name_to_handle_at, int, dfd, const char __user *, name,
 		struct file_handle __user *, handle, int __user *, mnt_id,
 		int, flag)
 {
diff --git a/fs/filesystems.c b/fs/filesystems.c
index 5797d45..6fcbe18 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -181,7 +182,7 @@ static int fs_maxindex(void)
 /*
  * Whee.. Weird sysv syscall. 
  */
-SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
+SYSCALL_DEFINE_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
 {
 	int retval = -EINVAL;
 
diff --git a/fs/namei.c b/fs/namei.c
index 0c3974c..6ded831 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -26,6 +26,7 @@
 #include <linux/security.h>
 #include <linux/ima.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mount.h>
 #include <linux/audit.h>
 #include <linux/capability.h>
@@ -3533,7 +3534,7 @@ static int may_mknod(umode_t mode)
 	}
 }
 
-SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
+SYSCALL_DEFINE_WRAP4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
 		unsigned, dev)
 {
 	struct dentry *dentry;
@@ -3575,7 +3576,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
+SYSCALL_DEFINE_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
 {
 	return sys_mknodat(AT_FDCWD, filename, mode, dev);
 }
@@ -3606,7 +3607,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 }
 EXPORT_SYMBOL(vfs_mkdir);
 
-SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
 {
 	struct dentry *dentry;
 	struct path path;
@@ -3631,7 +3632,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(mkdir, const char __user *, pathname, umode_t, mode)
 {
 	return sys_mkdirat(AT_FDCWD, pathname, mode);
 }
@@ -3759,7 +3760,7 @@ exit1:
 	return error;
 }
 
-SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
+SYSCALL_DEFINE_WRAP1(rmdir, const char __user *, pathname)
 {
 	return do_rmdir(AT_FDCWD, pathname);
 }
@@ -3901,7 +3902,7 @@ slashes:
 	goto exit2;
 }
 
-SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
+SYSCALL_DEFINE_WRAP3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
 {
 	if ((flag & ~AT_REMOVEDIR) != 0)
 		return -EINVAL;
@@ -3912,7 +3913,7 @@ SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
 	return do_unlinkat(dfd, pathname);
 }
 
-SYSCALL_DEFINE1(unlink, const char __user *, pathname)
+SYSCALL_DEFINE_WRAP1(unlink, const char __user *, pathname)
 {
 	return do_unlinkat(AT_FDCWD, pathname);
 }
@@ -3938,7 +3939,7 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
 }
 EXPORT_SYMBOL(vfs_symlink);
 
-SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP3(symlinkat, const char __user *, oldname,
 		int, newdfd, const char __user *, newname)
 {
 	int error;
@@ -3969,7 +3970,7 @@ out_putname:
 	return error;
 }
 
-SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(symlink, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_symlinkat(oldname, AT_FDCWD, newname);
 }
@@ -4056,7 +4057,7 @@ EXPORT_SYMBOL(vfs_link);
  * with linux 2.0, and to avoid hard-linking to directories
  * and other special files.  --ADM
  */
-SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP5(linkat, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname, int, flags)
 {
 	struct dentry *new_dentry;
@@ -4121,7 +4122,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(link, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
@@ -4309,7 +4310,7 @@ out:
 }
 EXPORT_SYMBOL(vfs_rename);
 
-SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP5(renameat2, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname, unsigned int, flags)
 {
 	struct dentry *old_dentry, *new_dentry;
@@ -4452,13 +4453,13 @@ exit:
 	return error;
 }
 
-SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP4(renameat, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname)
 {
 	return sys_renameat2(olddfd, oldname, newdfd, newname, 0);
 }
 
-SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(rename, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_renameat2(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..6ba4afd 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/capability.h>
 #include <linux/mnt_namespace.h>
@@ -1592,7 +1593,7 @@ static inline bool may_mount(void)
  * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD
  */
 
-SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
+SYSCALL_DEFINE_WRAP2(umount, char __user *, name, int, flags)
 {
 	struct path path;
 	struct mount *mnt;
@@ -1637,7 +1638,7 @@ out:
 /*
  *	The 2.0 compatible umount. No flags.
  */
-SYSCALL_DEFINE1(oldumount, char __user *, name)
+SYSCALL_DEFINE_WRAP1(oldumount, char __user *, name)
 {
 	return sys_umount(name, 0);
 }
@@ -2974,7 +2975,7 @@ EXPORT_SYMBOL(path_is_under);
  *    though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
  *    first.
  */
-SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+SYSCALL_DEFINE_WRAP2(pivot_root, const char __user *, new_root,
 		const char __user *, put_old)
 {
 	struct path new, old, parent_path, root_parent, root;
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index b8d08d0..713a670 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -33,6 +33,7 @@
 #include <linux/sched.h> /* struct user */
 #include <linux/slab.h> /* struct kmem_cache */
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/types.h>
 #include <linux/anon_inodes.h>
 #include <linux/uaccess.h>
@@ -696,7 +697,7 @@ SYSCALL_DEFINE0(inotify_init)
 	return sys_inotify_init1(0);
 }
 
-SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP3(inotify_add_watch, int, fd, const char __user *, pathname,
 		u32, mask)
 {
 	struct fsnotify_group *group;
diff --git a/fs/open.c b/fs/open.c
index b6f1e96..8dae6c7 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -334,7 +334,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
  * We do this by temporarily clearing all FS-related capabilities and
  * switching the fsuid/fsgid around to the real ones.
  */
-SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
+SYSCALL_DEFINE_WRAP3(faccessat, int, dfd, const char __user *, filename, int, mode)
 {
 	const struct cred *old_cred;
 	struct cred *override_cred;
@@ -410,12 +410,12 @@ out:
 	return res;
 }
 
-SYSCALL_DEFINE2(access, const char __user *, filename, int, mode)
+SYSCALL_DEFINE_WRAP2(access, const char __user *, filename, int, mode)
 {
 	return sys_faccessat(AT_FDCWD, filename, mode);
 }
 
-SYSCALL_DEFINE1(chdir, const char __user *, filename)
+SYSCALL_DEFINE_WRAP1(chdir, const char __user *, filename)
 {
 	struct path path;
 	int error;
@@ -466,7 +466,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE1(chroot, const char __user *, filename)
+SYSCALL_DEFINE_WRAP1(chroot, const char __user *, filename)
 {
 	struct path path;
 	int error;
@@ -541,7 +541,7 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
 	return err;
 }
 
-SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode)
+SYSCALL_DEFINE_WRAP3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode)
 {
 	struct path path;
 	int error;
@@ -559,7 +559,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(chmod, const char __user *, filename, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(chmod, const char __user *, filename, umode_t, mode)
 {
 	return sys_fchmodat(AT_FDCWD, filename, mode);
 }
@@ -606,7 +606,7 @@ retry_deleg:
 	return error;
 }
 
-SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
+SYSCALL_DEFINE_WRAP5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
 		gid_t, group, int, flag)
 {
 	struct path path;
@@ -638,12 +638,12 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
+SYSCALL_DEFINE_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group)
 {
 	return sys_fchownat(AT_FDCWD, filename, user, group, 0);
 }
 
-SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
+SYSCALL_DEFINE_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
 {
 	return sys_fchownat(AT_FDCWD, filename, user, group,
 			    AT_SYMLINK_NOFOLLOW);
@@ -1058,7 +1058,7 @@ SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
  * For backward compatibility?  Maybe this should be moved
  * into arch/i386 instead?
  */
-SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(creat, const char __user *, pathname, umode_t, mode)
 {
 	return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
 }
diff --git a/fs/pipe.c b/fs/pipe.c
index 42cf8dd..07ce638 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -20,6 +20,7 @@
 #include <linux/pagemap.h>
 #include <linux/audit.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 
 #include <asm/uaccess.h>
@@ -776,7 +777,7 @@ int do_pipe_flags(int *fd, int flags)
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
  */
-SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
+SYSCALL_DEFINE_WRAP2(pipe2, int __user *, fildes, int, flags)
 {
 	struct file *files[2];
 	int fd[2];
@@ -798,7 +799,7 @@ SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
 	return error;
 }
 
-SYSCALL_DEFINE1(pipe, int __user *, fildes)
+SYSCALL_DEFINE_WRAP1(pipe, int __user *, fildes)
 {
 	return sys_pipe2(fildes, 0);
 }
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 3746367..5738db8 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/capability.h>
 #include <linux/quotaops.h>
 #include <linux/types.h>
@@ -757,7 +758,7 @@ static struct super_block *quotactl_block(const char __user *special, int cmd)
  * calls. Maybe we need to add the process quotas etc. in the future,
  * but we probably should use rlimits for that.
  */
-SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
+SYSCALL_DEFINE_WRAP4(quotactl, unsigned int, cmd, const char __user *, special,
 		qid_t, id, void __user *, addr)
 {
 	uint cmds, type;
diff --git a/fs/read_write.c b/fs/read_write.c
index 819ef3f..7e2b232 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -299,7 +299,7 @@ COMPAT_SYSCALL_DEFINE3(lseek, unsigned int, fd, compat_off_t, offset, unsigned i
 #endif
 
 #ifdef __ARCH_WANT_SYS_LLSEEK
-SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
+SYSCALL_DEFINE_WRAP5(llseek, unsigned int, fd, unsigned long, offset_high,
 		unsigned long, offset_low, loff_t __user *, result,
 		unsigned int, whence)
 {
diff --git a/fs/select.c b/fs/select.c
index 0155473..28e1ca6 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -17,6 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/poll.h>
@@ -954,7 +955,7 @@ static long do_restart_poll(struct restart_block *restart_block)
 	return ret;
 }
 
-SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
+SYSCALL_DEFINE_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
 		int, timeout_msecs)
 {
 	struct timespec end_time, *to = NULL;
diff --git a/fs/splice.c b/fs/splice.c
index 4cf700d..b0ab438 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1683,7 +1683,7 @@ COMPAT_SYSCALL_DEFINE4(vmsplice, int, fd, const struct compat_iovec __user *, io
 }
 #endif
 
-SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in,
+SYSCALL_DEFINE_WRAP6(splice, int, fd_in, loff_t __user *, off_in,
 		int, fd_out, loff_t __user *, off_out,
 		size_t, len, unsigned int, flags)
 {
@@ -2016,7 +2016,7 @@ static long do_tee(struct file *in, struct file *out, size_t len,
 	return ret;
 }
 
-SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
+SYSCALL_DEFINE_WRAP4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
 {
 	struct fd in;
 	int error;
diff --git a/fs/stat.c b/fs/stat.c
index d4a61d8..f4ddfdb 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -13,6 +13,7 @@
 #include <linux/namei.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/pagemap.h>
 
 #include <asm/uaccess.h>
@@ -312,7 +313,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
 	return error;
 }
 
-SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(readlinkat, int, dfd, const char __user *, pathname,
 		char __user *, buf, int, bufsiz)
 {
 	struct path path;
@@ -346,7 +347,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf,
+SYSCALL_DEFINE_WRAP3(readlink, const char __user *, path, char __user *, buf,
 		int, bufsiz)
 {
 	return sys_readlinkat(AT_FDCWD, path, buf, bufsiz);
diff --git a/fs/xattr.c b/fs/xattr.c
index 9b932b9..3a7223f 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -16,6 +16,7 @@
 #include <linux/security.h>
 #include <linux/evm.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/fsnotify.h>
 #include <linux/audit.h>
@@ -387,21 +388,21 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE5(setxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP5(setxattr, const char __user *, pathname,
 		const char __user *, name, const void __user *, value,
 		size_t, size, int, flags)
 {
 	return path_setxattr(pathname, name, value, size, flags, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP5(lsetxattr, const char __user *, pathname,
 		const char __user *, name, const void __user *, value,
 		size_t, size, int, flags)
 {
 	return path_setxattr(pathname, name, value, size, flags, 0);
 }
 
-SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
+SYSCALL_DEFINE_WRAP5(fsetxattr, int, fd, const char __user *, name,
 		const void __user *,value, size_t, size, int, flags)
 {
 	struct fd f = fdget(fd);
@@ -487,19 +488,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE4(getxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(getxattr, const char __user *, pathname,
 		const char __user *, name, void __user *, value, size_t, size)
 {
 	return path_getxattr(pathname, name, value, size, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(lgetxattr, const char __user *, pathname,
 		const char __user *, name, void __user *, value, size_t, size)
 {
 	return path_getxattr(pathname, name, value, size, 0);
 }
 
-SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name,
+SYSCALL_DEFINE_WRAP4(fgetxattr, int, fd, const char __user *, name,
 		void __user *, value, size_t, size)
 {
 	struct fd f = fdget(fd);
@@ -569,19 +570,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list,
+SYSCALL_DEFINE_WRAP3(listxattr, const char __user *, pathname, char __user *, list,
 		size_t, size)
 {
 	return path_listxattr(pathname, list, size, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list,
+SYSCALL_DEFINE_WRAP3(llistxattr, const char __user *, pathname, char __user *, list,
 		size_t, size)
 {
 	return path_listxattr(pathname, list, size, 0);
 }
 
-SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size)
+SYSCALL_DEFINE_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size)
 {
 	struct fd f = fdget(fd);
 	ssize_t error = -EBADF;
@@ -634,19 +635,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(removexattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP2(removexattr, const char __user *, pathname,
 		const char __user *, name)
 {
 	return path_removexattr(pathname, name, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP2(lremovexattr, const char __user *, pathname,
 		const char __user *, name)
 {
 	return path_removexattr(pathname, name, 0);
 }
 
-SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name)
+SYSCALL_DEFINE_WRAP2(fremovexattr, int, fd, const char __user *, name)
 {
 	struct fd f = fdget(fd);
 	int error = -EBADF;
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index a8380ad..705d841 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -36,43 +36,43 @@
 #define __NR_io_setup 0
 __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
 #define __NR_io_destroy 1
-__SYSCALL(__NR_io_destroy, sys_io_destroy)
+__SC_WRAP(__NR_io_destroy, sys_io_destroy)
 #define __NR_io_submit 2
 __SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)
 #define __NR_io_cancel 3
-__SYSCALL(__NR_io_cancel, sys_io_cancel)
+__SC_WRAP(__NR_io_cancel, sys_io_cancel)
 #define __NR_io_getevents 4
 __SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents)
 
 /* fs/xattr.c */
 #define __NR_setxattr 5
-__SYSCALL(__NR_setxattr, sys_setxattr)
+__SC_WRAP(__NR_setxattr, sys_setxattr)
 #define __NR_lsetxattr 6
-__SYSCALL(__NR_lsetxattr, sys_lsetxattr)
+__SC_WRAP(__NR_lsetxattr, sys_lsetxattr)
 #define __NR_fsetxattr 7
-__SYSCALL(__NR_fsetxattr, sys_fsetxattr)
+__SC_WRAP(__NR_fsetxattr, sys_fsetxattr)
 #define __NR_getxattr 8
-__SYSCALL(__NR_getxattr, sys_getxattr)
+__SC_WRAP(__NR_getxattr, sys_getxattr)
 #define __NR_lgetxattr 9
-__SYSCALL(__NR_lgetxattr, sys_lgetxattr)
+__SC_WRAP(__NR_lgetxattr, sys_lgetxattr)
 #define __NR_fgetxattr 10
-__SYSCALL(__NR_fgetxattr, sys_fgetxattr)
+__SC_WRAP(__NR_fgetxattr, sys_fgetxattr)
 #define __NR_listxattr 11
-__SYSCALL(__NR_listxattr, sys_listxattr)
+__SC_WRAP(__NR_listxattr, sys_listxattr)
 #define __NR_llistxattr 12
-__SYSCALL(__NR_llistxattr, sys_llistxattr)
+__SC_WRAP(__NR_llistxattr, sys_llistxattr)
 #define __NR_flistxattr 13
-__SYSCALL(__NR_flistxattr, sys_flistxattr)
+__SC_WRAP(__NR_flistxattr, sys_flistxattr)
 #define __NR_removexattr 14
-__SYSCALL(__NR_removexattr, sys_removexattr)
+__SC_WRAP(__NR_removexattr, sys_removexattr)
 #define __NR_lremovexattr 15
-__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
+__SC_WRAP(__NR_lremovexattr, sys_lremovexattr)
 #define __NR_fremovexattr 16
-__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
+__SC_WRAP(__NR_fremovexattr, sys_fremovexattr)
 
 /* fs/dcache.c */
 #define __NR_getcwd 17
-__SYSCALL(__NR_getcwd, sys_getcwd)
+__SC_WRAP(__NR_getcwd, sys_getcwd)
 
 /* fs/cookies.c */
 #define __NR_lookup_dcookie 18
@@ -86,7 +86,7 @@ __SYSCALL(__NR_eventfd2, sys_eventfd2)
 #define __NR_epoll_create1 20
 __SYSCALL(__NR_epoll_create1, sys_epoll_create1)
 #define __NR_epoll_ctl 21
-__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
+__SC_WRAP(__NR_epoll_ctl, sys_epoll_ctl)
 #define __NR_epoll_pwait 22
 __SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait)
 
@@ -102,7 +102,7 @@ __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
 #define __NR_inotify_init1 26
 __SYSCALL(__NR_inotify_init1, sys_inotify_init1)
 #define __NR_inotify_add_watch 27
-__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
+__SC_WRAP(__NR_inotify_add_watch, sys_inotify_add_watch)
 #define __NR_inotify_rm_watch 28
 __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
 
@@ -122,17 +122,17 @@ __SYSCALL(__NR_flock, sys_flock)
 
 /* fs/namei.c */
 #define __NR_mknodat 33
-__SYSCALL(__NR_mknodat, sys_mknodat)
+__SC_WRAP(__NR_mknodat, sys_mknodat)
 #define __NR_mkdirat 34
-__SYSCALL(__NR_mkdirat, sys_mkdirat)
+__SC_WRAP(__NR_mkdirat, sys_mkdirat)
 #define __NR_unlinkat 35
-__SYSCALL(__NR_unlinkat, sys_unlinkat)
+__SC_WRAP(__NR_unlinkat, sys_unlinkat)
 #define __NR_symlinkat 36
-__SYSCALL(__NR_symlinkat, sys_symlinkat)
+__SC_WRAP(__NR_symlinkat, sys_symlinkat)
 #define __NR_linkat 37
-__SYSCALL(__NR_linkat, sys_linkat)
+__SC_WRAP(__NR_linkat, sys_linkat)
 #define __NR_renameat 38
-__SYSCALL(__NR_renameat, sys_renameat)
+__SC_WRAP(__NR_renameat, sys_renameat)
 
 /* fs/namespace.c */
 #define __NR_umount2 39
@@ -140,7 +140,7 @@ __SYSCALL(__NR_umount2, sys_umount)
 #define __NR_mount 40
 __SC_COMP(__NR_mount, sys_mount, compat_sys_mount)
 #define __NR_pivot_root 41
-__SYSCALL(__NR_pivot_root, sys_pivot_root)
+__SC_WRAP(__NR_pivot_root, sys_pivot_root)
 
 /* fs/nfsctl.c */
 #define __NR_nfsservctl 42
@@ -163,19 +163,19 @@ __SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \
 #define __NR_fallocate 47
 __SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate)
 #define __NR_faccessat 48
-__SYSCALL(__NR_faccessat, sys_faccessat)
+__SC_WRAP(__NR_faccessat, sys_faccessat)
 #define __NR_chdir 49
-__SYSCALL(__NR_chdir, sys_chdir)
+__SC_WRAP(__NR_chdir, sys_chdir)
 #define __NR_fchdir 50
 __SYSCALL(__NR_fchdir, sys_fchdir)
 #define __NR_chroot 51
-__SYSCALL(__NR_chroot, sys_chroot)
+__SC_WRAP(__NR_chroot, sys_chroot)
 #define __NR_fchmod 52
 __SYSCALL(__NR_fchmod, sys_fchmod)
 #define __NR_fchmodat 53
-__SYSCALL(__NR_fchmodat, sys_fchmodat)
+__SC_WRAP(__NR_fchmodat, sys_fchmodat)
 #define __NR_fchownat 54
-__SYSCALL(__NR_fchownat, sys_fchownat)
+__SC_WRAP(__NR_fchownat, sys_fchownat)
 #define __NR_fchown 55
 __SYSCALL(__NR_fchown, sys_fchown)
 #define __NR_openat 56
@@ -187,11 +187,11 @@ __SYSCALL(__NR_vhangup, sys_vhangup)
 
 /* fs/pipe.c */
 #define __NR_pipe2 59
-__SYSCALL(__NR_pipe2, sys_pipe2)
+__SC_WRAP(__NR_pipe2, sys_pipe2)
 
 /* fs/quota.c */
 #define __NR_quotactl 60
-__SYSCALL(__NR_quotactl, sys_quotactl)
+__SC_WRAP(__NR_quotactl, sys_quotactl)
 
 /* fs/readdir.c */
 #define __NR_getdents64 61
@@ -236,13 +236,13 @@ __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4)
 #define __NR_vmsplice 75
 __SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice)
 #define __NR_splice 76
-__SYSCALL(__NR_splice, sys_splice)
+__SC_WRAP(__NR_splice, sys_splice)
 #define __NR_tee 77
-__SYSCALL(__NR_tee, sys_tee)
+__SC_WRAP(__NR_tee, sys_tee)
 
 /* fs/stat.c */
 #define __NR_readlinkat 78
-__SYSCALL(__NR_readlinkat, sys_readlinkat)
+__SC_WRAP(__NR_readlinkat, sys_readlinkat)
 #define __NR3264_fstatat 79
 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
 #define __NR3264_fstat 80
@@ -281,13 +281,13 @@ __SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat)
 
 /* kernel/acct.c */
 #define __NR_acct 89
-__SYSCALL(__NR_acct, sys_acct)
+__SC_WRAP(__NR_acct, sys_acct)
 
 /* kernel/capability.c */
 #define __NR_capget 90
-__SYSCALL(__NR_capget, sys_capget)
+__SC_WRAP(__NR_capget, sys_capget)
 #define __NR_capset 91
-__SYSCALL(__NR_capset, sys_capset)
+__SC_WRAP(__NR_capset, sys_capset)
 
 /* kernel/exec_domain.c */
 #define __NR_personality 92
@@ -303,9 +303,9 @@ __SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid)
 
 /* kernel/fork.c */
 #define __NR_set_tid_address 96
-__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
+__SC_WRAP(__NR_set_tid_address, sys_set_tid_address)
 #define __NR_unshare 97
-__SYSCALL(__NR_unshare, sys_unshare)
+__SC_WRAP(__NR_unshare, sys_unshare)
 
 /* kernel/futex.c */
 #define __NR_futex 98
@@ -333,9 +333,9 @@ __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
 
 /* kernel/module.c */
 #define __NR_init_module 105
-__SYSCALL(__NR_init_module, sys_init_module)
+__SC_WRAP(__NR_init_module, sys_init_module)
 #define __NR_delete_module 106
-__SYSCALL(__NR_delete_module, sys_delete_module)
+__SC_WRAP(__NR_delete_module, sys_delete_module)
 
 /* kernel/posix-timers.c */
 #define __NR_timer_create 107
@@ -360,7 +360,7 @@ __SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \
 
 /* kernel/printk.c */
 #define __NR_syslog 116
-__SYSCALL(__NR_syslog, sys_syslog)
+__SC_WRAP(__NR_syslog, sys_syslog)
 
 /* kernel/ptrace.c */
 #define __NR_ptrace 117
@@ -368,13 +368,13 @@ __SYSCALL(__NR_ptrace, sys_ptrace)
 
 /* kernel/sched/core.c */
 #define __NR_sched_setparam 118
-__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
+__SC_WRAP(__NR_sched_setparam, sys_sched_setparam)
 #define __NR_sched_setscheduler 119
-__SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler)
+__SC_WRAP(__NR_sched_setscheduler, sys_sched_setscheduler)
 #define __NR_sched_getscheduler 120
 __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler)
 #define __NR_sched_getparam 121
-__SYSCALL(__NR_sched_getparam, sys_sched_getparam)
+__SC_WRAP(__NR_sched_getparam, sys_sched_getparam)
 #define __NR_sched_setaffinity 122
 __SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \
 	  compat_sys_sched_setaffinity)
@@ -425,7 +425,7 @@ __SYSCALL(__NR_setpriority, sys_setpriority)
 #define __NR_getpriority 141
 __SYSCALL(__NR_getpriority, sys_getpriority)
 #define __NR_reboot 142
-__SYSCALL(__NR_reboot, sys_reboot)
+__SC_WRAP(__NR_reboot, sys_reboot)
 #define __NR_setregid 143
 __SYSCALL(__NR_setregid, sys_setregid)
 #define __NR_setgid 144
@@ -437,11 +437,11 @@ __SYSCALL(__NR_setuid, sys_setuid)
 #define __NR_setresuid 147
 __SYSCALL(__NR_setresuid, sys_setresuid)
 #define __NR_getresuid 148
-__SYSCALL(__NR_getresuid, sys_getresuid)
+__SC_WRAP(__NR_getresuid, sys_getresuid)
 #define __NR_setresgid 149
 __SYSCALL(__NR_setresgid, sys_setresgid)
 #define __NR_getresgid 150
-__SYSCALL(__NR_getresgid, sys_getresgid)
+__SC_WRAP(__NR_getresgid, sys_getresgid)
 #define __NR_setfsuid 151
 __SYSCALL(__NR_setfsuid, sys_setfsuid)
 #define __NR_setfsgid 152
@@ -457,15 +457,15 @@ __SYSCALL(__NR_getsid, sys_getsid)
 #define __NR_setsid 157
 __SYSCALL(__NR_setsid, sys_setsid)
 #define __NR_getgroups 158
-__SYSCALL(__NR_getgroups, sys_getgroups)
+__SC_WRAP(__NR_getgroups, sys_getgroups)
 #define __NR_setgroups 159
-__SYSCALL(__NR_setgroups, sys_setgroups)
+__SC_WRAP(__NR_setgroups, sys_setgroups)
 #define __NR_uname 160
-__SYSCALL(__NR_uname, sys_newuname)
+__SC_WRAP(__NR_uname, sys_newuname)
 #define __NR_sethostname 161
-__SYSCALL(__NR_sethostname, sys_sethostname)
+__SC_WRAP(__NR_sethostname, sys_sethostname)
 #define __NR_setdomainname 162
-__SYSCALL(__NR_setdomainname, sys_setdomainname)
+__SC_WRAP(__NR_setdomainname, sys_setdomainname)
 #define __NR_getrlimit 163
 __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
 #define __NR_setrlimit 164
@@ -475,9 +475,9 @@ __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
 #define __NR_umask 166
 __SYSCALL(__NR_umask, sys_umask)
 #define __NR_prctl 167
-__SYSCALL(__NR_prctl, sys_prctl)
+__SC_WRAP(__NR_prctl, sys_prctl)
 #define __NR_getcpu 168
-__SYSCALL(__NR_getcpu, sys_getcpu)
+__SC_WRAP(__NR_getcpu, sys_getcpu)
 
 /* kernel/time.c */
 #define __NR_gettimeofday 169
@@ -509,7 +509,7 @@ __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)
 #define __NR_mq_open 180
 __SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)
 #define __NR_mq_unlink 181
-__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
+__SC_WRAP(__NR_mq_unlink, sys_mq_unlink)
 #define __NR_mq_timedsend 182
 __SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend)
 #define __NR_mq_timedreceive 183
@@ -554,21 +554,21 @@ __SYSCALL(__NR_shmdt, sys_shmdt)
 #define __NR_socket 198
 __SYSCALL(__NR_socket, sys_socket)
 #define __NR_socketpair 199
-__SYSCALL(__NR_socketpair, sys_socketpair)
+__SC_WRAP(__NR_socketpair, sys_socketpair)
 #define __NR_bind 200
-__SYSCALL(__NR_bind, sys_bind)
+__SC_WRAP(__NR_bind, sys_bind)
 #define __NR_listen 201
 __SYSCALL(__NR_listen, sys_listen)
 #define __NR_accept 202
 __SYSCALL(__NR_accept, sys_accept)
 #define __NR_connect 203
-__SYSCALL(__NR_connect, sys_connect)
+__SC_WRAP(__NR_connect, sys_connect)
 #define __NR_getsockname 204
-__SYSCALL(__NR_getsockname, sys_getsockname)
+__SC_WRAP(__NR_getsockname, sys_getsockname)
 #define __NR_getpeername 205
-__SYSCALL(__NR_getpeername, sys_getpeername)
+__SC_WRAP(__NR_getpeername, sys_getpeername)
 #define __NR_sendto 206
-__SYSCALL(__NR_sendto, sys_sendto)
+__SC_WRAP(__NR_sendto, sys_sendto)
 #define __NR_recvfrom 207
 __SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom)
 #define __NR_setsockopt 208
@@ -588,23 +588,23 @@ __SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead)
 
 /* mm/nommu.c, also with MMU */
 #define __NR_brk 214
-__SYSCALL(__NR_brk, sys_brk)
+__SC_WRAP(__NR_brk, sys_brk)
 #define __NR_munmap 215
-__SYSCALL(__NR_munmap, sys_munmap)
+__SC_WRAP(__NR_munmap, sys_munmap)
 #define __NR_mremap 216
-__SYSCALL(__NR_mremap, sys_mremap)
+__SC_WRAP(__NR_mremap, sys_mremap)
 
 /* security/keys/keyctl.c */
 #define __NR_add_key 217
-__SYSCALL(__NR_add_key, sys_add_key)
+__SC_WRAP(__NR_add_key, sys_add_key)
 #define __NR_request_key 218
-__SYSCALL(__NR_request_key, sys_request_key)
+__SC_WRAP(__NR_request_key, sys_request_key)
 #define __NR_keyctl 219
 __SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl)
 
 /* arch/example/kernel/sys_example.c */
 #define __NR_clone 220
-__SYSCALL(__NR_clone, sys_clone)
+__SC_WRAP(__NR_clone, sys_clone)
 #define __NR_execve 221
 __SC_COMP(__NR_execve, sys_execve, compat_sys_execve)
 
@@ -617,27 +617,27 @@ __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
 /* mm/, CONFIG_MMU only */
 #ifndef __ARCH_NOMMU
 #define __NR_swapon 224
-__SYSCALL(__NR_swapon, sys_swapon)
+__SC_WRAP(__NR_swapon, sys_swapon)
 #define __NR_swapoff 225
-__SYSCALL(__NR_swapoff, sys_swapoff)
+__SC_WRAP(__NR_swapoff, sys_swapoff)
 #define __NR_mprotect 226
-__SYSCALL(__NR_mprotect, sys_mprotect)
+__SC_WRAP(__NR_mprotect, sys_mprotect)
 #define __NR_msync 227
-__SYSCALL(__NR_msync, sys_msync)
+__SC_WRAP(__NR_msync, sys_msync)
 #define __NR_mlock 228
-__SYSCALL(__NR_mlock, sys_mlock)
+__SC_WRAP(__NR_mlock, sys_mlock)
 #define __NR_munlock 229
-__SYSCALL(__NR_munlock, sys_munlock)
+__SC_WRAP(__NR_munlock, sys_munlock)
 #define __NR_mlockall 230
 __SYSCALL(__NR_mlockall, sys_mlockall)
 #define __NR_munlockall 231
 __SYSCALL(__NR_munlockall, sys_munlockall)
 #define __NR_mincore 232
-__SYSCALL(__NR_mincore, sys_mincore)
+__SC_WRAP(__NR_mincore, sys_mincore)
 #define __NR_madvise 233
-__SYSCALL(__NR_madvise, sys_madvise)
+__SC_WRAP(__NR_madvise, sys_madvise)
 #define __NR_remap_file_pages 234
-__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
+__SC_WRAP(__NR_remap_file_pages, sys_remap_file_pages)
 #define __NR_mbind 235
 __SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind)
 #define __NR_get_mempolicy 236
@@ -654,9 +654,9 @@ __SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages)
 __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \
 	  compat_sys_rt_tgsigqueueinfo)
 #define __NR_perf_event_open 241
-__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
+__SC_WRAP(__NR_perf_event_open, sys_perf_event_open)
 #define __NR_accept4 242
-__SYSCALL(__NR_accept4, sys_accept4)
+__SC_WRAP(__NR_accept4, sys_accept4)
 #define __NR_recvmmsg 243
 __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
 
@@ -669,13 +669,13 @@ __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
 #define __NR_wait4 260
 __SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)
 #define __NR_prlimit64 261
-__SYSCALL(__NR_prlimit64, sys_prlimit64)
+__SC_WRAP(__NR_prlimit64, sys_prlimit64)
 #define __NR_fanotify_init 262
 __SYSCALL(__NR_fanotify_init, sys_fanotify_init)
 #define __NR_fanotify_mark 263
 __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
 #define __NR_name_to_handle_at         264
-__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
+__SC_WRAP(__NR_name_to_handle_at, sys_name_to_handle_at)
 #define __NR_open_by_handle_at         265
 __SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \
 	  compat_sys_open_by_handle_at)
@@ -694,23 +694,23 @@ __SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \
 __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \
           compat_sys_process_vm_writev)
 #define __NR_kcmp 272
-__SYSCALL(__NR_kcmp, sys_kcmp)
+__SC_WRAP(__NR_kcmp, sys_kcmp)
 #define __NR_finit_module 273
-__SYSCALL(__NR_finit_module, sys_finit_module)
+__SC_WRAP(__NR_finit_module, sys_finit_module)
 #define __NR_sched_setattr 274
-__SYSCALL(__NR_sched_setattr, sys_sched_setattr)
+__SC_WRAP(__NR_sched_setattr, sys_sched_setattr)
 #define __NR_sched_getattr 275
-__SYSCALL(__NR_sched_getattr, sys_sched_getattr)
+__SC_WRAP(__NR_sched_getattr, sys_sched_getattr)
 #define __NR_renameat2 276
-__SYSCALL(__NR_renameat2, sys_renameat2)
+__SC_WRAP(__NR_renameat2, sys_renameat2)
 #define __NR_seccomp 277
-__SYSCALL(__NR_seccomp, sys_seccomp)
+__SC_WRAP(__NR_seccomp, sys_seccomp)
 #define __NR_getrandom 278
-__SYSCALL(__NR_getrandom, sys_getrandom)
+__SC_WRAP(__NR_getrandom, sys_getrandom)
 #define __NR_memfd_create 279
-__SYSCALL(__NR_memfd_create, sys_memfd_create)
+__SC_WRAP(__NR_memfd_create, sys_memfd_create)
 #define __NR_bpf 280
-__SYSCALL(__NR_bpf, sys_bpf)
+__SC_WRAP(__NR_bpf, sys_bpf)
 #define __NR_execveat 281
 __SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
 #define __NR_userfaultfd 282
@@ -718,7 +718,7 @@ __SYSCALL(__NR_userfaultfd, sys_userfaultfd)
 #define __NR_membarrier 283
 __SYSCALL(__NR_membarrier, sys_membarrier)
 #define __NR_mlock2 284
-__SYSCALL(__NR_mlock2, sys_mlock2)
+__SC_WRAP(__NR_mlock2, sys_mlock2)
 
 #undef __NR_syscalls
 #define __NR_syscalls 285
@@ -735,29 +735,29 @@ __SYSCALL(__NR_mlock2, sys_mlock2)
 #define __NR_open 1024
 __SYSCALL(__NR_open, sys_open)
 #define __NR_link 1025
-__SYSCALL(__NR_link, sys_link)
+__SC_WRAP(__NR_link, sys_link)
 #define __NR_unlink 1026
-__SYSCALL(__NR_unlink, sys_unlink)
+__SC_WRAP(__NR_unlink, sys_unlink)
 #define __NR_mknod 1027
-__SYSCALL(__NR_mknod, sys_mknod)
+__SC_WRAP(__NR_mknod, sys_mknod)
 #define __NR_chmod 1028
-__SYSCALL(__NR_chmod, sys_chmod)
+__SC_WRAP(__NR_chmod, sys_chmod)
 #define __NR_chown 1029
-__SYSCALL(__NR_chown, sys_chown)
+__SC_WRAP(__NR_chown, sys_chown)
 #define __NR_mkdir 1030
-__SYSCALL(__NR_mkdir, sys_mkdir)
+__SC_WRAP(__NR_mkdir, sys_mkdir)
 #define __NR_rmdir 1031
-__SYSCALL(__NR_rmdir, sys_rmdir)
+__SC_WRAP(__NR_rmdir, sys_rmdir)
 #define __NR_lchown 1032
-__SYSCALL(__NR_lchown, sys_lchown)
+__SC_WRAP(__NR_lchown, sys_lchown)
 #define __NR_access 1033
-__SYSCALL(__NR_access, sys_access)
+__SC_WRAP(__NR_access, sys_access)
 #define __NR_rename 1034
-__SYSCALL(__NR_rename, sys_rename)
+__SC_WRAP(__NR_rename, sys_rename)
 #define __NR_readlink 1035
-__SYSCALL(__NR_readlink, sys_readlink)
+__SC_WRAP(__NR_readlink, sys_readlink)
 #define __NR_symlink 1036
-__SYSCALL(__NR_symlink, sys_symlink)
+__SC_WRAP(__NR_symlink, sys_symlink)
 #define __NR_utimes 1037
 __SYSCALL(__NR_utimes, sys_utimes)
 #define __NR3264_stat 1038
@@ -771,7 +771,7 @@ __SC_3264(__NR3264_lstat, sys_lstat64, sys_newlstat)
 
 #ifdef __ARCH_WANT_SYSCALL_NO_FLAGS
 #define __NR_pipe 1040
-__SYSCALL(__NR_pipe, sys_pipe)
+__SC_WRAP(__NR_pipe, sys_pipe)
 #define __NR_dup2 1041
 __SYSCALL(__NR_dup2, sys_dup2)
 #define __NR_epoll_create 1042
@@ -841,7 +841,7 @@ __SYSCALL(__NR_time, sys_time)
 __SYSCALL(__NR_utime, sys_utime)
 
 #define __NR_creat 1064
-__SYSCALL(__NR_creat, sys_creat)
+__SC_WRAP(__NR_creat, sys_creat)
 #define __NR_getdents 1065
 #define __ARCH_WANT_SYS_GETDENTS
 __SYSCALL(__NR_getdents, sys_getdents)
@@ -851,9 +851,9 @@ __SYSCALL(__NR_futimesat, sys_futimesat)
 #define __ARCH_WANT_SYS_SELECT
 __SYSCALL(__NR_select, sys_select)
 #define __NR_poll 1068
-__SYSCALL(__NR_poll, sys_poll)
+__SC_WRAP(__NR_poll, sys_poll)
 #define __NR_epoll_wait 1069
-__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
+__SC_WRAP(__NR_epoll_wait, sys_epoll_wait)
 #define __NR_ustat 1070
 __SYSCALL(__NR_ustat, sys_ustat)
 #define __NR_vfork 1071
@@ -865,12 +865,12 @@ __SYSCALL(__NR_recv, sys_recv)
 #define __NR_send 1074
 __SYSCALL(__NR_send, sys_send)
 #define __NR_bdflush 1075
-__SYSCALL(__NR_bdflush, sys_bdflush)
+__SC_WRAP(__NR_bdflush, sys_bdflush)
 #define __NR_umount 1076
-__SYSCALL(__NR_umount, sys_oldumount)
+__SC_WRAP(__NR_umount, sys_oldumount)
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __NR_uselib 1077
-__SYSCALL(__NR_uselib, sys_uselib)
+__SC_WRAP(__NR_uselib, sys_uselib)
 #define __NR__sysctl 1078
 __SYSCALL(__NR__sysctl, sys_sysctl)
 
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 161a180..01b8d15 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -27,6 +27,7 @@
 #include <linux/vmalloc.h>
 #include <linux/netlink.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/audit.h>
 #include <linux/signal.h>
 #include <linux/mutex.h>
@@ -849,7 +850,7 @@ out_putname:
 	return fd;
 }
 
-SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
+SYSCALL_DEFINE_WRAP1(mq_unlink, const char __user *, u_name)
 {
 	int err;
 	struct filename *name;
diff --git a/kernel/acct.c b/kernel/acct.c
index 74963d1..76fc391 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -54,6 +54,7 @@
 #include <linux/jiffies.h>
 #include <linux/times.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mount.h>
 #include <linux/uaccess.h>
 #include <asm/div64.h>
@@ -267,7 +268,7 @@ static DEFINE_MUTEX(acct_on_mutex);
  * should be written. If the filename is NULL, accounting will be
  * shutdown.
  */
-SYSCALL_DEFINE1(acct, const char __user *, name)
+SYSCALL_DEFINE_WRAP1(acct, const char __user *, name)
 {
 	int error = 0;
 
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 3b39550..bfd5e87 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -11,6 +11,7 @@
  */
 #include <linux/bpf.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/anon_inodes.h>
 #include <linux/file.h>
@@ -706,7 +707,7 @@ static int bpf_obj_get(const union bpf_attr *attr)
 	return bpf_obj_get_user(u64_to_ptr(attr->pathname));
 }
 
-SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
+SYSCALL_DEFINE_WRAP3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
 {
 	union bpf_attr attr = {};
 	int err;
diff --git a/kernel/capability.c b/kernel/capability.c
index 45432b5..f353690 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -15,6 +15,7 @@
 #include <linux/export.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/pid_namespace.h>
 #include <linux/user_namespace.h>
 #include <asm/uaccess.h>
@@ -146,7 +147,7 @@ static inline int cap_get_target_pid(pid_t pid, kernel_cap_t *pEp,
  *
  * Returns 0 on success and < 0 on error.
  */
-SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
+SYSCALL_DEFINE_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
 {
 	int ret = 0;
 	pid_t pid;
@@ -220,7 +221,7 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
  *
  * Returns 0 on success and < 0 on error.
  */
-SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
+SYSCALL_DEFINE_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data)
 {
 	struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
 	unsigned i, tocopy, copybytes;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index cfc227c..7b35332 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8243,7 +8243,7 @@ static int perf_event_set_clock(struct perf_event *event, clockid_t clk_id)
  * @cpu:		target cpu
  * @group_fd:		group leader event fd
  */
-SYSCALL_DEFINE5(perf_event_open,
+SYSCALL_DEFINE_WRAP5(perf_event_open,
 		struct perf_event_attr __user *, attr_uptr,
 		pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
 {
diff --git a/kernel/fork.c b/kernel/fork.c
index 1155eac..6bd4aff 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1196,7 +1196,7 @@ static void copy_seccomp(struct task_struct *p)
 #endif
 }
 
-SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)
+SYSCALL_DEFINE_WRAP1(set_tid_address, int __user *, tidptr)
 {
 	current->clear_child_tid = tidptr;
 
@@ -1806,23 +1806,23 @@ SYSCALL_DEFINE0(vfork)
 
 #ifdef __ARCH_WANT_SYS_CLONE
 #ifdef CONFIG_CLONE_BACKWARDS
-SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, clone_flags, unsigned long, newsp,
 		 int __user *, parent_tidptr,
 		 unsigned long, tls,
 		 int __user *, child_tidptr)
 #elif defined(CONFIG_CLONE_BACKWARDS2)
-SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, newsp, unsigned long, clone_flags,
 		 int __user *, parent_tidptr,
 		 int __user *, child_tidptr,
 		 unsigned long, tls)
 #elif defined(CONFIG_CLONE_BACKWARDS3)
-SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP6(clone, unsigned long, clone_flags, unsigned long, newsp,
 		int, stack_size,
 		int __user *, parent_tidptr,
 		int __user *, child_tidptr,
 		unsigned long, tls)
 #else
-SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, clone_flags, unsigned long, newsp,
 		 int __user *, parent_tidptr,
 		 int __user *, child_tidptr,
 		 unsigned long, tls)
@@ -1953,7 +1953,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp
  * constructed. Here we are modifying the current, active,
  * task_struct.
  */
-SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
+SYSCALL_DEFINE_WRAP1(unshare, unsigned long, unshare_flags)
 {
 	struct fs_struct *fs, *new_fs = NULL;
 	struct files_struct *fd, *new_fd = NULL;
diff --git a/kernel/groups.c b/kernel/groups.c
index 74d431d..b92dd33 100644
--- a/kernel/groups.c
+++ b/kernel/groups.c
@@ -6,6 +6,7 @@
 #include <linux/slab.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/user_namespace.h>
 #include <asm/uaccess.h>
 
@@ -187,7 +188,7 @@ int set_current_groups(struct group_info *group_info)
 
 EXPORT_SYMBOL(set_current_groups);
 
-SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
+SYSCALL_DEFINE_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
 	const struct cred *cred = current_cred();
 	int i;
@@ -224,7 +225,7 @@ bool may_setgroups(void)
  *	without another task interfering.
  */
 
-SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
+SYSCALL_DEFINE_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
 	struct group_info *group_info;
 	int retval;
diff --git a/kernel/kcmp.c b/kernel/kcmp.c
index 0aa69ea..deca910 100644
--- a/kernel/kcmp.c
+++ b/kernel/kcmp.c
@@ -1,5 +1,6 @@
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fdtable.h>
 #include <linux/string.h>
 #include <linux/random.h>
@@ -94,7 +95,7 @@ static int kcmp_lock(struct mutex *m1, struct mutex *m2)
 	return err;
 }
 
-SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
+SYSCALL_DEFINE_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
 		unsigned long, idx1, unsigned long, idx2)
 {
 	struct task_struct *task1, *task2;
diff --git a/kernel/module.c b/kernel/module.c
index 38c7bd5..89fcca7 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -32,6 +32,7 @@
 #include <linux/security.h>
 #include <linux/seq_file.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 #include <linux/rcupdate.h>
 #include <linux/capability.h>
@@ -947,7 +948,7 @@ EXPORT_SYMBOL(module_refcount);
 /* This exists whether we can unload or not */
 static void free_module(struct module *mod);
 
-SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
+SYSCALL_DEFINE_WRAP2(delete_module, const char __user *, name_user,
 		unsigned int, flags)
 {
 	struct module *mod;
@@ -3586,7 +3587,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
 	return err;
 }
 
-SYSCALL_DEFINE3(init_module, void __user *, umod,
+SYSCALL_DEFINE_WRAP3(init_module, void __user *, umod,
 		unsigned long, len, const char __user *, uargs)
 {
 	int err;
@@ -3606,7 +3607,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
 	return load_module(&info, uargs, 0);
 }
 
-SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
+SYSCALL_DEFINE_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags)
 {
 	int err;
 	struct load_info info = { };
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 2ce8826..156f37e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -33,6 +33,7 @@
 #include <linux/bootmem.h>
 #include <linux/memblock.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/kexec.h>
 #include <linux/kdb.h>
 #include <linux/ratelimit.h>
@@ -1420,7 +1421,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len)
+SYSCALL_DEFINE_WRAP3(syslog, int, type, char __user *, buf, int, len)
 {
 	return do_syslog(type, buf, len, SYSLOG_FROM_READER);
 }
diff --git a/kernel/reboot.c b/kernel/reboot.c
index bd30a97..70e4537 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -14,6 +14,7 @@
 #include <linux/reboot.h>
 #include <linux/suspend.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/syscore_ops.h>
 #include <linux/uaccess.h>
 
@@ -277,7 +278,7 @@ static DEFINE_MUTEX(reboot_mutex);
  *
  * reboot doesn't sync: do that yourself before calling this.
  */
-SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
+SYSCALL_DEFINE_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd,
 		void __user *, arg)
 {
 	struct pid_namespace *pid_ns = task_active_pid_ns(current);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 732e993..1f20193 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -58,6 +58,7 @@
 #include <linux/seq_file.h>
 #include <linux/sysctl.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/times.h>
 #include <linux/tsacct_kern.h>
 #include <linux/kprobes.h>
@@ -4184,7 +4185,7 @@ err_size:
  *
  * Return: 0 on success. An error code otherwise.
  */
-SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy,
+SYSCALL_DEFINE_WRAP3(sched_setscheduler, pid_t, pid, int, policy,
 		struct sched_param __user *, param)
 {
 	/* negative values for policy are not valid */
@@ -4201,7 +4202,7 @@ SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy,
  *
  * Return: 0 on success. An error code otherwise.
  */
-SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
+SYSCALL_DEFINE_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
 {
 	return do_sched_setscheduler(pid, SETPARAM_POLICY, param);
 }
@@ -4212,7 +4213,7 @@ SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
  * @uattr: structure containing the extended parameters.
  * @flags: for future extension.
  */
-SYSCALL_DEFINE3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
+SYSCALL_DEFINE_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
 			       unsigned int, flags)
 {
 	struct sched_attr attr;
@@ -4275,7 +4276,7 @@ SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid)
  * Return: On success, 0 and the RT priority is in @param. Otherwise, an error
  * code.
  */
-SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
+SYSCALL_DEFINE_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
 {
 	struct sched_param lp = { .sched_priority = 0 };
 	struct task_struct *p;
@@ -4353,7 +4354,7 @@ static int sched_read_attr(struct sched_attr __user *uattr,
  * @size: sizeof(attr) for fwd/bwd comp.
  * @flags: for future extension.
  */
-SYSCALL_DEFINE4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
+SYSCALL_DEFINE_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
 		unsigned int, size, unsigned int, flags)
 {
 	struct sched_attr attr = {
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 580ac2d..b9cb4f5 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -829,7 +829,7 @@ static long do_seccomp(unsigned int op, unsigned int flags,
 	}
 }
 
-SYSCALL_DEFINE3(seccomp, unsigned int, op, unsigned int, flags,
+SYSCALL_DEFINE_WRAP3(seccomp, unsigned int, op, unsigned int, flags,
 			 const char __user *, uargs)
 {
 	return do_seccomp(op, flags, uargs);
diff --git a/kernel/signal.c b/kernel/signal.c
index f3f1f7a..476de6d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3475,7 +3475,7 @@ SYSCALL_DEFINE1(ssetmask, int, newmask)
 /*
  * For backwards compatibility.  Functionality superseded by sigaction.
  */
-SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
+SYSCALL_DEFINE_WRAP2(signal, int, sig, __sighandler_t, handler)
 {
 	struct k_sigaction new_sa, old_sa;
 	int ret;
@@ -3556,7 +3556,7 @@ COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_
 #endif
 
 #ifdef CONFIG_OLD_SIGSUSPEND
-SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
+SYSCALL_DEFINE_WRAP1(sigsuspend, old_sigset_t, mask)
 {
 	sigset_t blocked;
 	siginitset(&blocked, mask);
@@ -3564,7 +3564,7 @@ SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
 }
 #endif
 #ifdef CONFIG_OLD_SIGSUSPEND3
-SYSCALL_DEFINE3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask)
+SYSCALL_DEFINE_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask)
 {
 	sigset_t blocked;
 	siginitset(&blocked, mask);
diff --git a/kernel/sys.c b/kernel/sys.c
index 6af9212..c5689dd 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -642,7 +642,7 @@ error:
 	return retval;
 }
 
-SYSCALL_DEFINE3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t __user *, suidp)
+SYSCALL_DEFINE_WRAP3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t __user *, suidp)
 {
 	const struct cred *cred = current_cred();
 	int retval;
@@ -716,7 +716,7 @@ error:
 	return retval;
 }
 
-SYSCALL_DEFINE3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp)
+SYSCALL_DEFINE_WRAP3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp)
 {
 	const struct cred *cred = current_cred();
 	int retval;
@@ -1138,7 +1138,7 @@ static int override_release(char __user *release, size_t len)
 	return ret;
 }
 
-SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
+SYSCALL_DEFINE_WRAP1(newuname, struct new_utsname __user *, name)
 {
 	int errno = 0;
 
@@ -1212,7 +1212,7 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
 }
 #endif
 
-SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
+SYSCALL_DEFINE_WRAP2(sethostname, char __user *, name, int, len)
 {
 	int errno;
 	char tmp[__NEW_UTS_LEN];
@@ -1263,7 +1263,7 @@ SYSCALL_DEFINE2(gethostname, char __user *, name, int, len)
  * Only setdomainname; getdomainname can be implemented by calling
  * uname()
  */
-SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
+SYSCALL_DEFINE_WRAP2(setdomainname, char __user *, name, int, len)
 {
 	int errno;
 	char tmp[__NEW_UTS_LEN];
@@ -1445,7 +1445,7 @@ static int check_prlimit_permission(struct task_struct *task)
 	return -EPERM;
 }
 
-SYSCALL_DEFINE4(prlimit64, pid_t, pid, unsigned int, resource,
+SYSCALL_DEFINE_WRAP4(prlimit64, pid_t, pid, unsigned int, resource,
 		const struct rlimit64 __user *, new_rlim,
 		struct rlimit64 __user *, old_rlim)
 {
@@ -2072,7 +2072,7 @@ static int prctl_get_tid_address(struct task_struct *me, int __user **tid_addr)
 }
 #endif
 
-SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
+SYSCALL_DEFINE_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 		unsigned long, arg4, unsigned long, arg5)
 {
 	struct task_struct *me = current;
@@ -2273,7 +2273,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 	return error;
 }
 
-SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
+SYSCALL_DEFINE_WRAP3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
 		struct getcpu_cache __user *, unused)
 {
 	int err = 0;
diff --git a/mm/madvise.c b/mm/madvise.c
index c889fcb..8390012 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -8,6 +8,7 @@
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mempolicy.h>
 #include <linux/page-isolation.h>
 #include <linux/hugetlb.h>
@@ -457,7 +458,7 @@ madvise_behavior_valid(int behavior)
  *  -EBADF  - map exists, but area maps something that isn't a file.
  *  -EAGAIN - a kernel resource was temporarily unavailable.
  */
-SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
+SYSCALL_DEFINE_WRAP3(madvise, unsigned long, start, size_t, len_in, int, behavior)
 {
 	unsigned long end, tmp;
 	struct vm_area_struct *vma, *prev;
diff --git a/mm/mincore.c b/mm/mincore.c
index 14bb9fb..d6e4395 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -12,6 +12,7 @@
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/hugetlb.h>
@@ -217,7 +218,7 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
  *		mapped
  *  -EAGAIN - A kernel resource was temporarily unavailable.
  */
-SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len,
+SYSCALL_DEFINE_WRAP3(mincore, unsigned long, start, size_t, len,
 		unsigned char __user *, vec)
 {
 	long retval;
diff --git a/mm/mlock.c b/mm/mlock.c
index 339d9e0..e37e60f 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -14,6 +14,7 @@
 #include <linux/pagevec.h>
 #include <linux/mempolicy.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/sched.h>
 #include <linux/export.h>
 #include <linux/rmap.h>
@@ -640,12 +641,12 @@ static int do_mlock(unsigned long start, size_t len, vm_flags_t flags)
 	return 0;
 }
 
-SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
+SYSCALL_DEFINE_WRAP2(mlock, unsigned long, start, size_t, len)
 {
 	return do_mlock(start, len, VM_LOCKED);
 }
 
-SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
+SYSCALL_DEFINE_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags)
 {
 	vm_flags_t vm_flags = VM_LOCKED;
 
@@ -658,7 +659,7 @@ SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
 	return do_mlock(start, len, vm_flags);
 }
 
-SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
+SYSCALL_DEFINE_WRAP2(munlock, unsigned long, start, size_t, len)
 {
 	int ret;
 
diff --git a/mm/mmap.c b/mm/mmap.c
index 2ce04a6..9b9ae80 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -18,6 +18,7 @@
 #include <linux/pagemap.h>
 #include <linux/swap.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/capability.h>
 #include <linux/init.h>
 #include <linux/file.h>
@@ -283,7 +284,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
 
 static unsigned long do_brk(unsigned long addr, unsigned long len);
 
-SYSCALL_DEFINE1(brk, unsigned long, brk)
+SYSCALL_DEFINE_WRAP1(brk, unsigned long, brk)
 {
 	unsigned long retval;
 	unsigned long newbrk, oldbrk;
@@ -2631,7 +2632,7 @@ int vm_munmap(unsigned long start, size_t len)
 }
 EXPORT_SYMBOL(vm_munmap);
 
-SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+SYSCALL_DEFINE_WRAP2(munmap, unsigned long, addr, size_t, len)
 {
 	profile_munmap(addr);
 	return vm_munmap(addr, len);
@@ -2641,7 +2642,7 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
 /*
  * Emulation of deprecated remap_file_pages() syscall.
  */
-SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+SYSCALL_DEFINE_WRAP5(remap_file_pages, unsigned long, start, unsigned long, size,
 		unsigned long, prot, unsigned long, pgoff, unsigned long, flags)
 {
 
diff --git a/mm/mprotect.c b/mm/mprotect.c
index ef5be8e..eec7d57 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -18,6 +18,7 @@
 #include <linux/mempolicy.h>
 #include <linux/personality.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/mmu_notifier.h>
@@ -344,7 +345,7 @@ fail:
 	return error;
 }
 
-SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
+SYSCALL_DEFINE_WRAP3(mprotect, unsigned long, start, size_t, len,
 		unsigned long, prot)
 {
 	unsigned long vm_flags, nstart, end, tmp, reqprot;
diff --git a/mm/mremap.c b/mm/mremap.c
index c25bc62..b81462a 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -19,6 +19,7 @@
 #include <linux/highmem.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mmu_notifier.h>
 #include <linux/sched/sysctl.h>
 #include <linux/uaccess.h>
@@ -468,7 +469,7 @@ static int vma_expandable(struct vm_area_struct *vma, unsigned long delta)
  * MREMAP_FIXED option added 5-Dec-1999 by Benjamin LaHaise
  * This option implies MREMAP_MAYMOVE.
  */
-SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+SYSCALL_DEFINE_WRAP5(mremap, unsigned long, addr, unsigned long, old_len,
 		unsigned long, new_len, unsigned long, flags,
 		unsigned long, new_addr)
 {
diff --git a/mm/msync.c b/mm/msync.c
index 24e612f..1fd9f6a 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -12,6 +12,7 @@
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/sched.h>
 
 /*
@@ -28,7 +29,7 @@
  * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to
  * applications.
  */
-SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
+SYSCALL_DEFINE_WRAP3(msync, unsigned long, start, size_t, len, int, flags)
 {
 	unsigned long end;
 	struct mm_struct *mm = current->mm;
diff --git a/mm/nommu.c b/mm/nommu.c
index 92be862..59c6baf 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -32,6 +32,7 @@
 #include <linux/personality.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/audit.h>
 #include <linux/sched/sysctl.h>
 #include <linux/printk.h>
@@ -526,7 +527,7 @@ EXPORT_SYMBOL(vm_insert_page);
  *  to a regular file.  in this case, the unmapping will need
  *  to invoke file system routines that need the global lock.
  */
-SYSCALL_DEFINE1(brk, unsigned long, brk)
+SYSCALL_DEFINE_WRAP1(brk, unsigned long, brk)
 {
 	struct mm_struct *mm = current->mm;
 
@@ -1684,7 +1685,7 @@ int vm_munmap(unsigned long addr, size_t len)
 }
 EXPORT_SYMBOL(vm_munmap);
 
-SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+SYSCALL_DEFINE_WRAP2(munmap, unsigned long, addr, size_t, len)
 {
 	return vm_munmap(addr, len);
 }
@@ -1760,7 +1761,7 @@ static unsigned long do_mremap(unsigned long addr,
 	return vma->vm_start;
 }
 
-SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+SYSCALL_DEFINE_WRAP5(mremap, unsigned long, addr, unsigned long, old_len,
 		unsigned long, new_len, unsigned long, flags,
 		unsigned long, new_addr)
 {
diff --git a/mm/shmem.c b/mm/shmem.c
index 2afcdbb..154d3b7 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -67,6 +67,7 @@ static struct vfsmount *shm_mnt;
 #include <linux/seq_file.h>
 #include <linux/magic.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 #include <uapi/linux/memfd.h>
 
@@ -2921,7 +2922,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
 
 #define MFD_ALL_FLAGS (MFD_CLOEXEC | MFD_ALLOW_SEALING)
 
-SYSCALL_DEFINE2(memfd_create,
+SYSCALL_DEFINE_WRAP2(memfd_create,
 		const char __user *, uname,
 		unsigned int, flags)
 {
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 5887731..3bb701c 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -28,6 +28,7 @@
 #include <linux/mutex.h>
 #include <linux/capability.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/memcontrol.h>
 #include <linux/poll.h>
 #include <linux/oom.h>
@@ -1841,7 +1842,7 @@ static void reinsert_swap_info(struct swap_info_struct *p)
 	spin_unlock(&swap_lock);
 }
 
-SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
+SYSCALL_DEFINE_WRAP1(swapoff, const char __user *, specialfile)
 {
 	struct swap_info_struct *p = NULL;
 	unsigned char *swap_map;
@@ -2383,7 +2384,7 @@ static bool swap_discardable(struct swap_info_struct *si)
 	return true;
 }
 
-SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
+SYSCALL_DEFINE_WRAP2(swapon, const char __user *, specialfile, int, swap_flags)
 {
 	struct swap_info_struct *p;
 	struct filename *name;
diff --git a/net/socket.c b/net/socket.c
index d730ef9..62b2769 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1251,7 +1251,7 @@ out_release:
  *	Create a pair of connected sockets.
  */
 
-SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol,
+SYSCALL_DEFINE_WRAP4(socketpair, int, family, int, type, int, protocol,
 		int __user *, usockvec)
 {
 	struct socket *sock1, *sock2;
@@ -1360,7 +1360,7 @@ out:
  *	the protocol layer (having also checked the address is ok).
  */
 
-SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
+SYSCALL_DEFINE_WRAP3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
 {
 	struct socket *sock;
 	struct sockaddr_storage address;
@@ -1422,7 +1422,7 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog)
  *	clean when we restucture accept also.
  */
 
-SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
+SYSCALL_DEFINE_WRAP4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
 		int __user *, upeer_addrlen, int, flags)
 {
 	struct socket *sock, *newsock;
@@ -1521,7 +1521,7 @@ SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr,
  *	include the -EINPROGRESS status for such sockets.
  */
 
-SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
+SYSCALL_DEFINE_WRAP3(connect, int, fd, struct sockaddr __user *, uservaddr,
 		int, addrlen)
 {
 	struct socket *sock;
@@ -1553,7 +1553,7 @@ out:
  *	name to user space.
  */
 
-SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
+SYSCALL_DEFINE_WRAP3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
 		int __user *, usockaddr_len)
 {
 	struct socket *sock;
@@ -1584,7 +1584,7 @@ out:
  *	name to user space.
  */
 
-SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
+SYSCALL_DEFINE_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
 		int __user *, usockaddr_len)
 {
 	struct socket *sock;
@@ -1616,7 +1616,7 @@ SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
  *	the protocol.
  */
 
-SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len,
+SYSCALL_DEFINE_WRAP6(sendto, int, fd, void __user *, buff, size_t, len,
 		unsigned int, flags, struct sockaddr __user *, addr,
 		int, addr_len)
 {
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 1c3872a..bae5a04 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/key.h>
 #include <linux/keyctl.h>
 #include <linux/fs.h>
@@ -57,7 +58,7 @@ static int key_get_type_from_user(char *type,
  * If successful, the new key's serial number is returned, otherwise an error
  * code is returned.
  */
-SYSCALL_DEFINE5(add_key, const char __user *, _type,
+SYSCALL_DEFINE_WRAP5(add_key, const char __user *, _type,
 		const char __user *, _description,
 		const void __user *, _payload,
 		size_t, plen,
@@ -155,7 +156,7 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type,
  * passed to /sbin/request-key to aid with completing the request.  If the
  * _callout_info string is "" then it will be changed to "-".
  */
-SYSCALL_DEFINE4(request_key, const char __user *, _type,
+SYSCALL_DEFINE_WRAP4(request_key, const char __user *, _type,
 		const char __user *, _description,
 		const char __user *, _callout_info,
 		key_serial_t, destringid)
-- 
2.5.0

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

* [PATCH 3/5] all: s390: redefine wrappers in generic code
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

With new COMPAT_SYSCALL_WRAPx macro, we declare both sys_foo(),
and compat_sys_foo() system calls. The later clears top halves of 64-bit
registers to eliminate possible damage from garbage there.

With the only exception (handled in next patch), this is mechanical work.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/kernel/Makefile         |   2 +-
 arch/s390/kernel/compat_wrapper.c | 128 ----------------------
 arch/s390/pci/pci_mmio.c          |   5 +-
 drivers/char/random.c             |   3 +-
 fs/aio.c                          |   4 +-
 fs/buffer.c                       |   3 +-
 fs/dcache.c                       |   3 +-
 fs/eventpoll.c                    |   4 +-
 fs/exec.c                         |   2 +-
 fs/fhandle.c                      |   3 +-
 fs/filesystems.c                  |   3 +-
 fs/namei.c                        |  29 ++---
 fs/namespace.c                    |   7 +-
 fs/notify/inotify/inotify_user.c  |   3 +-
 fs/open.c                         |  20 ++--
 fs/pipe.c                         |   5 +-
 fs/quota/quota.c                  |   3 +-
 fs/read_write.c                   |   2 +-
 fs/select.c                       |   3 +-
 fs/splice.c                       |   4 +-
 fs/stat.c                         |   5 +-
 fs/xattr.c                        |  25 ++---
 include/uapi/asm-generic/unistd.h | 220 +++++++++++++++++++-------------------
 ipc/mqueue.c                      |   3 +-
 kernel/acct.c                     |   3 +-
 kernel/bpf/syscall.c              |   3 +-
 kernel/capability.c               |   5 +-
 kernel/events/core.c              |   2 +-
 kernel/fork.c                     |  12 +--
 kernel/groups.c                   |   5 +-
 kernel/kcmp.c                     |   3 +-
 kernel/module.c                   |   7 +-
 kernel/printk/printk.c            |   3 +-
 kernel/reboot.c                   |   3 +-
 kernel/sched/core.c               |  11 +-
 kernel/seccomp.c                  |   2 +-
 kernel/signal.c                   |   6 +-
 kernel/sys.c                      |  16 +--
 mm/madvise.c                      |   3 +-
 mm/mincore.c                      |   3 +-
 mm/mlock.c                        |   7 +-
 mm/mmap.c                         |   7 +-
 mm/mprotect.c                     |   3 +-
 mm/mremap.c                       |   3 +-
 mm/msync.c                        |   3 +-
 mm/nommu.c                        |   7 +-
 mm/shmem.c                        |   3 +-
 mm/swapfile.c                     |   5 +-
 net/socket.c                      |  14 +--
 security/keys/keyctl.c            |   5 +-
 50 files changed, 270 insertions(+), 363 deletions(-)
 delete mode 100644 arch/s390/kernel/compat_wrapper.c

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index dc167a2..185cd88 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -55,7 +55,7 @@ obj-$(CONFIG_HIBERNATION)	+= suspend.o swsusp.o
 obj-$(CONFIG_AUDIT)		+= audit.o
 compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
 obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o
-obj-$(CONFIG_COMPAT)		+= compat_wrapper.o $(compat-obj-y)
+obj-$(CONFIG_COMPAT)		+= $(compat-obj-y)
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c
deleted file mode 100644
index 527f75d..0000000
--- a/arch/s390/kernel/compat_wrapper.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *  Compat system call wrappers.
- *
- *    Copyright IBM Corp. 2014
- */
-
-#include <linux/syscalls.h>
-#include <linux/compat.h>
-#include "entry.h"
-
-COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
-COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
-COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
-COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
-COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
-COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
-COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
-COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
-COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
-COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
-COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk);
-COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
-COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
-COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
-COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask);
-COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
-COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
-COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
-COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
-COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
-COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
-COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len);
-COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
-COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
-COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
-COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
-COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot);
-COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs);
-COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
-COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data);
-COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2);
-COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence);
-COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags);
-COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len);
-COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len);
-COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr);
-COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout);
-COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5);
-COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size);
-COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr);
-COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data);
-COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group);
-COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist);
-COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist);
-COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid);
-COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid);
-COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group);
-COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old);
-COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec);
-COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior);
-COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count);
-COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name);
-COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr);
-COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event);
-COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout);
-COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx);
-COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result);
-COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name);
-COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id);
-COMPAT_SYSCALL_WRAP4(request_key, const char __user *, tp, const char __user *, dsc, const char __user *, info, key_serial_t, id);
-COMPAT_SYSCALL_WRAP5(remap_file_pages, unsigned long, start, unsigned long, size, unsigned long, prot, unsigned long, pgoff, unsigned long, flags);
-COMPAT_SYSCALL_WRAP3(inotify_add_watch, int, fd, const char __user *, path, u32, mask);
-COMPAT_SYSCALL_WRAP3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, unsigned, dev);
-COMPAT_SYSCALL_WRAP5(fchownat, int, dfd, const char __user *, filename, uid_t, user, gid_t, group, int, flag);
-COMPAT_SYSCALL_WRAP3(unlinkat, int, dfd, const char __user *, pathname, int, flag);
-COMPAT_SYSCALL_WRAP4(renameat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname);
-COMPAT_SYSCALL_WRAP5(linkat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, int, flags);
-COMPAT_SYSCALL_WRAP3(symlinkat, const char __user *, oldname, int, newdfd, const char __user *, newname);
-COMPAT_SYSCALL_WRAP4(readlinkat, int, dfd, const char __user *, path, char __user *, buf, int, bufsiz);
-COMPAT_SYSCALL_WRAP3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode);
-COMPAT_SYSCALL_WRAP3(faccessat, int, dfd, const char __user *, filename, int, mode);
-COMPAT_SYSCALL_WRAP1(unshare, unsigned long, unshare_flags);
-COMPAT_SYSCALL_WRAP6(splice, int, fd_in, loff_t __user *, off_in, int, fd_out, loff_t __user *, off_out, size_t, len, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags);
-COMPAT_SYSCALL_WRAP3(getcpu, unsigned __user *, cpu, unsigned __user *, node, struct getcpu_cache __user *, cache);
-COMPAT_SYSCALL_WRAP2(pipe2, int __user *, fildes, int, flags);
-COMPAT_SYSCALL_WRAP5(perf_event_open, struct perf_event_attr __user *, attr_uptr, pid_t, pid, int, cpu, int, group_fd, unsigned long, flags);
-COMPAT_SYSCALL_WRAP5(clone, unsigned long, newsp, unsigned long, clone_flags, int __user *, parent_tidptr, int __user *, child_tidptr, unsigned long, tls);
-COMPAT_SYSCALL_WRAP4(prlimit64, pid_t, pid, unsigned int, resource, const struct rlimit64 __user *, new_rlim, struct rlimit64 __user *, old_rlim);
-COMPAT_SYSCALL_WRAP5(name_to_handle_at, int, dfd, const char __user *, name, struct file_handle __user *, handle, int __user *, mnt_id, int, flag);
-COMPAT_SYSCALL_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, idx1, unsigned long, idx2);
-COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags);
-COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags);
-COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags);
-COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char __user *, uargs)
-COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags)
-COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags)
-COMPAT_SYSCALL_WRAP3(bpf, int, cmd, union bpf_attr *, attr, unsigned int, size);
-COMPAT_SYSCALL_WRAP3(s390_pci_mmio_write, const unsigned long, mmio_addr, const void __user *, user_buffer, const size_t, length);
-COMPAT_SYSCALL_WRAP3(s390_pci_mmio_read, const unsigned long, mmio_addr, void __user *, user_buffer, const size_t, length);
-COMPAT_SYSCALL_WRAP4(socketpair, int, family, int, type, int, protocol, int __user *, usockvec);
-COMPAT_SYSCALL_WRAP3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen);
-COMPAT_SYSCALL_WRAP3(connect, int, fd, struct sockaddr __user *, uservaddr, int, addrlen);
-COMPAT_SYSCALL_WRAP4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, int __user *, upeer_addrlen, int, flags);
-COMPAT_SYSCALL_WRAP3(getsockname, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
-COMPAT_SYSCALL_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
-COMPAT_SYSCALL_WRAP6(sendto, int, fd, void __user *, buff, size_t, len, unsigned int, flags, struct sockaddr __user *, addr, int, addr_len);
-COMPAT_SYSCALL_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags);
diff --git a/arch/s390/pci/pci_mmio.c b/arch/s390/pci/pci_mmio.c
index b1bb2b7..3627070 100644
--- a/arch/s390/pci/pci_mmio.c
+++ b/arch/s390/pci/pci_mmio.c
@@ -6,6 +6,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
@@ -31,7 +32,7 @@ out:
 	return ret;
 }
 
-SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
+SYSCALL_DEFINE_WRAP3(s390_pci_mmio_write, unsigned long, mmio_addr,
 		const void __user *, user_buffer, size_t, length)
 {
 	u8 local_buf[64];
@@ -71,7 +72,7 @@ out:
 	return ret;
 }
 
-SYSCALL_DEFINE3(s390_pci_mmio_read, unsigned long, mmio_addr,
+SYSCALL_DEFINE_WRAP3(s390_pci_mmio_read, unsigned long, mmio_addr,
 		void __user *, user_buffer, size_t, length)
 {
 	u8 local_buf[64];
diff --git a/drivers/char/random.c b/drivers/char/random.c
index d0da5d8..4484cad 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -259,6 +259,7 @@
 #include <linux/workqueue.h>
 #include <linux/irq.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/completion.h>
 
 #include <asm/processor.h>
@@ -1598,7 +1599,7 @@ const struct file_operations urandom_fops = {
 	.llseek = noop_llseek,
 };
 
-SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count,
+SYSCALL_DEFINE_WRAP3(getrandom, char __user *, buf, size_t, count,
 		unsigned int, flags)
 {
 	if (flags & ~(GRND_NONBLOCK|GRND_RANDOM))
diff --git a/fs/aio.c b/fs/aio.c
index 155f842..c6d1e70 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1349,7 +1349,7 @@ out:
  *	implemented.  May fail with -EINVAL if the context pointed to
  *	is invalid.
  */
-SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
+SYSCALL_DEFINE_WRAP1(io_destroy, aio_context_t, ctx)
 {
 	struct kioctx *ioctx = lookup_ioctx(ctx);
 	if (likely(NULL != ioctx)) {
@@ -1671,7 +1671,7 @@ lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, u32 key)
  *	invalid.  May fail with -EAGAIN if the iocb specified was not
  *	cancelled.  Will fail with -ENOSYS if not implemented.
  */
-SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
+SYSCALL_DEFINE_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
 		struct io_event __user *, result)
 {
 	struct kioctx *ctx;
diff --git a/fs/buffer.c b/fs/buffer.c
index 4f4cd95..394a365 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -20,6 +20,7 @@
 
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/percpu.h>
@@ -3267,7 +3268,7 @@ EXPORT_SYMBOL(try_to_free_buffers);
  * Use of bdflush() is deprecated and will be removed in a future kernel.
  * The `flush-X' kernel threads fully replace bdflush daemons and this call.
  */
-SYSCALL_DEFINE2(bdflush, int, func, long, data)
+SYSCALL_DEFINE_WRAP2(bdflush, int, func, long, data)
 {
 	static int msg_count;
 
diff --git a/fs/dcache.c b/fs/dcache.c
index 5c33aeb..6a83cc5 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -15,6 +15,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
@@ -3244,7 +3245,7 @@ static void get_fs_root_and_pwd_rcu(struct fs_struct *fs, struct path *root,
  *		return NULL;
  *	}
  */
-SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
+SYSCALL_DEFINE_WRAP2(getcwd, char __user *, buf, unsigned long, size)
 {
 	int error;
 	struct path pwd, root;
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 1e009ca..01348a2 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1817,7 +1817,7 @@ SYSCALL_DEFINE1(epoll_create, int, size)
  * the eventpoll file that enables the insertion/removal/change of
  * file descriptors inside the interest set.
  */
-SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
+SYSCALL_DEFINE_WRAP4(epoll_ctl, int, epfd, int, op, int, fd,
 		struct epoll_event __user *, event)
 {
 	int error;
@@ -1958,7 +1958,7 @@ error_return:
  * Implement the event wait interface for the eventpoll file. It is the kernel
  * part of the user space epoll_wait(2).
  */
-SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
+SYSCALL_DEFINE_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events,
 		int, maxevents, int, timeout)
 {
 	int error;
diff --git a/fs/exec.c b/fs/exec.c
index b06623a..2e43e47 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -111,7 +111,7 @@ bool path_noexec(const struct path *path)
  *
  * Also note that we take the address to load from from the file itself.
  */
-SYSCALL_DEFINE1(uselib, const char __user *, library)
+SYSCALL_DEFINE_WRAP1(uselib, const char __user *, library)
 {
 	struct linux_binfmt *fmt;
 	struct file *file;
diff --git a/fs/fhandle.c b/fs/fhandle.c
index d59712d..048a4ee 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -1,4 +1,5 @@
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/file.h>
@@ -89,7 +90,7 @@ static long do_sys_name_to_handle(struct path *path,
  * enough space, the field is updated to return the minimum
  * value required.
  */
-SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
+SYSCALL_DEFINE_WRAP5(name_to_handle_at, int, dfd, const char __user *, name,
 		struct file_handle __user *, handle, int __user *, mnt_id,
 		int, flag)
 {
diff --git a/fs/filesystems.c b/fs/filesystems.c
index 5797d45..6fcbe18 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -181,7 +182,7 @@ static int fs_maxindex(void)
 /*
  * Whee.. Weird sysv syscall. 
  */
-SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
+SYSCALL_DEFINE_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
 {
 	int retval = -EINVAL;
 
diff --git a/fs/namei.c b/fs/namei.c
index 0c3974c..6ded831 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -26,6 +26,7 @@
 #include <linux/security.h>
 #include <linux/ima.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mount.h>
 #include <linux/audit.h>
 #include <linux/capability.h>
@@ -3533,7 +3534,7 @@ static int may_mknod(umode_t mode)
 	}
 }
 
-SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
+SYSCALL_DEFINE_WRAP4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
 		unsigned, dev)
 {
 	struct dentry *dentry;
@@ -3575,7 +3576,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
+SYSCALL_DEFINE_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
 {
 	return sys_mknodat(AT_FDCWD, filename, mode, dev);
 }
@@ -3606,7 +3607,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 }
 EXPORT_SYMBOL(vfs_mkdir);
 
-SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
 {
 	struct dentry *dentry;
 	struct path path;
@@ -3631,7 +3632,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(mkdir, const char __user *, pathname, umode_t, mode)
 {
 	return sys_mkdirat(AT_FDCWD, pathname, mode);
 }
@@ -3759,7 +3760,7 @@ exit1:
 	return error;
 }
 
-SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
+SYSCALL_DEFINE_WRAP1(rmdir, const char __user *, pathname)
 {
 	return do_rmdir(AT_FDCWD, pathname);
 }
@@ -3901,7 +3902,7 @@ slashes:
 	goto exit2;
 }
 
-SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
+SYSCALL_DEFINE_WRAP3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
 {
 	if ((flag & ~AT_REMOVEDIR) != 0)
 		return -EINVAL;
@@ -3912,7 +3913,7 @@ SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
 	return do_unlinkat(dfd, pathname);
 }
 
-SYSCALL_DEFINE1(unlink, const char __user *, pathname)
+SYSCALL_DEFINE_WRAP1(unlink, const char __user *, pathname)
 {
 	return do_unlinkat(AT_FDCWD, pathname);
 }
@@ -3938,7 +3939,7 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
 }
 EXPORT_SYMBOL(vfs_symlink);
 
-SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP3(symlinkat, const char __user *, oldname,
 		int, newdfd, const char __user *, newname)
 {
 	int error;
@@ -3969,7 +3970,7 @@ out_putname:
 	return error;
 }
 
-SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(symlink, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_symlinkat(oldname, AT_FDCWD, newname);
 }
@@ -4056,7 +4057,7 @@ EXPORT_SYMBOL(vfs_link);
  * with linux 2.0, and to avoid hard-linking to directories
  * and other special files.  --ADM
  */
-SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP5(linkat, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname, int, flags)
 {
 	struct dentry *new_dentry;
@@ -4121,7 +4122,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(link, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
@@ -4309,7 +4310,7 @@ out:
 }
 EXPORT_SYMBOL(vfs_rename);
 
-SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP5(renameat2, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname, unsigned int, flags)
 {
 	struct dentry *old_dentry, *new_dentry;
@@ -4452,13 +4453,13 @@ exit:
 	return error;
 }
 
-SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP4(renameat, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname)
 {
 	return sys_renameat2(olddfd, oldname, newdfd, newname, 0);
 }
 
-SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(rename, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_renameat2(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..6ba4afd 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/capability.h>
 #include <linux/mnt_namespace.h>
@@ -1592,7 +1593,7 @@ static inline bool may_mount(void)
  * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD
  */
 
-SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
+SYSCALL_DEFINE_WRAP2(umount, char __user *, name, int, flags)
 {
 	struct path path;
 	struct mount *mnt;
@@ -1637,7 +1638,7 @@ out:
 /*
  *	The 2.0 compatible umount. No flags.
  */
-SYSCALL_DEFINE1(oldumount, char __user *, name)
+SYSCALL_DEFINE_WRAP1(oldumount, char __user *, name)
 {
 	return sys_umount(name, 0);
 }
@@ -2974,7 +2975,7 @@ EXPORT_SYMBOL(path_is_under);
  *    though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
  *    first.
  */
-SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+SYSCALL_DEFINE_WRAP2(pivot_root, const char __user *, new_root,
 		const char __user *, put_old)
 {
 	struct path new, old, parent_path, root_parent, root;
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index b8d08d0..713a670 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -33,6 +33,7 @@
 #include <linux/sched.h> /* struct user */
 #include <linux/slab.h> /* struct kmem_cache */
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/types.h>
 #include <linux/anon_inodes.h>
 #include <linux/uaccess.h>
@@ -696,7 +697,7 @@ SYSCALL_DEFINE0(inotify_init)
 	return sys_inotify_init1(0);
 }
 
-SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP3(inotify_add_watch, int, fd, const char __user *, pathname,
 		u32, mask)
 {
 	struct fsnotify_group *group;
diff --git a/fs/open.c b/fs/open.c
index b6f1e96..8dae6c7 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -334,7 +334,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
  * We do this by temporarily clearing all FS-related capabilities and
  * switching the fsuid/fsgid around to the real ones.
  */
-SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
+SYSCALL_DEFINE_WRAP3(faccessat, int, dfd, const char __user *, filename, int, mode)
 {
 	const struct cred *old_cred;
 	struct cred *override_cred;
@@ -410,12 +410,12 @@ out:
 	return res;
 }
 
-SYSCALL_DEFINE2(access, const char __user *, filename, int, mode)
+SYSCALL_DEFINE_WRAP2(access, const char __user *, filename, int, mode)
 {
 	return sys_faccessat(AT_FDCWD, filename, mode);
 }
 
-SYSCALL_DEFINE1(chdir, const char __user *, filename)
+SYSCALL_DEFINE_WRAP1(chdir, const char __user *, filename)
 {
 	struct path path;
 	int error;
@@ -466,7 +466,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE1(chroot, const char __user *, filename)
+SYSCALL_DEFINE_WRAP1(chroot, const char __user *, filename)
 {
 	struct path path;
 	int error;
@@ -541,7 +541,7 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
 	return err;
 }
 
-SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode)
+SYSCALL_DEFINE_WRAP3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode)
 {
 	struct path path;
 	int error;
@@ -559,7 +559,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(chmod, const char __user *, filename, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(chmod, const char __user *, filename, umode_t, mode)
 {
 	return sys_fchmodat(AT_FDCWD, filename, mode);
 }
@@ -606,7 +606,7 @@ retry_deleg:
 	return error;
 }
 
-SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
+SYSCALL_DEFINE_WRAP5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
 		gid_t, group, int, flag)
 {
 	struct path path;
@@ -638,12 +638,12 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
+SYSCALL_DEFINE_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group)
 {
 	return sys_fchownat(AT_FDCWD, filename, user, group, 0);
 }
 
-SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
+SYSCALL_DEFINE_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
 {
 	return sys_fchownat(AT_FDCWD, filename, user, group,
 			    AT_SYMLINK_NOFOLLOW);
@@ -1058,7 +1058,7 @@ SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
  * For backward compatibility?  Maybe this should be moved
  * into arch/i386 instead?
  */
-SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(creat, const char __user *, pathname, umode_t, mode)
 {
 	return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
 }
diff --git a/fs/pipe.c b/fs/pipe.c
index 42cf8dd..07ce638 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -20,6 +20,7 @@
 #include <linux/pagemap.h>
 #include <linux/audit.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 
 #include <asm/uaccess.h>
@@ -776,7 +777,7 @@ int do_pipe_flags(int *fd, int flags)
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
  */
-SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
+SYSCALL_DEFINE_WRAP2(pipe2, int __user *, fildes, int, flags)
 {
 	struct file *files[2];
 	int fd[2];
@@ -798,7 +799,7 @@ SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
 	return error;
 }
 
-SYSCALL_DEFINE1(pipe, int __user *, fildes)
+SYSCALL_DEFINE_WRAP1(pipe, int __user *, fildes)
 {
 	return sys_pipe2(fildes, 0);
 }
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 3746367..5738db8 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/capability.h>
 #include <linux/quotaops.h>
 #include <linux/types.h>
@@ -757,7 +758,7 @@ static struct super_block *quotactl_block(const char __user *special, int cmd)
  * calls. Maybe we need to add the process quotas etc. in the future,
  * but we probably should use rlimits for that.
  */
-SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
+SYSCALL_DEFINE_WRAP4(quotactl, unsigned int, cmd, const char __user *, special,
 		qid_t, id, void __user *, addr)
 {
 	uint cmds, type;
diff --git a/fs/read_write.c b/fs/read_write.c
index 819ef3f..7e2b232 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -299,7 +299,7 @@ COMPAT_SYSCALL_DEFINE3(lseek, unsigned int, fd, compat_off_t, offset, unsigned i
 #endif
 
 #ifdef __ARCH_WANT_SYS_LLSEEK
-SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
+SYSCALL_DEFINE_WRAP5(llseek, unsigned int, fd, unsigned long, offset_high,
 		unsigned long, offset_low, loff_t __user *, result,
 		unsigned int, whence)
 {
diff --git a/fs/select.c b/fs/select.c
index 0155473..28e1ca6 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -17,6 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/poll.h>
@@ -954,7 +955,7 @@ static long do_restart_poll(struct restart_block *restart_block)
 	return ret;
 }
 
-SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
+SYSCALL_DEFINE_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
 		int, timeout_msecs)
 {
 	struct timespec end_time, *to = NULL;
diff --git a/fs/splice.c b/fs/splice.c
index 4cf700d..b0ab438 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1683,7 +1683,7 @@ COMPAT_SYSCALL_DEFINE4(vmsplice, int, fd, const struct compat_iovec __user *, io
 }
 #endif
 
-SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in,
+SYSCALL_DEFINE_WRAP6(splice, int, fd_in, loff_t __user *, off_in,
 		int, fd_out, loff_t __user *, off_out,
 		size_t, len, unsigned int, flags)
 {
@@ -2016,7 +2016,7 @@ static long do_tee(struct file *in, struct file *out, size_t len,
 	return ret;
 }
 
-SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
+SYSCALL_DEFINE_WRAP4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
 {
 	struct fd in;
 	int error;
diff --git a/fs/stat.c b/fs/stat.c
index d4a61d8..f4ddfdb 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -13,6 +13,7 @@
 #include <linux/namei.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/pagemap.h>
 
 #include <asm/uaccess.h>
@@ -312,7 +313,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
 	return error;
 }
 
-SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(readlinkat, int, dfd, const char __user *, pathname,
 		char __user *, buf, int, bufsiz)
 {
 	struct path path;
@@ -346,7 +347,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf,
+SYSCALL_DEFINE_WRAP3(readlink, const char __user *, path, char __user *, buf,
 		int, bufsiz)
 {
 	return sys_readlinkat(AT_FDCWD, path, buf, bufsiz);
diff --git a/fs/xattr.c b/fs/xattr.c
index 9b932b9..3a7223f 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -16,6 +16,7 @@
 #include <linux/security.h>
 #include <linux/evm.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/fsnotify.h>
 #include <linux/audit.h>
@@ -387,21 +388,21 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE5(setxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP5(setxattr, const char __user *, pathname,
 		const char __user *, name, const void __user *, value,
 		size_t, size, int, flags)
 {
 	return path_setxattr(pathname, name, value, size, flags, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP5(lsetxattr, const char __user *, pathname,
 		const char __user *, name, const void __user *, value,
 		size_t, size, int, flags)
 {
 	return path_setxattr(pathname, name, value, size, flags, 0);
 }
 
-SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
+SYSCALL_DEFINE_WRAP5(fsetxattr, int, fd, const char __user *, name,
 		const void __user *,value, size_t, size, int, flags)
 {
 	struct fd f = fdget(fd);
@@ -487,19 +488,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE4(getxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(getxattr, const char __user *, pathname,
 		const char __user *, name, void __user *, value, size_t, size)
 {
 	return path_getxattr(pathname, name, value, size, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(lgetxattr, const char __user *, pathname,
 		const char __user *, name, void __user *, value, size_t, size)
 {
 	return path_getxattr(pathname, name, value, size, 0);
 }
 
-SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name,
+SYSCALL_DEFINE_WRAP4(fgetxattr, int, fd, const char __user *, name,
 		void __user *, value, size_t, size)
 {
 	struct fd f = fdget(fd);
@@ -569,19 +570,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list,
+SYSCALL_DEFINE_WRAP3(listxattr, const char __user *, pathname, char __user *, list,
 		size_t, size)
 {
 	return path_listxattr(pathname, list, size, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list,
+SYSCALL_DEFINE_WRAP3(llistxattr, const char __user *, pathname, char __user *, list,
 		size_t, size)
 {
 	return path_listxattr(pathname, list, size, 0);
 }
 
-SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size)
+SYSCALL_DEFINE_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size)
 {
 	struct fd f = fdget(fd);
 	ssize_t error = -EBADF;
@@ -634,19 +635,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(removexattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP2(removexattr, const char __user *, pathname,
 		const char __user *, name)
 {
 	return path_removexattr(pathname, name, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP2(lremovexattr, const char __user *, pathname,
 		const char __user *, name)
 {
 	return path_removexattr(pathname, name, 0);
 }
 
-SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name)
+SYSCALL_DEFINE_WRAP2(fremovexattr, int, fd, const char __user *, name)
 {
 	struct fd f = fdget(fd);
 	int error = -EBADF;
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index a8380ad..705d841 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -36,43 +36,43 @@
 #define __NR_io_setup 0
 __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
 #define __NR_io_destroy 1
-__SYSCALL(__NR_io_destroy, sys_io_destroy)
+__SC_WRAP(__NR_io_destroy, sys_io_destroy)
 #define __NR_io_submit 2
 __SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)
 #define __NR_io_cancel 3
-__SYSCALL(__NR_io_cancel, sys_io_cancel)
+__SC_WRAP(__NR_io_cancel, sys_io_cancel)
 #define __NR_io_getevents 4
 __SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents)
 
 /* fs/xattr.c */
 #define __NR_setxattr 5
-__SYSCALL(__NR_setxattr, sys_setxattr)
+__SC_WRAP(__NR_setxattr, sys_setxattr)
 #define __NR_lsetxattr 6
-__SYSCALL(__NR_lsetxattr, sys_lsetxattr)
+__SC_WRAP(__NR_lsetxattr, sys_lsetxattr)
 #define __NR_fsetxattr 7
-__SYSCALL(__NR_fsetxattr, sys_fsetxattr)
+__SC_WRAP(__NR_fsetxattr, sys_fsetxattr)
 #define __NR_getxattr 8
-__SYSCALL(__NR_getxattr, sys_getxattr)
+__SC_WRAP(__NR_getxattr, sys_getxattr)
 #define __NR_lgetxattr 9
-__SYSCALL(__NR_lgetxattr, sys_lgetxattr)
+__SC_WRAP(__NR_lgetxattr, sys_lgetxattr)
 #define __NR_fgetxattr 10
-__SYSCALL(__NR_fgetxattr, sys_fgetxattr)
+__SC_WRAP(__NR_fgetxattr, sys_fgetxattr)
 #define __NR_listxattr 11
-__SYSCALL(__NR_listxattr, sys_listxattr)
+__SC_WRAP(__NR_listxattr, sys_listxattr)
 #define __NR_llistxattr 12
-__SYSCALL(__NR_llistxattr, sys_llistxattr)
+__SC_WRAP(__NR_llistxattr, sys_llistxattr)
 #define __NR_flistxattr 13
-__SYSCALL(__NR_flistxattr, sys_flistxattr)
+__SC_WRAP(__NR_flistxattr, sys_flistxattr)
 #define __NR_removexattr 14
-__SYSCALL(__NR_removexattr, sys_removexattr)
+__SC_WRAP(__NR_removexattr, sys_removexattr)
 #define __NR_lremovexattr 15
-__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
+__SC_WRAP(__NR_lremovexattr, sys_lremovexattr)
 #define __NR_fremovexattr 16
-__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
+__SC_WRAP(__NR_fremovexattr, sys_fremovexattr)
 
 /* fs/dcache.c */
 #define __NR_getcwd 17
-__SYSCALL(__NR_getcwd, sys_getcwd)
+__SC_WRAP(__NR_getcwd, sys_getcwd)
 
 /* fs/cookies.c */
 #define __NR_lookup_dcookie 18
@@ -86,7 +86,7 @@ __SYSCALL(__NR_eventfd2, sys_eventfd2)
 #define __NR_epoll_create1 20
 __SYSCALL(__NR_epoll_create1, sys_epoll_create1)
 #define __NR_epoll_ctl 21
-__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
+__SC_WRAP(__NR_epoll_ctl, sys_epoll_ctl)
 #define __NR_epoll_pwait 22
 __SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait)
 
@@ -102,7 +102,7 @@ __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
 #define __NR_inotify_init1 26
 __SYSCALL(__NR_inotify_init1, sys_inotify_init1)
 #define __NR_inotify_add_watch 27
-__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
+__SC_WRAP(__NR_inotify_add_watch, sys_inotify_add_watch)
 #define __NR_inotify_rm_watch 28
 __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
 
@@ -122,17 +122,17 @@ __SYSCALL(__NR_flock, sys_flock)
 
 /* fs/namei.c */
 #define __NR_mknodat 33
-__SYSCALL(__NR_mknodat, sys_mknodat)
+__SC_WRAP(__NR_mknodat, sys_mknodat)
 #define __NR_mkdirat 34
-__SYSCALL(__NR_mkdirat, sys_mkdirat)
+__SC_WRAP(__NR_mkdirat, sys_mkdirat)
 #define __NR_unlinkat 35
-__SYSCALL(__NR_unlinkat, sys_unlinkat)
+__SC_WRAP(__NR_unlinkat, sys_unlinkat)
 #define __NR_symlinkat 36
-__SYSCALL(__NR_symlinkat, sys_symlinkat)
+__SC_WRAP(__NR_symlinkat, sys_symlinkat)
 #define __NR_linkat 37
-__SYSCALL(__NR_linkat, sys_linkat)
+__SC_WRAP(__NR_linkat, sys_linkat)
 #define __NR_renameat 38
-__SYSCALL(__NR_renameat, sys_renameat)
+__SC_WRAP(__NR_renameat, sys_renameat)
 
 /* fs/namespace.c */
 #define __NR_umount2 39
@@ -140,7 +140,7 @@ __SYSCALL(__NR_umount2, sys_umount)
 #define __NR_mount 40
 __SC_COMP(__NR_mount, sys_mount, compat_sys_mount)
 #define __NR_pivot_root 41
-__SYSCALL(__NR_pivot_root, sys_pivot_root)
+__SC_WRAP(__NR_pivot_root, sys_pivot_root)
 
 /* fs/nfsctl.c */
 #define __NR_nfsservctl 42
@@ -163,19 +163,19 @@ __SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \
 #define __NR_fallocate 47
 __SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate)
 #define __NR_faccessat 48
-__SYSCALL(__NR_faccessat, sys_faccessat)
+__SC_WRAP(__NR_faccessat, sys_faccessat)
 #define __NR_chdir 49
-__SYSCALL(__NR_chdir, sys_chdir)
+__SC_WRAP(__NR_chdir, sys_chdir)
 #define __NR_fchdir 50
 __SYSCALL(__NR_fchdir, sys_fchdir)
 #define __NR_chroot 51
-__SYSCALL(__NR_chroot, sys_chroot)
+__SC_WRAP(__NR_chroot, sys_chroot)
 #define __NR_fchmod 52
 __SYSCALL(__NR_fchmod, sys_fchmod)
 #define __NR_fchmodat 53
-__SYSCALL(__NR_fchmodat, sys_fchmodat)
+__SC_WRAP(__NR_fchmodat, sys_fchmodat)
 #define __NR_fchownat 54
-__SYSCALL(__NR_fchownat, sys_fchownat)
+__SC_WRAP(__NR_fchownat, sys_fchownat)
 #define __NR_fchown 55
 __SYSCALL(__NR_fchown, sys_fchown)
 #define __NR_openat 56
@@ -187,11 +187,11 @@ __SYSCALL(__NR_vhangup, sys_vhangup)
 
 /* fs/pipe.c */
 #define __NR_pipe2 59
-__SYSCALL(__NR_pipe2, sys_pipe2)
+__SC_WRAP(__NR_pipe2, sys_pipe2)
 
 /* fs/quota.c */
 #define __NR_quotactl 60
-__SYSCALL(__NR_quotactl, sys_quotactl)
+__SC_WRAP(__NR_quotactl, sys_quotactl)
 
 /* fs/readdir.c */
 #define __NR_getdents64 61
@@ -236,13 +236,13 @@ __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4)
 #define __NR_vmsplice 75
 __SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice)
 #define __NR_splice 76
-__SYSCALL(__NR_splice, sys_splice)
+__SC_WRAP(__NR_splice, sys_splice)
 #define __NR_tee 77
-__SYSCALL(__NR_tee, sys_tee)
+__SC_WRAP(__NR_tee, sys_tee)
 
 /* fs/stat.c */
 #define __NR_readlinkat 78
-__SYSCALL(__NR_readlinkat, sys_readlinkat)
+__SC_WRAP(__NR_readlinkat, sys_readlinkat)
 #define __NR3264_fstatat 79
 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
 #define __NR3264_fstat 80
@@ -281,13 +281,13 @@ __SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat)
 
 /* kernel/acct.c */
 #define __NR_acct 89
-__SYSCALL(__NR_acct, sys_acct)
+__SC_WRAP(__NR_acct, sys_acct)
 
 /* kernel/capability.c */
 #define __NR_capget 90
-__SYSCALL(__NR_capget, sys_capget)
+__SC_WRAP(__NR_capget, sys_capget)
 #define __NR_capset 91
-__SYSCALL(__NR_capset, sys_capset)
+__SC_WRAP(__NR_capset, sys_capset)
 
 /* kernel/exec_domain.c */
 #define __NR_personality 92
@@ -303,9 +303,9 @@ __SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid)
 
 /* kernel/fork.c */
 #define __NR_set_tid_address 96
-__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
+__SC_WRAP(__NR_set_tid_address, sys_set_tid_address)
 #define __NR_unshare 97
-__SYSCALL(__NR_unshare, sys_unshare)
+__SC_WRAP(__NR_unshare, sys_unshare)
 
 /* kernel/futex.c */
 #define __NR_futex 98
@@ -333,9 +333,9 @@ __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
 
 /* kernel/module.c */
 #define __NR_init_module 105
-__SYSCALL(__NR_init_module, sys_init_module)
+__SC_WRAP(__NR_init_module, sys_init_module)
 #define __NR_delete_module 106
-__SYSCALL(__NR_delete_module, sys_delete_module)
+__SC_WRAP(__NR_delete_module, sys_delete_module)
 
 /* kernel/posix-timers.c */
 #define __NR_timer_create 107
@@ -360,7 +360,7 @@ __SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \
 
 /* kernel/printk.c */
 #define __NR_syslog 116
-__SYSCALL(__NR_syslog, sys_syslog)
+__SC_WRAP(__NR_syslog, sys_syslog)
 
 /* kernel/ptrace.c */
 #define __NR_ptrace 117
@@ -368,13 +368,13 @@ __SYSCALL(__NR_ptrace, sys_ptrace)
 
 /* kernel/sched/core.c */
 #define __NR_sched_setparam 118
-__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
+__SC_WRAP(__NR_sched_setparam, sys_sched_setparam)
 #define __NR_sched_setscheduler 119
-__SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler)
+__SC_WRAP(__NR_sched_setscheduler, sys_sched_setscheduler)
 #define __NR_sched_getscheduler 120
 __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler)
 #define __NR_sched_getparam 121
-__SYSCALL(__NR_sched_getparam, sys_sched_getparam)
+__SC_WRAP(__NR_sched_getparam, sys_sched_getparam)
 #define __NR_sched_setaffinity 122
 __SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \
 	  compat_sys_sched_setaffinity)
@@ -425,7 +425,7 @@ __SYSCALL(__NR_setpriority, sys_setpriority)
 #define __NR_getpriority 141
 __SYSCALL(__NR_getpriority, sys_getpriority)
 #define __NR_reboot 142
-__SYSCALL(__NR_reboot, sys_reboot)
+__SC_WRAP(__NR_reboot, sys_reboot)
 #define __NR_setregid 143
 __SYSCALL(__NR_setregid, sys_setregid)
 #define __NR_setgid 144
@@ -437,11 +437,11 @@ __SYSCALL(__NR_setuid, sys_setuid)
 #define __NR_setresuid 147
 __SYSCALL(__NR_setresuid, sys_setresuid)
 #define __NR_getresuid 148
-__SYSCALL(__NR_getresuid, sys_getresuid)
+__SC_WRAP(__NR_getresuid, sys_getresuid)
 #define __NR_setresgid 149
 __SYSCALL(__NR_setresgid, sys_setresgid)
 #define __NR_getresgid 150
-__SYSCALL(__NR_getresgid, sys_getresgid)
+__SC_WRAP(__NR_getresgid, sys_getresgid)
 #define __NR_setfsuid 151
 __SYSCALL(__NR_setfsuid, sys_setfsuid)
 #define __NR_setfsgid 152
@@ -457,15 +457,15 @@ __SYSCALL(__NR_getsid, sys_getsid)
 #define __NR_setsid 157
 __SYSCALL(__NR_setsid, sys_setsid)
 #define __NR_getgroups 158
-__SYSCALL(__NR_getgroups, sys_getgroups)
+__SC_WRAP(__NR_getgroups, sys_getgroups)
 #define __NR_setgroups 159
-__SYSCALL(__NR_setgroups, sys_setgroups)
+__SC_WRAP(__NR_setgroups, sys_setgroups)
 #define __NR_uname 160
-__SYSCALL(__NR_uname, sys_newuname)
+__SC_WRAP(__NR_uname, sys_newuname)
 #define __NR_sethostname 161
-__SYSCALL(__NR_sethostname, sys_sethostname)
+__SC_WRAP(__NR_sethostname, sys_sethostname)
 #define __NR_setdomainname 162
-__SYSCALL(__NR_setdomainname, sys_setdomainname)
+__SC_WRAP(__NR_setdomainname, sys_setdomainname)
 #define __NR_getrlimit 163
 __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
 #define __NR_setrlimit 164
@@ -475,9 +475,9 @@ __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
 #define __NR_umask 166
 __SYSCALL(__NR_umask, sys_umask)
 #define __NR_prctl 167
-__SYSCALL(__NR_prctl, sys_prctl)
+__SC_WRAP(__NR_prctl, sys_prctl)
 #define __NR_getcpu 168
-__SYSCALL(__NR_getcpu, sys_getcpu)
+__SC_WRAP(__NR_getcpu, sys_getcpu)
 
 /* kernel/time.c */
 #define __NR_gettimeofday 169
@@ -509,7 +509,7 @@ __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)
 #define __NR_mq_open 180
 __SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)
 #define __NR_mq_unlink 181
-__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
+__SC_WRAP(__NR_mq_unlink, sys_mq_unlink)
 #define __NR_mq_timedsend 182
 __SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend)
 #define __NR_mq_timedreceive 183
@@ -554,21 +554,21 @@ __SYSCALL(__NR_shmdt, sys_shmdt)
 #define __NR_socket 198
 __SYSCALL(__NR_socket, sys_socket)
 #define __NR_socketpair 199
-__SYSCALL(__NR_socketpair, sys_socketpair)
+__SC_WRAP(__NR_socketpair, sys_socketpair)
 #define __NR_bind 200
-__SYSCALL(__NR_bind, sys_bind)
+__SC_WRAP(__NR_bind, sys_bind)
 #define __NR_listen 201
 __SYSCALL(__NR_listen, sys_listen)
 #define __NR_accept 202
 __SYSCALL(__NR_accept, sys_accept)
 #define __NR_connect 203
-__SYSCALL(__NR_connect, sys_connect)
+__SC_WRAP(__NR_connect, sys_connect)
 #define __NR_getsockname 204
-__SYSCALL(__NR_getsockname, sys_getsockname)
+__SC_WRAP(__NR_getsockname, sys_getsockname)
 #define __NR_getpeername 205
-__SYSCALL(__NR_getpeername, sys_getpeername)
+__SC_WRAP(__NR_getpeername, sys_getpeername)
 #define __NR_sendto 206
-__SYSCALL(__NR_sendto, sys_sendto)
+__SC_WRAP(__NR_sendto, sys_sendto)
 #define __NR_recvfrom 207
 __SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom)
 #define __NR_setsockopt 208
@@ -588,23 +588,23 @@ __SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead)
 
 /* mm/nommu.c, also with MMU */
 #define __NR_brk 214
-__SYSCALL(__NR_brk, sys_brk)
+__SC_WRAP(__NR_brk, sys_brk)
 #define __NR_munmap 215
-__SYSCALL(__NR_munmap, sys_munmap)
+__SC_WRAP(__NR_munmap, sys_munmap)
 #define __NR_mremap 216
-__SYSCALL(__NR_mremap, sys_mremap)
+__SC_WRAP(__NR_mremap, sys_mremap)
 
 /* security/keys/keyctl.c */
 #define __NR_add_key 217
-__SYSCALL(__NR_add_key, sys_add_key)
+__SC_WRAP(__NR_add_key, sys_add_key)
 #define __NR_request_key 218
-__SYSCALL(__NR_request_key, sys_request_key)
+__SC_WRAP(__NR_request_key, sys_request_key)
 #define __NR_keyctl 219
 __SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl)
 
 /* arch/example/kernel/sys_example.c */
 #define __NR_clone 220
-__SYSCALL(__NR_clone, sys_clone)
+__SC_WRAP(__NR_clone, sys_clone)
 #define __NR_execve 221
 __SC_COMP(__NR_execve, sys_execve, compat_sys_execve)
 
@@ -617,27 +617,27 @@ __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
 /* mm/, CONFIG_MMU only */
 #ifndef __ARCH_NOMMU
 #define __NR_swapon 224
-__SYSCALL(__NR_swapon, sys_swapon)
+__SC_WRAP(__NR_swapon, sys_swapon)
 #define __NR_swapoff 225
-__SYSCALL(__NR_swapoff, sys_swapoff)
+__SC_WRAP(__NR_swapoff, sys_swapoff)
 #define __NR_mprotect 226
-__SYSCALL(__NR_mprotect, sys_mprotect)
+__SC_WRAP(__NR_mprotect, sys_mprotect)
 #define __NR_msync 227
-__SYSCALL(__NR_msync, sys_msync)
+__SC_WRAP(__NR_msync, sys_msync)
 #define __NR_mlock 228
-__SYSCALL(__NR_mlock, sys_mlock)
+__SC_WRAP(__NR_mlock, sys_mlock)
 #define __NR_munlock 229
-__SYSCALL(__NR_munlock, sys_munlock)
+__SC_WRAP(__NR_munlock, sys_munlock)
 #define __NR_mlockall 230
 __SYSCALL(__NR_mlockall, sys_mlockall)
 #define __NR_munlockall 231
 __SYSCALL(__NR_munlockall, sys_munlockall)
 #define __NR_mincore 232
-__SYSCALL(__NR_mincore, sys_mincore)
+__SC_WRAP(__NR_mincore, sys_mincore)
 #define __NR_madvise 233
-__SYSCALL(__NR_madvise, sys_madvise)
+__SC_WRAP(__NR_madvise, sys_madvise)
 #define __NR_remap_file_pages 234
-__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
+__SC_WRAP(__NR_remap_file_pages, sys_remap_file_pages)
 #define __NR_mbind 235
 __SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind)
 #define __NR_get_mempolicy 236
@@ -654,9 +654,9 @@ __SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages)
 __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \
 	  compat_sys_rt_tgsigqueueinfo)
 #define __NR_perf_event_open 241
-__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
+__SC_WRAP(__NR_perf_event_open, sys_perf_event_open)
 #define __NR_accept4 242
-__SYSCALL(__NR_accept4, sys_accept4)
+__SC_WRAP(__NR_accept4, sys_accept4)
 #define __NR_recvmmsg 243
 __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
 
@@ -669,13 +669,13 @@ __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
 #define __NR_wait4 260
 __SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)
 #define __NR_prlimit64 261
-__SYSCALL(__NR_prlimit64, sys_prlimit64)
+__SC_WRAP(__NR_prlimit64, sys_prlimit64)
 #define __NR_fanotify_init 262
 __SYSCALL(__NR_fanotify_init, sys_fanotify_init)
 #define __NR_fanotify_mark 263
 __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
 #define __NR_name_to_handle_at         264
-__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
+__SC_WRAP(__NR_name_to_handle_at, sys_name_to_handle_at)
 #define __NR_open_by_handle_at         265
 __SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \
 	  compat_sys_open_by_handle_at)
@@ -694,23 +694,23 @@ __SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \
 __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \
           compat_sys_process_vm_writev)
 #define __NR_kcmp 272
-__SYSCALL(__NR_kcmp, sys_kcmp)
+__SC_WRAP(__NR_kcmp, sys_kcmp)
 #define __NR_finit_module 273
-__SYSCALL(__NR_finit_module, sys_finit_module)
+__SC_WRAP(__NR_finit_module, sys_finit_module)
 #define __NR_sched_setattr 274
-__SYSCALL(__NR_sched_setattr, sys_sched_setattr)
+__SC_WRAP(__NR_sched_setattr, sys_sched_setattr)
 #define __NR_sched_getattr 275
-__SYSCALL(__NR_sched_getattr, sys_sched_getattr)
+__SC_WRAP(__NR_sched_getattr, sys_sched_getattr)
 #define __NR_renameat2 276
-__SYSCALL(__NR_renameat2, sys_renameat2)
+__SC_WRAP(__NR_renameat2, sys_renameat2)
 #define __NR_seccomp 277
-__SYSCALL(__NR_seccomp, sys_seccomp)
+__SC_WRAP(__NR_seccomp, sys_seccomp)
 #define __NR_getrandom 278
-__SYSCALL(__NR_getrandom, sys_getrandom)
+__SC_WRAP(__NR_getrandom, sys_getrandom)
 #define __NR_memfd_create 279
-__SYSCALL(__NR_memfd_create, sys_memfd_create)
+__SC_WRAP(__NR_memfd_create, sys_memfd_create)
 #define __NR_bpf 280
-__SYSCALL(__NR_bpf, sys_bpf)
+__SC_WRAP(__NR_bpf, sys_bpf)
 #define __NR_execveat 281
 __SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
 #define __NR_userfaultfd 282
@@ -718,7 +718,7 @@ __SYSCALL(__NR_userfaultfd, sys_userfaultfd)
 #define __NR_membarrier 283
 __SYSCALL(__NR_membarrier, sys_membarrier)
 #define __NR_mlock2 284
-__SYSCALL(__NR_mlock2, sys_mlock2)
+__SC_WRAP(__NR_mlock2, sys_mlock2)
 
 #undef __NR_syscalls
 #define __NR_syscalls 285
@@ -735,29 +735,29 @@ __SYSCALL(__NR_mlock2, sys_mlock2)
 #define __NR_open 1024
 __SYSCALL(__NR_open, sys_open)
 #define __NR_link 1025
-__SYSCALL(__NR_link, sys_link)
+__SC_WRAP(__NR_link, sys_link)
 #define __NR_unlink 1026
-__SYSCALL(__NR_unlink, sys_unlink)
+__SC_WRAP(__NR_unlink, sys_unlink)
 #define __NR_mknod 1027
-__SYSCALL(__NR_mknod, sys_mknod)
+__SC_WRAP(__NR_mknod, sys_mknod)
 #define __NR_chmod 1028
-__SYSCALL(__NR_chmod, sys_chmod)
+__SC_WRAP(__NR_chmod, sys_chmod)
 #define __NR_chown 1029
-__SYSCALL(__NR_chown, sys_chown)
+__SC_WRAP(__NR_chown, sys_chown)
 #define __NR_mkdir 1030
-__SYSCALL(__NR_mkdir, sys_mkdir)
+__SC_WRAP(__NR_mkdir, sys_mkdir)
 #define __NR_rmdir 1031
-__SYSCALL(__NR_rmdir, sys_rmdir)
+__SC_WRAP(__NR_rmdir, sys_rmdir)
 #define __NR_lchown 1032
-__SYSCALL(__NR_lchown, sys_lchown)
+__SC_WRAP(__NR_lchown, sys_lchown)
 #define __NR_access 1033
-__SYSCALL(__NR_access, sys_access)
+__SC_WRAP(__NR_access, sys_access)
 #define __NR_rename 1034
-__SYSCALL(__NR_rename, sys_rename)
+__SC_WRAP(__NR_rename, sys_rename)
 #define __NR_readlink 1035
-__SYSCALL(__NR_readlink, sys_readlink)
+__SC_WRAP(__NR_readlink, sys_readlink)
 #define __NR_symlink 1036
-__SYSCALL(__NR_symlink, sys_symlink)
+__SC_WRAP(__NR_symlink, sys_symlink)
 #define __NR_utimes 1037
 __SYSCALL(__NR_utimes, sys_utimes)
 #define __NR3264_stat 1038
@@ -771,7 +771,7 @@ __SC_3264(__NR3264_lstat, sys_lstat64, sys_newlstat)
 
 #ifdef __ARCH_WANT_SYSCALL_NO_FLAGS
 #define __NR_pipe 1040
-__SYSCALL(__NR_pipe, sys_pipe)
+__SC_WRAP(__NR_pipe, sys_pipe)
 #define __NR_dup2 1041
 __SYSCALL(__NR_dup2, sys_dup2)
 #define __NR_epoll_create 1042
@@ -841,7 +841,7 @@ __SYSCALL(__NR_time, sys_time)
 __SYSCALL(__NR_utime, sys_utime)
 
 #define __NR_creat 1064
-__SYSCALL(__NR_creat, sys_creat)
+__SC_WRAP(__NR_creat, sys_creat)
 #define __NR_getdents 1065
 #define __ARCH_WANT_SYS_GETDENTS
 __SYSCALL(__NR_getdents, sys_getdents)
@@ -851,9 +851,9 @@ __SYSCALL(__NR_futimesat, sys_futimesat)
 #define __ARCH_WANT_SYS_SELECT
 __SYSCALL(__NR_select, sys_select)
 #define __NR_poll 1068
-__SYSCALL(__NR_poll, sys_poll)
+__SC_WRAP(__NR_poll, sys_poll)
 #define __NR_epoll_wait 1069
-__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
+__SC_WRAP(__NR_epoll_wait, sys_epoll_wait)
 #define __NR_ustat 1070
 __SYSCALL(__NR_ustat, sys_ustat)
 #define __NR_vfork 1071
@@ -865,12 +865,12 @@ __SYSCALL(__NR_recv, sys_recv)
 #define __NR_send 1074
 __SYSCALL(__NR_send, sys_send)
 #define __NR_bdflush 1075
-__SYSCALL(__NR_bdflush, sys_bdflush)
+__SC_WRAP(__NR_bdflush, sys_bdflush)
 #define __NR_umount 1076
-__SYSCALL(__NR_umount, sys_oldumount)
+__SC_WRAP(__NR_umount, sys_oldumount)
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __NR_uselib 1077
-__SYSCALL(__NR_uselib, sys_uselib)
+__SC_WRAP(__NR_uselib, sys_uselib)
 #define __NR__sysctl 1078
 __SYSCALL(__NR__sysctl, sys_sysctl)
 
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 161a180..01b8d15 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -27,6 +27,7 @@
 #include <linux/vmalloc.h>
 #include <linux/netlink.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/audit.h>
 #include <linux/signal.h>
 #include <linux/mutex.h>
@@ -849,7 +850,7 @@ out_putname:
 	return fd;
 }
 
-SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
+SYSCALL_DEFINE_WRAP1(mq_unlink, const char __user *, u_name)
 {
 	int err;
 	struct filename *name;
diff --git a/kernel/acct.c b/kernel/acct.c
index 74963d1..76fc391 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -54,6 +54,7 @@
 #include <linux/jiffies.h>
 #include <linux/times.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mount.h>
 #include <linux/uaccess.h>
 #include <asm/div64.h>
@@ -267,7 +268,7 @@ static DEFINE_MUTEX(acct_on_mutex);
  * should be written. If the filename is NULL, accounting will be
  * shutdown.
  */
-SYSCALL_DEFINE1(acct, const char __user *, name)
+SYSCALL_DEFINE_WRAP1(acct, const char __user *, name)
 {
 	int error = 0;
 
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 3b39550..bfd5e87 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -11,6 +11,7 @@
  */
 #include <linux/bpf.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/anon_inodes.h>
 #include <linux/file.h>
@@ -706,7 +707,7 @@ static int bpf_obj_get(const union bpf_attr *attr)
 	return bpf_obj_get_user(u64_to_ptr(attr->pathname));
 }
 
-SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
+SYSCALL_DEFINE_WRAP3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
 {
 	union bpf_attr attr = {};
 	int err;
diff --git a/kernel/capability.c b/kernel/capability.c
index 45432b5..f353690 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -15,6 +15,7 @@
 #include <linux/export.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/pid_namespace.h>
 #include <linux/user_namespace.h>
 #include <asm/uaccess.h>
@@ -146,7 +147,7 @@ static inline int cap_get_target_pid(pid_t pid, kernel_cap_t *pEp,
  *
  * Returns 0 on success and < 0 on error.
  */
-SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
+SYSCALL_DEFINE_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
 {
 	int ret = 0;
 	pid_t pid;
@@ -220,7 +221,7 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
  *
  * Returns 0 on success and < 0 on error.
  */
-SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
+SYSCALL_DEFINE_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data)
 {
 	struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
 	unsigned i, tocopy, copybytes;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index cfc227c..7b35332 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8243,7 +8243,7 @@ static int perf_event_set_clock(struct perf_event *event, clockid_t clk_id)
  * @cpu:		target cpu
  * @group_fd:		group leader event fd
  */
-SYSCALL_DEFINE5(perf_event_open,
+SYSCALL_DEFINE_WRAP5(perf_event_open,
 		struct perf_event_attr __user *, attr_uptr,
 		pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
 {
diff --git a/kernel/fork.c b/kernel/fork.c
index 1155eac..6bd4aff 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1196,7 +1196,7 @@ static void copy_seccomp(struct task_struct *p)
 #endif
 }
 
-SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)
+SYSCALL_DEFINE_WRAP1(set_tid_address, int __user *, tidptr)
 {
 	current->clear_child_tid = tidptr;
 
@@ -1806,23 +1806,23 @@ SYSCALL_DEFINE0(vfork)
 
 #ifdef __ARCH_WANT_SYS_CLONE
 #ifdef CONFIG_CLONE_BACKWARDS
-SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, clone_flags, unsigned long, newsp,
 		 int __user *, parent_tidptr,
 		 unsigned long, tls,
 		 int __user *, child_tidptr)
 #elif defined(CONFIG_CLONE_BACKWARDS2)
-SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, newsp, unsigned long, clone_flags,
 		 int __user *, parent_tidptr,
 		 int __user *, child_tidptr,
 		 unsigned long, tls)
 #elif defined(CONFIG_CLONE_BACKWARDS3)
-SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP6(clone, unsigned long, clone_flags, unsigned long, newsp,
 		int, stack_size,
 		int __user *, parent_tidptr,
 		int __user *, child_tidptr,
 		unsigned long, tls)
 #else
-SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, clone_flags, unsigned long, newsp,
 		 int __user *, parent_tidptr,
 		 int __user *, child_tidptr,
 		 unsigned long, tls)
@@ -1953,7 +1953,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp
  * constructed. Here we are modifying the current, active,
  * task_struct.
  */
-SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
+SYSCALL_DEFINE_WRAP1(unshare, unsigned long, unshare_flags)
 {
 	struct fs_struct *fs, *new_fs = NULL;
 	struct files_struct *fd, *new_fd = NULL;
diff --git a/kernel/groups.c b/kernel/groups.c
index 74d431d..b92dd33 100644
--- a/kernel/groups.c
+++ b/kernel/groups.c
@@ -6,6 +6,7 @@
 #include <linux/slab.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/user_namespace.h>
 #include <asm/uaccess.h>
 
@@ -187,7 +188,7 @@ int set_current_groups(struct group_info *group_info)
 
 EXPORT_SYMBOL(set_current_groups);
 
-SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
+SYSCALL_DEFINE_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
 	const struct cred *cred = current_cred();
 	int i;
@@ -224,7 +225,7 @@ bool may_setgroups(void)
  *	without another task interfering.
  */
 
-SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
+SYSCALL_DEFINE_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
 	struct group_info *group_info;
 	int retval;
diff --git a/kernel/kcmp.c b/kernel/kcmp.c
index 0aa69ea..deca910 100644
--- a/kernel/kcmp.c
+++ b/kernel/kcmp.c
@@ -1,5 +1,6 @@
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fdtable.h>
 #include <linux/string.h>
 #include <linux/random.h>
@@ -94,7 +95,7 @@ static int kcmp_lock(struct mutex *m1, struct mutex *m2)
 	return err;
 }
 
-SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
+SYSCALL_DEFINE_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
 		unsigned long, idx1, unsigned long, idx2)
 {
 	struct task_struct *task1, *task2;
diff --git a/kernel/module.c b/kernel/module.c
index 38c7bd5..89fcca7 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -32,6 +32,7 @@
 #include <linux/security.h>
 #include <linux/seq_file.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 #include <linux/rcupdate.h>
 #include <linux/capability.h>
@@ -947,7 +948,7 @@ EXPORT_SYMBOL(module_refcount);
 /* This exists whether we can unload or not */
 static void free_module(struct module *mod);
 
-SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
+SYSCALL_DEFINE_WRAP2(delete_module, const char __user *, name_user,
 		unsigned int, flags)
 {
 	struct module *mod;
@@ -3586,7 +3587,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
 	return err;
 }
 
-SYSCALL_DEFINE3(init_module, void __user *, umod,
+SYSCALL_DEFINE_WRAP3(init_module, void __user *, umod,
 		unsigned long, len, const char __user *, uargs)
 {
 	int err;
@@ -3606,7 +3607,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
 	return load_module(&info, uargs, 0);
 }
 
-SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
+SYSCALL_DEFINE_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags)
 {
 	int err;
 	struct load_info info = { };
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 2ce8826..156f37e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -33,6 +33,7 @@
 #include <linux/bootmem.h>
 #include <linux/memblock.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/kexec.h>
 #include <linux/kdb.h>
 #include <linux/ratelimit.h>
@@ -1420,7 +1421,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len)
+SYSCALL_DEFINE_WRAP3(syslog, int, type, char __user *, buf, int, len)
 {
 	return do_syslog(type, buf, len, SYSLOG_FROM_READER);
 }
diff --git a/kernel/reboot.c b/kernel/reboot.c
index bd30a97..70e4537 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -14,6 +14,7 @@
 #include <linux/reboot.h>
 #include <linux/suspend.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/syscore_ops.h>
 #include <linux/uaccess.h>
 
@@ -277,7 +278,7 @@ static DEFINE_MUTEX(reboot_mutex);
  *
  * reboot doesn't sync: do that yourself before calling this.
  */
-SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
+SYSCALL_DEFINE_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd,
 		void __user *, arg)
 {
 	struct pid_namespace *pid_ns = task_active_pid_ns(current);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 732e993..1f20193 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -58,6 +58,7 @@
 #include <linux/seq_file.h>
 #include <linux/sysctl.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/times.h>
 #include <linux/tsacct_kern.h>
 #include <linux/kprobes.h>
@@ -4184,7 +4185,7 @@ err_size:
  *
  * Return: 0 on success. An error code otherwise.
  */
-SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy,
+SYSCALL_DEFINE_WRAP3(sched_setscheduler, pid_t, pid, int, policy,
 		struct sched_param __user *, param)
 {
 	/* negative values for policy are not valid */
@@ -4201,7 +4202,7 @@ SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy,
  *
  * Return: 0 on success. An error code otherwise.
  */
-SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
+SYSCALL_DEFINE_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
 {
 	return do_sched_setscheduler(pid, SETPARAM_POLICY, param);
 }
@@ -4212,7 +4213,7 @@ SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
  * @uattr: structure containing the extended parameters.
  * @flags: for future extension.
  */
-SYSCALL_DEFINE3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
+SYSCALL_DEFINE_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
 			       unsigned int, flags)
 {
 	struct sched_attr attr;
@@ -4275,7 +4276,7 @@ SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid)
  * Return: On success, 0 and the RT priority is in @param. Otherwise, an error
  * code.
  */
-SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
+SYSCALL_DEFINE_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
 {
 	struct sched_param lp = { .sched_priority = 0 };
 	struct task_struct *p;
@@ -4353,7 +4354,7 @@ static int sched_read_attr(struct sched_attr __user *uattr,
  * @size: sizeof(attr) for fwd/bwd comp.
  * @flags: for future extension.
  */
-SYSCALL_DEFINE4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
+SYSCALL_DEFINE_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
 		unsigned int, size, unsigned int, flags)
 {
 	struct sched_attr attr = {
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 580ac2d..b9cb4f5 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -829,7 +829,7 @@ static long do_seccomp(unsigned int op, unsigned int flags,
 	}
 }
 
-SYSCALL_DEFINE3(seccomp, unsigned int, op, unsigned int, flags,
+SYSCALL_DEFINE_WRAP3(seccomp, unsigned int, op, unsigned int, flags,
 			 const char __user *, uargs)
 {
 	return do_seccomp(op, flags, uargs);
diff --git a/kernel/signal.c b/kernel/signal.c
index f3f1f7a..476de6d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3475,7 +3475,7 @@ SYSCALL_DEFINE1(ssetmask, int, newmask)
 /*
  * For backwards compatibility.  Functionality superseded by sigaction.
  */
-SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
+SYSCALL_DEFINE_WRAP2(signal, int, sig, __sighandler_t, handler)
 {
 	struct k_sigaction new_sa, old_sa;
 	int ret;
@@ -3556,7 +3556,7 @@ COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_
 #endif
 
 #ifdef CONFIG_OLD_SIGSUSPEND
-SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
+SYSCALL_DEFINE_WRAP1(sigsuspend, old_sigset_t, mask)
 {
 	sigset_t blocked;
 	siginitset(&blocked, mask);
@@ -3564,7 +3564,7 @@ SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
 }
 #endif
 #ifdef CONFIG_OLD_SIGSUSPEND3
-SYSCALL_DEFINE3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask)
+SYSCALL_DEFINE_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask)
 {
 	sigset_t blocked;
 	siginitset(&blocked, mask);
diff --git a/kernel/sys.c b/kernel/sys.c
index 6af9212..c5689dd 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -642,7 +642,7 @@ error:
 	return retval;
 }
 
-SYSCALL_DEFINE3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t __user *, suidp)
+SYSCALL_DEFINE_WRAP3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t __user *, suidp)
 {
 	const struct cred *cred = current_cred();
 	int retval;
@@ -716,7 +716,7 @@ error:
 	return retval;
 }
 
-SYSCALL_DEFINE3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp)
+SYSCALL_DEFINE_WRAP3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp)
 {
 	const struct cred *cred = current_cred();
 	int retval;
@@ -1138,7 +1138,7 @@ static int override_release(char __user *release, size_t len)
 	return ret;
 }
 
-SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
+SYSCALL_DEFINE_WRAP1(newuname, struct new_utsname __user *, name)
 {
 	int errno = 0;
 
@@ -1212,7 +1212,7 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
 }
 #endif
 
-SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
+SYSCALL_DEFINE_WRAP2(sethostname, char __user *, name, int, len)
 {
 	int errno;
 	char tmp[__NEW_UTS_LEN];
@@ -1263,7 +1263,7 @@ SYSCALL_DEFINE2(gethostname, char __user *, name, int, len)
  * Only setdomainname; getdomainname can be implemented by calling
  * uname()
  */
-SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
+SYSCALL_DEFINE_WRAP2(setdomainname, char __user *, name, int, len)
 {
 	int errno;
 	char tmp[__NEW_UTS_LEN];
@@ -1445,7 +1445,7 @@ static int check_prlimit_permission(struct task_struct *task)
 	return -EPERM;
 }
 
-SYSCALL_DEFINE4(prlimit64, pid_t, pid, unsigned int, resource,
+SYSCALL_DEFINE_WRAP4(prlimit64, pid_t, pid, unsigned int, resource,
 		const struct rlimit64 __user *, new_rlim,
 		struct rlimit64 __user *, old_rlim)
 {
@@ -2072,7 +2072,7 @@ static int prctl_get_tid_address(struct task_struct *me, int __user **tid_addr)
 }
 #endif
 
-SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
+SYSCALL_DEFINE_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 		unsigned long, arg4, unsigned long, arg5)
 {
 	struct task_struct *me = current;
@@ -2273,7 +2273,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 	return error;
 }
 
-SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
+SYSCALL_DEFINE_WRAP3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
 		struct getcpu_cache __user *, unused)
 {
 	int err = 0;
diff --git a/mm/madvise.c b/mm/madvise.c
index c889fcb..8390012 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -8,6 +8,7 @@
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mempolicy.h>
 #include <linux/page-isolation.h>
 #include <linux/hugetlb.h>
@@ -457,7 +458,7 @@ madvise_behavior_valid(int behavior)
  *  -EBADF  - map exists, but area maps something that isn't a file.
  *  -EAGAIN - a kernel resource was temporarily unavailable.
  */
-SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
+SYSCALL_DEFINE_WRAP3(madvise, unsigned long, start, size_t, len_in, int, behavior)
 {
 	unsigned long end, tmp;
 	struct vm_area_struct *vma, *prev;
diff --git a/mm/mincore.c b/mm/mincore.c
index 14bb9fb..d6e4395 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -12,6 +12,7 @@
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/hugetlb.h>
@@ -217,7 +218,7 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
  *		mapped
  *  -EAGAIN - A kernel resource was temporarily unavailable.
  */
-SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len,
+SYSCALL_DEFINE_WRAP3(mincore, unsigned long, start, size_t, len,
 		unsigned char __user *, vec)
 {
 	long retval;
diff --git a/mm/mlock.c b/mm/mlock.c
index 339d9e0..e37e60f 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -14,6 +14,7 @@
 #include <linux/pagevec.h>
 #include <linux/mempolicy.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/sched.h>
 #include <linux/export.h>
 #include <linux/rmap.h>
@@ -640,12 +641,12 @@ static int do_mlock(unsigned long start, size_t len, vm_flags_t flags)
 	return 0;
 }
 
-SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
+SYSCALL_DEFINE_WRAP2(mlock, unsigned long, start, size_t, len)
 {
 	return do_mlock(start, len, VM_LOCKED);
 }
 
-SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
+SYSCALL_DEFINE_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags)
 {
 	vm_flags_t vm_flags = VM_LOCKED;
 
@@ -658,7 +659,7 @@ SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
 	return do_mlock(start, len, vm_flags);
 }
 
-SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
+SYSCALL_DEFINE_WRAP2(munlock, unsigned long, start, size_t, len)
 {
 	int ret;
 
diff --git a/mm/mmap.c b/mm/mmap.c
index 2ce04a6..9b9ae80 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -18,6 +18,7 @@
 #include <linux/pagemap.h>
 #include <linux/swap.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/capability.h>
 #include <linux/init.h>
 #include <linux/file.h>
@@ -283,7 +284,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
 
 static unsigned long do_brk(unsigned long addr, unsigned long len);
 
-SYSCALL_DEFINE1(brk, unsigned long, brk)
+SYSCALL_DEFINE_WRAP1(brk, unsigned long, brk)
 {
 	unsigned long retval;
 	unsigned long newbrk, oldbrk;
@@ -2631,7 +2632,7 @@ int vm_munmap(unsigned long start, size_t len)
 }
 EXPORT_SYMBOL(vm_munmap);
 
-SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+SYSCALL_DEFINE_WRAP2(munmap, unsigned long, addr, size_t, len)
 {
 	profile_munmap(addr);
 	return vm_munmap(addr, len);
@@ -2641,7 +2642,7 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
 /*
  * Emulation of deprecated remap_file_pages() syscall.
  */
-SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+SYSCALL_DEFINE_WRAP5(remap_file_pages, unsigned long, start, unsigned long, size,
 		unsigned long, prot, unsigned long, pgoff, unsigned long, flags)
 {
 
diff --git a/mm/mprotect.c b/mm/mprotect.c
index ef5be8e..eec7d57 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -18,6 +18,7 @@
 #include <linux/mempolicy.h>
 #include <linux/personality.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/mmu_notifier.h>
@@ -344,7 +345,7 @@ fail:
 	return error;
 }
 
-SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
+SYSCALL_DEFINE_WRAP3(mprotect, unsigned long, start, size_t, len,
 		unsigned long, prot)
 {
 	unsigned long vm_flags, nstart, end, tmp, reqprot;
diff --git a/mm/mremap.c b/mm/mremap.c
index c25bc62..b81462a 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -19,6 +19,7 @@
 #include <linux/highmem.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mmu_notifier.h>
 #include <linux/sched/sysctl.h>
 #include <linux/uaccess.h>
@@ -468,7 +469,7 @@ static int vma_expandable(struct vm_area_struct *vma, unsigned long delta)
  * MREMAP_FIXED option added 5-Dec-1999 by Benjamin LaHaise
  * This option implies MREMAP_MAYMOVE.
  */
-SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+SYSCALL_DEFINE_WRAP5(mremap, unsigned long, addr, unsigned long, old_len,
 		unsigned long, new_len, unsigned long, flags,
 		unsigned long, new_addr)
 {
diff --git a/mm/msync.c b/mm/msync.c
index 24e612f..1fd9f6a 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -12,6 +12,7 @@
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/sched.h>
 
 /*
@@ -28,7 +29,7 @@
  * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to
  * applications.
  */
-SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
+SYSCALL_DEFINE_WRAP3(msync, unsigned long, start, size_t, len, int, flags)
 {
 	unsigned long end;
 	struct mm_struct *mm = current->mm;
diff --git a/mm/nommu.c b/mm/nommu.c
index 92be862..59c6baf 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -32,6 +32,7 @@
 #include <linux/personality.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/audit.h>
 #include <linux/sched/sysctl.h>
 #include <linux/printk.h>
@@ -526,7 +527,7 @@ EXPORT_SYMBOL(vm_insert_page);
  *  to a regular file.  in this case, the unmapping will need
  *  to invoke file system routines that need the global lock.
  */
-SYSCALL_DEFINE1(brk, unsigned long, brk)
+SYSCALL_DEFINE_WRAP1(brk, unsigned long, brk)
 {
 	struct mm_struct *mm = current->mm;
 
@@ -1684,7 +1685,7 @@ int vm_munmap(unsigned long addr, size_t len)
 }
 EXPORT_SYMBOL(vm_munmap);
 
-SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+SYSCALL_DEFINE_WRAP2(munmap, unsigned long, addr, size_t, len)
 {
 	return vm_munmap(addr, len);
 }
@@ -1760,7 +1761,7 @@ static unsigned long do_mremap(unsigned long addr,
 	return vma->vm_start;
 }
 
-SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+SYSCALL_DEFINE_WRAP5(mremap, unsigned long, addr, unsigned long, old_len,
 		unsigned long, new_len, unsigned long, flags,
 		unsigned long, new_addr)
 {
diff --git a/mm/shmem.c b/mm/shmem.c
index 2afcdbb..154d3b7 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -67,6 +67,7 @@ static struct vfsmount *shm_mnt;
 #include <linux/seq_file.h>
 #include <linux/magic.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 #include <uapi/linux/memfd.h>
 
@@ -2921,7 +2922,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
 
 #define MFD_ALL_FLAGS (MFD_CLOEXEC | MFD_ALLOW_SEALING)
 
-SYSCALL_DEFINE2(memfd_create,
+SYSCALL_DEFINE_WRAP2(memfd_create,
 		const char __user *, uname,
 		unsigned int, flags)
 {
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 5887731..3bb701c 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -28,6 +28,7 @@
 #include <linux/mutex.h>
 #include <linux/capability.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/memcontrol.h>
 #include <linux/poll.h>
 #include <linux/oom.h>
@@ -1841,7 +1842,7 @@ static void reinsert_swap_info(struct swap_info_struct *p)
 	spin_unlock(&swap_lock);
 }
 
-SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
+SYSCALL_DEFINE_WRAP1(swapoff, const char __user *, specialfile)
 {
 	struct swap_info_struct *p = NULL;
 	unsigned char *swap_map;
@@ -2383,7 +2384,7 @@ static bool swap_discardable(struct swap_info_struct *si)
 	return true;
 }
 
-SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
+SYSCALL_DEFINE_WRAP2(swapon, const char __user *, specialfile, int, swap_flags)
 {
 	struct swap_info_struct *p;
 	struct filename *name;
diff --git a/net/socket.c b/net/socket.c
index d730ef9..62b2769 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1251,7 +1251,7 @@ out_release:
  *	Create a pair of connected sockets.
  */
 
-SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol,
+SYSCALL_DEFINE_WRAP4(socketpair, int, family, int, type, int, protocol,
 		int __user *, usockvec)
 {
 	struct socket *sock1, *sock2;
@@ -1360,7 +1360,7 @@ out:
  *	the protocol layer (having also checked the address is ok).
  */
 
-SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
+SYSCALL_DEFINE_WRAP3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
 {
 	struct socket *sock;
 	struct sockaddr_storage address;
@@ -1422,7 +1422,7 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog)
  *	clean when we restucture accept also.
  */
 
-SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
+SYSCALL_DEFINE_WRAP4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
 		int __user *, upeer_addrlen, int, flags)
 {
 	struct socket *sock, *newsock;
@@ -1521,7 +1521,7 @@ SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr,
  *	include the -EINPROGRESS status for such sockets.
  */
 
-SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
+SYSCALL_DEFINE_WRAP3(connect, int, fd, struct sockaddr __user *, uservaddr,
 		int, addrlen)
 {
 	struct socket *sock;
@@ -1553,7 +1553,7 @@ out:
  *	name to user space.
  */
 
-SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
+SYSCALL_DEFINE_WRAP3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
 		int __user *, usockaddr_len)
 {
 	struct socket *sock;
@@ -1584,7 +1584,7 @@ out:
  *	name to user space.
  */
 
-SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
+SYSCALL_DEFINE_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
 		int __user *, usockaddr_len)
 {
 	struct socket *sock;
@@ -1616,7 +1616,7 @@ SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
  *	the protocol.
  */
 
-SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len,
+SYSCALL_DEFINE_WRAP6(sendto, int, fd, void __user *, buff, size_t, len,
 		unsigned int, flags, struct sockaddr __user *, addr,
 		int, addr_len)
 {
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 1c3872a..bae5a04 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/key.h>
 #include <linux/keyctl.h>
 #include <linux/fs.h>
@@ -57,7 +58,7 @@ static int key_get_type_from_user(char *type,
  * If successful, the new key's serial number is returned, otherwise an error
  * code is returned.
  */
-SYSCALL_DEFINE5(add_key, const char __user *, _type,
+SYSCALL_DEFINE_WRAP5(add_key, const char __user *, _type,
 		const char __user *, _description,
 		const void __user *, _payload,
 		size_t, plen,
@@ -155,7 +156,7 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type,
  * passed to /sbin/request-key to aid with completing the request.  If the
  * _callout_info string is "" then it will be changed to "-".
  */
-SYSCALL_DEFINE4(request_key, const char __user *, _type,
+SYSCALL_DEFINE_WRAP4(request_key, const char __user *, _type,
 		const char __user *, _description,
 		const char __user *, _callout_info,
 		key_serial_t, destringid)
-- 
2.5.0

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

* [PATCH 3/5] all: s390: redefine wrappers in generic code
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

With new COMPAT_SYSCALL_WRAPx macro, we declare both sys_foo(),
and compat_sys_foo() system calls. The later clears top halves of 64-bit
registers to eliminate possible damage from garbage there.

With the only exception (handled in next patch), this is mechanical work.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/s390/kernel/Makefile         |   2 +-
 arch/s390/kernel/compat_wrapper.c | 128 ----------------------
 arch/s390/pci/pci_mmio.c          |   5 +-
 drivers/char/random.c             |   3 +-
 fs/aio.c                          |   4 +-
 fs/buffer.c                       |   3 +-
 fs/dcache.c                       |   3 +-
 fs/eventpoll.c                    |   4 +-
 fs/exec.c                         |   2 +-
 fs/fhandle.c                      |   3 +-
 fs/filesystems.c                  |   3 +-
 fs/namei.c                        |  29 ++---
 fs/namespace.c                    |   7 +-
 fs/notify/inotify/inotify_user.c  |   3 +-
 fs/open.c                         |  20 ++--
 fs/pipe.c                         |   5 +-
 fs/quota/quota.c                  |   3 +-
 fs/read_write.c                   |   2 +-
 fs/select.c                       |   3 +-
 fs/splice.c                       |   4 +-
 fs/stat.c                         |   5 +-
 fs/xattr.c                        |  25 ++---
 include/uapi/asm-generic/unistd.h | 220 +++++++++++++++++++-------------------
 ipc/mqueue.c                      |   3 +-
 kernel/acct.c                     |   3 +-
 kernel/bpf/syscall.c              |   3 +-
 kernel/capability.c               |   5 +-
 kernel/events/core.c              |   2 +-
 kernel/fork.c                     |  12 +--
 kernel/groups.c                   |   5 +-
 kernel/kcmp.c                     |   3 +-
 kernel/module.c                   |   7 +-
 kernel/printk/printk.c            |   3 +-
 kernel/reboot.c                   |   3 +-
 kernel/sched/core.c               |  11 +-
 kernel/seccomp.c                  |   2 +-
 kernel/signal.c                   |   6 +-
 kernel/sys.c                      |  16 +--
 mm/madvise.c                      |   3 +-
 mm/mincore.c                      |   3 +-
 mm/mlock.c                        |   7 +-
 mm/mmap.c                         |   7 +-
 mm/mprotect.c                     |   3 +-
 mm/mremap.c                       |   3 +-
 mm/msync.c                        |   3 +-
 mm/nommu.c                        |   7 +-
 mm/shmem.c                        |   3 +-
 mm/swapfile.c                     |   5 +-
 net/socket.c                      |  14 +--
 security/keys/keyctl.c            |   5 +-
 50 files changed, 270 insertions(+), 363 deletions(-)
 delete mode 100644 arch/s390/kernel/compat_wrapper.c

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index dc167a2..185cd88 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -55,7 +55,7 @@ obj-$(CONFIG_HIBERNATION)	+= suspend.o swsusp.o
 obj-$(CONFIG_AUDIT)		+= audit.o
 compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
 obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o
-obj-$(CONFIG_COMPAT)		+= compat_wrapper.o $(compat-obj-y)
+obj-$(CONFIG_COMPAT)		+= $(compat-obj-y)
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c
deleted file mode 100644
index 527f75d..0000000
--- a/arch/s390/kernel/compat_wrapper.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *  Compat system call wrappers.
- *
- *    Copyright IBM Corp. 2014
- */
-
-#include <linux/syscalls.h>
-#include <linux/compat.h>
-#include "entry.h"
-
-COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
-COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
-COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
-COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
-COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
-COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
-COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
-COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
-COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
-COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
-COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk);
-COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
-COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
-COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
-COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask);
-COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
-COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
-COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
-COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
-COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
-COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
-COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len);
-COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
-COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
-COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
-COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
-COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot);
-COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs);
-COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
-COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data);
-COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2);
-COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence);
-COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags);
-COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len);
-COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len);
-COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param);
-COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr);
-COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout);
-COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5);
-COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size);
-COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr);
-COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data);
-COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group);
-COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist);
-COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist);
-COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid);
-COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid);
-COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group);
-COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old);
-COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec);
-COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior);
-COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags);
-COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count);
-COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size);
-COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size);
-COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name);
-COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name);
-COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr);
-COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event);
-COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout);
-COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx);
-COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result);
-COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name);
-COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id);
-COMPAT_SYSCALL_WRAP4(request_key, const char __user *, tp, const char __user *, dsc, const char __user *, info, key_serial_t, id);
-COMPAT_SYSCALL_WRAP5(remap_file_pages, unsigned long, start, unsigned long, size, unsigned long, prot, unsigned long, pgoff, unsigned long, flags);
-COMPAT_SYSCALL_WRAP3(inotify_add_watch, int, fd, const char __user *, path, u32, mask);
-COMPAT_SYSCALL_WRAP3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode);
-COMPAT_SYSCALL_WRAP4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, unsigned, dev);
-COMPAT_SYSCALL_WRAP5(fchownat, int, dfd, const char __user *, filename, uid_t, user, gid_t, group, int, flag);
-COMPAT_SYSCALL_WRAP3(unlinkat, int, dfd, const char __user *, pathname, int, flag);
-COMPAT_SYSCALL_WRAP4(renameat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname);
-COMPAT_SYSCALL_WRAP5(linkat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, int, flags);
-COMPAT_SYSCALL_WRAP3(symlinkat, const char __user *, oldname, int, newdfd, const char __user *, newname);
-COMPAT_SYSCALL_WRAP4(readlinkat, int, dfd, const char __user *, path, char __user *, buf, int, bufsiz);
-COMPAT_SYSCALL_WRAP3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode);
-COMPAT_SYSCALL_WRAP3(faccessat, int, dfd, const char __user *, filename, int, mode);
-COMPAT_SYSCALL_WRAP1(unshare, unsigned long, unshare_flags);
-COMPAT_SYSCALL_WRAP6(splice, int, fd_in, loff_t __user *, off_in, int, fd_out, loff_t __user *, off_out, size_t, len, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags);
-COMPAT_SYSCALL_WRAP3(getcpu, unsigned __user *, cpu, unsigned __user *, node, struct getcpu_cache __user *, cache);
-COMPAT_SYSCALL_WRAP2(pipe2, int __user *, fildes, int, flags);
-COMPAT_SYSCALL_WRAP5(perf_event_open, struct perf_event_attr __user *, attr_uptr, pid_t, pid, int, cpu, int, group_fd, unsigned long, flags);
-COMPAT_SYSCALL_WRAP5(clone, unsigned long, newsp, unsigned long, clone_flags, int __user *, parent_tidptr, int __user *, child_tidptr, unsigned long, tls);
-COMPAT_SYSCALL_WRAP4(prlimit64, pid_t, pid, unsigned int, resource, const struct rlimit64 __user *, new_rlim, struct rlimit64 __user *, old_rlim);
-COMPAT_SYSCALL_WRAP5(name_to_handle_at, int, dfd, const char __user *, name, struct file_handle __user *, handle, int __user *, mnt_id, int, flag);
-COMPAT_SYSCALL_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, idx1, unsigned long, idx2);
-COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags);
-COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags);
-COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags);
-COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags);
-COMPAT_SYSCALL_WRAP3(seccomp, unsigned int, op, unsigned int, flags, const char __user *, uargs)
-COMPAT_SYSCALL_WRAP3(getrandom, char __user *, buf, size_t, count, unsigned int, flags)
-COMPAT_SYSCALL_WRAP2(memfd_create, const char __user *, uname, unsigned int, flags)
-COMPAT_SYSCALL_WRAP3(bpf, int, cmd, union bpf_attr *, attr, unsigned int, size);
-COMPAT_SYSCALL_WRAP3(s390_pci_mmio_write, const unsigned long, mmio_addr, const void __user *, user_buffer, const size_t, length);
-COMPAT_SYSCALL_WRAP3(s390_pci_mmio_read, const unsigned long, mmio_addr, void __user *, user_buffer, const size_t, length);
-COMPAT_SYSCALL_WRAP4(socketpair, int, family, int, type, int, protocol, int __user *, usockvec);
-COMPAT_SYSCALL_WRAP3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen);
-COMPAT_SYSCALL_WRAP3(connect, int, fd, struct sockaddr __user *, uservaddr, int, addrlen);
-COMPAT_SYSCALL_WRAP4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr, int __user *, upeer_addrlen, int, flags);
-COMPAT_SYSCALL_WRAP3(getsockname, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
-COMPAT_SYSCALL_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
-COMPAT_SYSCALL_WRAP6(sendto, int, fd, void __user *, buff, size_t, len, unsigned int, flags, struct sockaddr __user *, addr, int, addr_len);
-COMPAT_SYSCALL_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags);
diff --git a/arch/s390/pci/pci_mmio.c b/arch/s390/pci/pci_mmio.c
index b1bb2b7..3627070 100644
--- a/arch/s390/pci/pci_mmio.c
+++ b/arch/s390/pci/pci_mmio.c
@@ -6,6 +6,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/errno.h>
@@ -31,7 +32,7 @@ out:
 	return ret;
 }
 
-SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
+SYSCALL_DEFINE_WRAP3(s390_pci_mmio_write, unsigned long, mmio_addr,
 		const void __user *, user_buffer, size_t, length)
 {
 	u8 local_buf[64];
@@ -71,7 +72,7 @@ out:
 	return ret;
 }
 
-SYSCALL_DEFINE3(s390_pci_mmio_read, unsigned long, mmio_addr,
+SYSCALL_DEFINE_WRAP3(s390_pci_mmio_read, unsigned long, mmio_addr,
 		void __user *, user_buffer, size_t, length)
 {
 	u8 local_buf[64];
diff --git a/drivers/char/random.c b/drivers/char/random.c
index d0da5d8..4484cad 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -259,6 +259,7 @@
 #include <linux/workqueue.h>
 #include <linux/irq.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/completion.h>
 
 #include <asm/processor.h>
@@ -1598,7 +1599,7 @@ const struct file_operations urandom_fops = {
 	.llseek = noop_llseek,
 };
 
-SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count,
+SYSCALL_DEFINE_WRAP3(getrandom, char __user *, buf, size_t, count,
 		unsigned int, flags)
 {
 	if (flags & ~(GRND_NONBLOCK|GRND_RANDOM))
diff --git a/fs/aio.c b/fs/aio.c
index 155f842..c6d1e70 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1349,7 +1349,7 @@ out:
  *	implemented.  May fail with -EINVAL if the context pointed to
  *	is invalid.
  */
-SYSCALL_DEFINE1(io_destroy, aio_context_t, ctx)
+SYSCALL_DEFINE_WRAP1(io_destroy, aio_context_t, ctx)
 {
 	struct kioctx *ioctx = lookup_ioctx(ctx);
 	if (likely(NULL != ioctx)) {
@@ -1671,7 +1671,7 @@ lookup_kiocb(struct kioctx *ctx, struct iocb __user *iocb, u32 key)
  *	invalid.  May fail with -EAGAIN if the iocb specified was not
  *	cancelled.  Will fail with -ENOSYS if not implemented.
  */
-SYSCALL_DEFINE3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
+SYSCALL_DEFINE_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb,
 		struct io_event __user *, result)
 {
 	struct kioctx *ctx;
diff --git a/fs/buffer.c b/fs/buffer.c
index 4f4cd95..394a365 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -20,6 +20,7 @@
 
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/percpu.h>
@@ -3267,7 +3268,7 @@ EXPORT_SYMBOL(try_to_free_buffers);
  * Use of bdflush() is deprecated and will be removed in a future kernel.
  * The `flush-X' kernel threads fully replace bdflush daemons and this call.
  */
-SYSCALL_DEFINE2(bdflush, int, func, long, data)
+SYSCALL_DEFINE_WRAP2(bdflush, int, func, long, data)
 {
 	static int msg_count;
 
diff --git a/fs/dcache.c b/fs/dcache.c
index 5c33aeb..6a83cc5 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -15,6 +15,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
@@ -3244,7 +3245,7 @@ static void get_fs_root_and_pwd_rcu(struct fs_struct *fs, struct path *root,
  *		return NULL;
  *	}
  */
-SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
+SYSCALL_DEFINE_WRAP2(getcwd, char __user *, buf, unsigned long, size)
 {
 	int error;
 	struct path pwd, root;
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 1e009ca..01348a2 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1817,7 +1817,7 @@ SYSCALL_DEFINE1(epoll_create, int, size)
  * the eventpoll file that enables the insertion/removal/change of
  * file descriptors inside the interest set.
  */
-SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
+SYSCALL_DEFINE_WRAP4(epoll_ctl, int, epfd, int, op, int, fd,
 		struct epoll_event __user *, event)
 {
 	int error;
@@ -1958,7 +1958,7 @@ error_return:
  * Implement the event wait interface for the eventpoll file. It is the kernel
  * part of the user space epoll_wait(2).
  */
-SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
+SYSCALL_DEFINE_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events,
 		int, maxevents, int, timeout)
 {
 	int error;
diff --git a/fs/exec.c b/fs/exec.c
index b06623a..2e43e47 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -111,7 +111,7 @@ bool path_noexec(const struct path *path)
  *
  * Also note that we take the address to load from from the file itself.
  */
-SYSCALL_DEFINE1(uselib, const char __user *, library)
+SYSCALL_DEFINE_WRAP1(uselib, const char __user *, library)
 {
 	struct linux_binfmt *fmt;
 	struct file *file;
diff --git a/fs/fhandle.c b/fs/fhandle.c
index d59712d..048a4ee 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -1,4 +1,5 @@
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/file.h>
@@ -89,7 +90,7 @@ static long do_sys_name_to_handle(struct path *path,
  * enough space, the field is updated to return the minimum
  * value required.
  */
-SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
+SYSCALL_DEFINE_WRAP5(name_to_handle_at, int, dfd, const char __user *, name,
 		struct file_handle __user *, handle, int __user *, mnt_id,
 		int, flag)
 {
diff --git a/fs/filesystems.c b/fs/filesystems.c
index 5797d45..6fcbe18 100644
--- a/fs/filesystems.c
+++ b/fs/filesystems.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -181,7 +182,7 @@ static int fs_maxindex(void)
 /*
  * Whee.. Weird sysv syscall. 
  */
-SYSCALL_DEFINE3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
+SYSCALL_DEFINE_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2)
 {
 	int retval = -EINVAL;
 
diff --git a/fs/namei.c b/fs/namei.c
index 0c3974c..6ded831 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -26,6 +26,7 @@
 #include <linux/security.h>
 #include <linux/ima.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mount.h>
 #include <linux/audit.h>
 #include <linux/capability.h>
@@ -3533,7 +3534,7 @@ static int may_mknod(umode_t mode)
 	}
 }
 
-SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
+SYSCALL_DEFINE_WRAP4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
 		unsigned, dev)
 {
 	struct dentry *dentry;
@@ -3575,7 +3576,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
+SYSCALL_DEFINE_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
 {
 	return sys_mknodat(AT_FDCWD, filename, mode, dev);
 }
@@ -3606,7 +3607,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
 }
 EXPORT_SYMBOL(vfs_mkdir);
 
-SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
 {
 	struct dentry *dentry;
 	struct path path;
@@ -3631,7 +3632,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(mkdir, const char __user *, pathname, umode_t, mode)
 {
 	return sys_mkdirat(AT_FDCWD, pathname, mode);
 }
@@ -3759,7 +3760,7 @@ exit1:
 	return error;
 }
 
-SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
+SYSCALL_DEFINE_WRAP1(rmdir, const char __user *, pathname)
 {
 	return do_rmdir(AT_FDCWD, pathname);
 }
@@ -3901,7 +3902,7 @@ slashes:
 	goto exit2;
 }
 
-SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
+SYSCALL_DEFINE_WRAP3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
 {
 	if ((flag & ~AT_REMOVEDIR) != 0)
 		return -EINVAL;
@@ -3912,7 +3913,7 @@ SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
 	return do_unlinkat(dfd, pathname);
 }
 
-SYSCALL_DEFINE1(unlink, const char __user *, pathname)
+SYSCALL_DEFINE_WRAP1(unlink, const char __user *, pathname)
 {
 	return do_unlinkat(AT_FDCWD, pathname);
 }
@@ -3938,7 +3939,7 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname)
 }
 EXPORT_SYMBOL(vfs_symlink);
 
-SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP3(symlinkat, const char __user *, oldname,
 		int, newdfd, const char __user *, newname)
 {
 	int error;
@@ -3969,7 +3970,7 @@ out_putname:
 	return error;
 }
 
-SYSCALL_DEFINE2(symlink, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(symlink, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_symlinkat(oldname, AT_FDCWD, newname);
 }
@@ -4056,7 +4057,7 @@ EXPORT_SYMBOL(vfs_link);
  * with linux 2.0, and to avoid hard-linking to directories
  * and other special files.  --ADM
  */
-SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP5(linkat, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname, int, flags)
 {
 	struct dentry *new_dentry;
@@ -4121,7 +4122,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(link, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
@@ -4309,7 +4310,7 @@ out:
 }
 EXPORT_SYMBOL(vfs_rename);
 
-SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP5(renameat2, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname, unsigned int, flags)
 {
 	struct dentry *old_dentry, *new_dentry;
@@ -4452,13 +4453,13 @@ exit:
 	return error;
 }
 
-SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
+SYSCALL_DEFINE_WRAP4(renameat, int, olddfd, const char __user *, oldname,
 		int, newdfd, const char __user *, newname)
 {
 	return sys_renameat2(olddfd, oldname, newdfd, newname, 0);
 }
 
-SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname)
+SYSCALL_DEFINE_WRAP2(rename, const char __user *, oldname, const char __user *, newname)
 {
 	return sys_renameat2(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
diff --git a/fs/namespace.c b/fs/namespace.c
index 0570729..6ba4afd 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/capability.h>
 #include <linux/mnt_namespace.h>
@@ -1592,7 +1593,7 @@ static inline bool may_mount(void)
  * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD
  */
 
-SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
+SYSCALL_DEFINE_WRAP2(umount, char __user *, name, int, flags)
 {
 	struct path path;
 	struct mount *mnt;
@@ -1637,7 +1638,7 @@ out:
 /*
  *	The 2.0 compatible umount. No flags.
  */
-SYSCALL_DEFINE1(oldumount, char __user *, name)
+SYSCALL_DEFINE_WRAP1(oldumount, char __user *, name)
 {
 	return sys_umount(name, 0);
 }
@@ -2974,7 +2975,7 @@ EXPORT_SYMBOL(path_is_under);
  *    though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
  *    first.
  */
-SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
+SYSCALL_DEFINE_WRAP2(pivot_root, const char __user *, new_root,
 		const char __user *, put_old)
 {
 	struct path new, old, parent_path, root_parent, root;
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index b8d08d0..713a670 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -33,6 +33,7 @@
 #include <linux/sched.h> /* struct user */
 #include <linux/slab.h> /* struct kmem_cache */
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/types.h>
 #include <linux/anon_inodes.h>
 #include <linux/uaccess.h>
@@ -696,7 +697,7 @@ SYSCALL_DEFINE0(inotify_init)
 	return sys_inotify_init1(0);
 }
 
-SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP3(inotify_add_watch, int, fd, const char __user *, pathname,
 		u32, mask)
 {
 	struct fsnotify_group *group;
diff --git a/fs/open.c b/fs/open.c
index b6f1e96..8dae6c7 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -334,7 +334,7 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
  * We do this by temporarily clearing all FS-related capabilities and
  * switching the fsuid/fsgid around to the real ones.
  */
-SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
+SYSCALL_DEFINE_WRAP3(faccessat, int, dfd, const char __user *, filename, int, mode)
 {
 	const struct cred *old_cred;
 	struct cred *override_cred;
@@ -410,12 +410,12 @@ out:
 	return res;
 }
 
-SYSCALL_DEFINE2(access, const char __user *, filename, int, mode)
+SYSCALL_DEFINE_WRAP2(access, const char __user *, filename, int, mode)
 {
 	return sys_faccessat(AT_FDCWD, filename, mode);
 }
 
-SYSCALL_DEFINE1(chdir, const char __user *, filename)
+SYSCALL_DEFINE_WRAP1(chdir, const char __user *, filename)
 {
 	struct path path;
 	int error;
@@ -466,7 +466,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE1(chroot, const char __user *, filename)
+SYSCALL_DEFINE_WRAP1(chroot, const char __user *, filename)
 {
 	struct path path;
 	int error;
@@ -541,7 +541,7 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
 	return err;
 }
 
-SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode)
+SYSCALL_DEFINE_WRAP3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode)
 {
 	struct path path;
 	int error;
@@ -559,7 +559,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(chmod, const char __user *, filename, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(chmod, const char __user *, filename, umode_t, mode)
 {
 	return sys_fchmodat(AT_FDCWD, filename, mode);
 }
@@ -606,7 +606,7 @@ retry_deleg:
 	return error;
 }
 
-SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
+SYSCALL_DEFINE_WRAP5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
 		gid_t, group, int, flag)
 {
 	struct path path;
@@ -638,12 +638,12 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
+SYSCALL_DEFINE_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group)
 {
 	return sys_fchownat(AT_FDCWD, filename, user, group, 0);
 }
 
-SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
+SYSCALL_DEFINE_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
 {
 	return sys_fchownat(AT_FDCWD, filename, user, group,
 			    AT_SYMLINK_NOFOLLOW);
@@ -1058,7 +1058,7 @@ SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
  * For backward compatibility?  Maybe this should be moved
  * into arch/i386 instead?
  */
-SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
+SYSCALL_DEFINE_WRAP2(creat, const char __user *, pathname, umode_t, mode)
 {
 	return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
 }
diff --git a/fs/pipe.c b/fs/pipe.c
index 42cf8dd..07ce638 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -20,6 +20,7 @@
 #include <linux/pagemap.h>
 #include <linux/audit.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 
 #include <asm/uaccess.h>
@@ -776,7 +777,7 @@ int do_pipe_flags(int *fd, int flags)
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
  */
-SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
+SYSCALL_DEFINE_WRAP2(pipe2, int __user *, fildes, int, flags)
 {
 	struct file *files[2];
 	int fd[2];
@@ -798,7 +799,7 @@ SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
 	return error;
 }
 
-SYSCALL_DEFINE1(pipe, int __user *, fildes)
+SYSCALL_DEFINE_WRAP1(pipe, int __user *, fildes)
 {
 	return sys_pipe2(fildes, 0);
 }
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 3746367..5738db8 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -13,6 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/capability.h>
 #include <linux/quotaops.h>
 #include <linux/types.h>
@@ -757,7 +758,7 @@ static struct super_block *quotactl_block(const char __user *special, int cmd)
  * calls. Maybe we need to add the process quotas etc. in the future,
  * but we probably should use rlimits for that.
  */
-SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
+SYSCALL_DEFINE_WRAP4(quotactl, unsigned int, cmd, const char __user *, special,
 		qid_t, id, void __user *, addr)
 {
 	uint cmds, type;
diff --git a/fs/read_write.c b/fs/read_write.c
index 819ef3f..7e2b232 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -299,7 +299,7 @@ COMPAT_SYSCALL_DEFINE3(lseek, unsigned int, fd, compat_off_t, offset, unsigned i
 #endif
 
 #ifdef __ARCH_WANT_SYS_LLSEEK
-SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
+SYSCALL_DEFINE_WRAP5(llseek, unsigned int, fd, unsigned long, offset_high,
 		unsigned long, offset_low, loff_t __user *, result,
 		unsigned int, whence)
 {
diff --git a/fs/select.c b/fs/select.c
index 0155473..28e1ca6 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -17,6 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/poll.h>
@@ -954,7 +955,7 @@ static long do_restart_poll(struct restart_block *restart_block)
 	return ret;
 }
 
-SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
+SYSCALL_DEFINE_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
 		int, timeout_msecs)
 {
 	struct timespec end_time, *to = NULL;
diff --git a/fs/splice.c b/fs/splice.c
index 4cf700d..b0ab438 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1683,7 +1683,7 @@ COMPAT_SYSCALL_DEFINE4(vmsplice, int, fd, const struct compat_iovec __user *, io
 }
 #endif
 
-SYSCALL_DEFINE6(splice, int, fd_in, loff_t __user *, off_in,
+SYSCALL_DEFINE_WRAP6(splice, int, fd_in, loff_t __user *, off_in,
 		int, fd_out, loff_t __user *, off_out,
 		size_t, len, unsigned int, flags)
 {
@@ -2016,7 +2016,7 @@ static long do_tee(struct file *in, struct file *out, size_t len,
 	return ret;
 }
 
-SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
+SYSCALL_DEFINE_WRAP4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
 {
 	struct fd in;
 	int error;
diff --git a/fs/stat.c b/fs/stat.c
index d4a61d8..f4ddfdb 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -13,6 +13,7 @@
 #include <linux/namei.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/pagemap.h>
 
 #include <asm/uaccess.h>
@@ -312,7 +313,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
 	return error;
 }
 
-SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(readlinkat, int, dfd, const char __user *, pathname,
 		char __user *, buf, int, bufsiz)
 {
 	struct path path;
@@ -346,7 +347,7 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf,
+SYSCALL_DEFINE_WRAP3(readlink, const char __user *, path, char __user *, buf,
 		int, bufsiz)
 {
 	return sys_readlinkat(AT_FDCWD, path, buf, bufsiz);
diff --git a/fs/xattr.c b/fs/xattr.c
index 9b932b9..3a7223f 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -16,6 +16,7 @@
 #include <linux/security.h>
 #include <linux/evm.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/fsnotify.h>
 #include <linux/audit.h>
@@ -387,21 +388,21 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE5(setxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP5(setxattr, const char __user *, pathname,
 		const char __user *, name, const void __user *, value,
 		size_t, size, int, flags)
 {
 	return path_setxattr(pathname, name, value, size, flags, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE5(lsetxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP5(lsetxattr, const char __user *, pathname,
 		const char __user *, name, const void __user *, value,
 		size_t, size, int, flags)
 {
 	return path_setxattr(pathname, name, value, size, flags, 0);
 }
 
-SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
+SYSCALL_DEFINE_WRAP5(fsetxattr, int, fd, const char __user *, name,
 		const void __user *,value, size_t, size, int, flags)
 {
 	struct fd f = fdget(fd);
@@ -487,19 +488,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE4(getxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(getxattr, const char __user *, pathname,
 		const char __user *, name, void __user *, value, size_t, size)
 {
 	return path_getxattr(pathname, name, value, size, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE4(lgetxattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP4(lgetxattr, const char __user *, pathname,
 		const char __user *, name, void __user *, value, size_t, size)
 {
 	return path_getxattr(pathname, name, value, size, 0);
 }
 
-SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name,
+SYSCALL_DEFINE_WRAP4(fgetxattr, int, fd, const char __user *, name,
 		void __user *, value, size_t, size)
 {
 	struct fd f = fdget(fd);
@@ -569,19 +570,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE3(listxattr, const char __user *, pathname, char __user *, list,
+SYSCALL_DEFINE_WRAP3(listxattr, const char __user *, pathname, char __user *, list,
 		size_t, size)
 {
 	return path_listxattr(pathname, list, size, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE3(llistxattr, const char __user *, pathname, char __user *, list,
+SYSCALL_DEFINE_WRAP3(llistxattr, const char __user *, pathname, char __user *, list,
 		size_t, size)
 {
 	return path_listxattr(pathname, list, size, 0);
 }
 
-SYSCALL_DEFINE3(flistxattr, int, fd, char __user *, list, size_t, size)
+SYSCALL_DEFINE_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size)
 {
 	struct fd f = fdget(fd);
 	ssize_t error = -EBADF;
@@ -634,19 +635,19 @@ retry:
 	return error;
 }
 
-SYSCALL_DEFINE2(removexattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP2(removexattr, const char __user *, pathname,
 		const char __user *, name)
 {
 	return path_removexattr(pathname, name, LOOKUP_FOLLOW);
 }
 
-SYSCALL_DEFINE2(lremovexattr, const char __user *, pathname,
+SYSCALL_DEFINE_WRAP2(lremovexattr, const char __user *, pathname,
 		const char __user *, name)
 {
 	return path_removexattr(pathname, name, 0);
 }
 
-SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name)
+SYSCALL_DEFINE_WRAP2(fremovexattr, int, fd, const char __user *, name)
 {
 	struct fd f = fdget(fd);
 	int error = -EBADF;
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index a8380ad..705d841 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -36,43 +36,43 @@
 #define __NR_io_setup 0
 __SC_COMP(__NR_io_setup, sys_io_setup, compat_sys_io_setup)
 #define __NR_io_destroy 1
-__SYSCALL(__NR_io_destroy, sys_io_destroy)
+__SC_WRAP(__NR_io_destroy, sys_io_destroy)
 #define __NR_io_submit 2
 __SC_COMP(__NR_io_submit, sys_io_submit, compat_sys_io_submit)
 #define __NR_io_cancel 3
-__SYSCALL(__NR_io_cancel, sys_io_cancel)
+__SC_WRAP(__NR_io_cancel, sys_io_cancel)
 #define __NR_io_getevents 4
 __SC_COMP(__NR_io_getevents, sys_io_getevents, compat_sys_io_getevents)
 
 /* fs/xattr.c */
 #define __NR_setxattr 5
-__SYSCALL(__NR_setxattr, sys_setxattr)
+__SC_WRAP(__NR_setxattr, sys_setxattr)
 #define __NR_lsetxattr 6
-__SYSCALL(__NR_lsetxattr, sys_lsetxattr)
+__SC_WRAP(__NR_lsetxattr, sys_lsetxattr)
 #define __NR_fsetxattr 7
-__SYSCALL(__NR_fsetxattr, sys_fsetxattr)
+__SC_WRAP(__NR_fsetxattr, sys_fsetxattr)
 #define __NR_getxattr 8
-__SYSCALL(__NR_getxattr, sys_getxattr)
+__SC_WRAP(__NR_getxattr, sys_getxattr)
 #define __NR_lgetxattr 9
-__SYSCALL(__NR_lgetxattr, sys_lgetxattr)
+__SC_WRAP(__NR_lgetxattr, sys_lgetxattr)
 #define __NR_fgetxattr 10
-__SYSCALL(__NR_fgetxattr, sys_fgetxattr)
+__SC_WRAP(__NR_fgetxattr, sys_fgetxattr)
 #define __NR_listxattr 11
-__SYSCALL(__NR_listxattr, sys_listxattr)
+__SC_WRAP(__NR_listxattr, sys_listxattr)
 #define __NR_llistxattr 12
-__SYSCALL(__NR_llistxattr, sys_llistxattr)
+__SC_WRAP(__NR_llistxattr, sys_llistxattr)
 #define __NR_flistxattr 13
-__SYSCALL(__NR_flistxattr, sys_flistxattr)
+__SC_WRAP(__NR_flistxattr, sys_flistxattr)
 #define __NR_removexattr 14
-__SYSCALL(__NR_removexattr, sys_removexattr)
+__SC_WRAP(__NR_removexattr, sys_removexattr)
 #define __NR_lremovexattr 15
-__SYSCALL(__NR_lremovexattr, sys_lremovexattr)
+__SC_WRAP(__NR_lremovexattr, sys_lremovexattr)
 #define __NR_fremovexattr 16
-__SYSCALL(__NR_fremovexattr, sys_fremovexattr)
+__SC_WRAP(__NR_fremovexattr, sys_fremovexattr)
 
 /* fs/dcache.c */
 #define __NR_getcwd 17
-__SYSCALL(__NR_getcwd, sys_getcwd)
+__SC_WRAP(__NR_getcwd, sys_getcwd)
 
 /* fs/cookies.c */
 #define __NR_lookup_dcookie 18
@@ -86,7 +86,7 @@ __SYSCALL(__NR_eventfd2, sys_eventfd2)
 #define __NR_epoll_create1 20
 __SYSCALL(__NR_epoll_create1, sys_epoll_create1)
 #define __NR_epoll_ctl 21
-__SYSCALL(__NR_epoll_ctl, sys_epoll_ctl)
+__SC_WRAP(__NR_epoll_ctl, sys_epoll_ctl)
 #define __NR_epoll_pwait 22
 __SC_COMP(__NR_epoll_pwait, sys_epoll_pwait, compat_sys_epoll_pwait)
 
@@ -102,7 +102,7 @@ __SC_COMP_3264(__NR3264_fcntl, sys_fcntl64, sys_fcntl, compat_sys_fcntl64)
 #define __NR_inotify_init1 26
 __SYSCALL(__NR_inotify_init1, sys_inotify_init1)
 #define __NR_inotify_add_watch 27
-__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
+__SC_WRAP(__NR_inotify_add_watch, sys_inotify_add_watch)
 #define __NR_inotify_rm_watch 28
 __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
 
@@ -122,17 +122,17 @@ __SYSCALL(__NR_flock, sys_flock)
 
 /* fs/namei.c */
 #define __NR_mknodat 33
-__SYSCALL(__NR_mknodat, sys_mknodat)
+__SC_WRAP(__NR_mknodat, sys_mknodat)
 #define __NR_mkdirat 34
-__SYSCALL(__NR_mkdirat, sys_mkdirat)
+__SC_WRAP(__NR_mkdirat, sys_mkdirat)
 #define __NR_unlinkat 35
-__SYSCALL(__NR_unlinkat, sys_unlinkat)
+__SC_WRAP(__NR_unlinkat, sys_unlinkat)
 #define __NR_symlinkat 36
-__SYSCALL(__NR_symlinkat, sys_symlinkat)
+__SC_WRAP(__NR_symlinkat, sys_symlinkat)
 #define __NR_linkat 37
-__SYSCALL(__NR_linkat, sys_linkat)
+__SC_WRAP(__NR_linkat, sys_linkat)
 #define __NR_renameat 38
-__SYSCALL(__NR_renameat, sys_renameat)
+__SC_WRAP(__NR_renameat, sys_renameat)
 
 /* fs/namespace.c */
 #define __NR_umount2 39
@@ -140,7 +140,7 @@ __SYSCALL(__NR_umount2, sys_umount)
 #define __NR_mount 40
 __SC_COMP(__NR_mount, sys_mount, compat_sys_mount)
 #define __NR_pivot_root 41
-__SYSCALL(__NR_pivot_root, sys_pivot_root)
+__SC_WRAP(__NR_pivot_root, sys_pivot_root)
 
 /* fs/nfsctl.c */
 #define __NR_nfsservctl 42
@@ -163,19 +163,19 @@ __SC_COMP_3264(__NR3264_ftruncate, sys_ftruncate64, sys_ftruncate, \
 #define __NR_fallocate 47
 __SC_COMP(__NR_fallocate, sys_fallocate, compat_sys_fallocate)
 #define __NR_faccessat 48
-__SYSCALL(__NR_faccessat, sys_faccessat)
+__SC_WRAP(__NR_faccessat, sys_faccessat)
 #define __NR_chdir 49
-__SYSCALL(__NR_chdir, sys_chdir)
+__SC_WRAP(__NR_chdir, sys_chdir)
 #define __NR_fchdir 50
 __SYSCALL(__NR_fchdir, sys_fchdir)
 #define __NR_chroot 51
-__SYSCALL(__NR_chroot, sys_chroot)
+__SC_WRAP(__NR_chroot, sys_chroot)
 #define __NR_fchmod 52
 __SYSCALL(__NR_fchmod, sys_fchmod)
 #define __NR_fchmodat 53
-__SYSCALL(__NR_fchmodat, sys_fchmodat)
+__SC_WRAP(__NR_fchmodat, sys_fchmodat)
 #define __NR_fchownat 54
-__SYSCALL(__NR_fchownat, sys_fchownat)
+__SC_WRAP(__NR_fchownat, sys_fchownat)
 #define __NR_fchown 55
 __SYSCALL(__NR_fchown, sys_fchown)
 #define __NR_openat 56
@@ -187,11 +187,11 @@ __SYSCALL(__NR_vhangup, sys_vhangup)
 
 /* fs/pipe.c */
 #define __NR_pipe2 59
-__SYSCALL(__NR_pipe2, sys_pipe2)
+__SC_WRAP(__NR_pipe2, sys_pipe2)
 
 /* fs/quota.c */
 #define __NR_quotactl 60
-__SYSCALL(__NR_quotactl, sys_quotactl)
+__SC_WRAP(__NR_quotactl, sys_quotactl)
 
 /* fs/readdir.c */
 #define __NR_getdents64 61
@@ -236,13 +236,13 @@ __SC_COMP(__NR_signalfd4, sys_signalfd4, compat_sys_signalfd4)
 #define __NR_vmsplice 75
 __SC_COMP(__NR_vmsplice, sys_vmsplice, compat_sys_vmsplice)
 #define __NR_splice 76
-__SYSCALL(__NR_splice, sys_splice)
+__SC_WRAP(__NR_splice, sys_splice)
 #define __NR_tee 77
-__SYSCALL(__NR_tee, sys_tee)
+__SC_WRAP(__NR_tee, sys_tee)
 
 /* fs/stat.c */
 #define __NR_readlinkat 78
-__SYSCALL(__NR_readlinkat, sys_readlinkat)
+__SC_WRAP(__NR_readlinkat, sys_readlinkat)
 #define __NR3264_fstatat 79
 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
 #define __NR3264_fstat 80
@@ -281,13 +281,13 @@ __SC_COMP(__NR_utimensat, sys_utimensat, compat_sys_utimensat)
 
 /* kernel/acct.c */
 #define __NR_acct 89
-__SYSCALL(__NR_acct, sys_acct)
+__SC_WRAP(__NR_acct, sys_acct)
 
 /* kernel/capability.c */
 #define __NR_capget 90
-__SYSCALL(__NR_capget, sys_capget)
+__SC_WRAP(__NR_capget, sys_capget)
 #define __NR_capset 91
-__SYSCALL(__NR_capset, sys_capset)
+__SC_WRAP(__NR_capset, sys_capset)
 
 /* kernel/exec_domain.c */
 #define __NR_personality 92
@@ -303,9 +303,9 @@ __SC_COMP(__NR_waitid, sys_waitid, compat_sys_waitid)
 
 /* kernel/fork.c */
 #define __NR_set_tid_address 96
-__SYSCALL(__NR_set_tid_address, sys_set_tid_address)
+__SC_WRAP(__NR_set_tid_address, sys_set_tid_address)
 #define __NR_unshare 97
-__SYSCALL(__NR_unshare, sys_unshare)
+__SC_WRAP(__NR_unshare, sys_unshare)
 
 /* kernel/futex.c */
 #define __NR_futex 98
@@ -333,9 +333,9 @@ __SC_COMP(__NR_kexec_load, sys_kexec_load, compat_sys_kexec_load)
 
 /* kernel/module.c */
 #define __NR_init_module 105
-__SYSCALL(__NR_init_module, sys_init_module)
+__SC_WRAP(__NR_init_module, sys_init_module)
 #define __NR_delete_module 106
-__SYSCALL(__NR_delete_module, sys_delete_module)
+__SC_WRAP(__NR_delete_module, sys_delete_module)
 
 /* kernel/posix-timers.c */
 #define __NR_timer_create 107
@@ -360,7 +360,7 @@ __SC_COMP(__NR_clock_nanosleep, sys_clock_nanosleep, \
 
 /* kernel/printk.c */
 #define __NR_syslog 116
-__SYSCALL(__NR_syslog, sys_syslog)
+__SC_WRAP(__NR_syslog, sys_syslog)
 
 /* kernel/ptrace.c */
 #define __NR_ptrace 117
@@ -368,13 +368,13 @@ __SYSCALL(__NR_ptrace, sys_ptrace)
 
 /* kernel/sched/core.c */
 #define __NR_sched_setparam 118
-__SYSCALL(__NR_sched_setparam, sys_sched_setparam)
+__SC_WRAP(__NR_sched_setparam, sys_sched_setparam)
 #define __NR_sched_setscheduler 119
-__SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler)
+__SC_WRAP(__NR_sched_setscheduler, sys_sched_setscheduler)
 #define __NR_sched_getscheduler 120
 __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler)
 #define __NR_sched_getparam 121
-__SYSCALL(__NR_sched_getparam, sys_sched_getparam)
+__SC_WRAP(__NR_sched_getparam, sys_sched_getparam)
 #define __NR_sched_setaffinity 122
 __SC_COMP(__NR_sched_setaffinity, sys_sched_setaffinity, \
 	  compat_sys_sched_setaffinity)
@@ -425,7 +425,7 @@ __SYSCALL(__NR_setpriority, sys_setpriority)
 #define __NR_getpriority 141
 __SYSCALL(__NR_getpriority, sys_getpriority)
 #define __NR_reboot 142
-__SYSCALL(__NR_reboot, sys_reboot)
+__SC_WRAP(__NR_reboot, sys_reboot)
 #define __NR_setregid 143
 __SYSCALL(__NR_setregid, sys_setregid)
 #define __NR_setgid 144
@@ -437,11 +437,11 @@ __SYSCALL(__NR_setuid, sys_setuid)
 #define __NR_setresuid 147
 __SYSCALL(__NR_setresuid, sys_setresuid)
 #define __NR_getresuid 148
-__SYSCALL(__NR_getresuid, sys_getresuid)
+__SC_WRAP(__NR_getresuid, sys_getresuid)
 #define __NR_setresgid 149
 __SYSCALL(__NR_setresgid, sys_setresgid)
 #define __NR_getresgid 150
-__SYSCALL(__NR_getresgid, sys_getresgid)
+__SC_WRAP(__NR_getresgid, sys_getresgid)
 #define __NR_setfsuid 151
 __SYSCALL(__NR_setfsuid, sys_setfsuid)
 #define __NR_setfsgid 152
@@ -457,15 +457,15 @@ __SYSCALL(__NR_getsid, sys_getsid)
 #define __NR_setsid 157
 __SYSCALL(__NR_setsid, sys_setsid)
 #define __NR_getgroups 158
-__SYSCALL(__NR_getgroups, sys_getgroups)
+__SC_WRAP(__NR_getgroups, sys_getgroups)
 #define __NR_setgroups 159
-__SYSCALL(__NR_setgroups, sys_setgroups)
+__SC_WRAP(__NR_setgroups, sys_setgroups)
 #define __NR_uname 160
-__SYSCALL(__NR_uname, sys_newuname)
+__SC_WRAP(__NR_uname, sys_newuname)
 #define __NR_sethostname 161
-__SYSCALL(__NR_sethostname, sys_sethostname)
+__SC_WRAP(__NR_sethostname, sys_sethostname)
 #define __NR_setdomainname 162
-__SYSCALL(__NR_setdomainname, sys_setdomainname)
+__SC_WRAP(__NR_setdomainname, sys_setdomainname)
 #define __NR_getrlimit 163
 __SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
 #define __NR_setrlimit 164
@@ -475,9 +475,9 @@ __SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
 #define __NR_umask 166
 __SYSCALL(__NR_umask, sys_umask)
 #define __NR_prctl 167
-__SYSCALL(__NR_prctl, sys_prctl)
+__SC_WRAP(__NR_prctl, sys_prctl)
 #define __NR_getcpu 168
-__SYSCALL(__NR_getcpu, sys_getcpu)
+__SC_WRAP(__NR_getcpu, sys_getcpu)
 
 /* kernel/time.c */
 #define __NR_gettimeofday 169
@@ -509,7 +509,7 @@ __SC_COMP(__NR_sysinfo, sys_sysinfo, compat_sys_sysinfo)
 #define __NR_mq_open 180
 __SC_COMP(__NR_mq_open, sys_mq_open, compat_sys_mq_open)
 #define __NR_mq_unlink 181
-__SYSCALL(__NR_mq_unlink, sys_mq_unlink)
+__SC_WRAP(__NR_mq_unlink, sys_mq_unlink)
 #define __NR_mq_timedsend 182
 __SC_COMP(__NR_mq_timedsend, sys_mq_timedsend, compat_sys_mq_timedsend)
 #define __NR_mq_timedreceive 183
@@ -554,21 +554,21 @@ __SYSCALL(__NR_shmdt, sys_shmdt)
 #define __NR_socket 198
 __SYSCALL(__NR_socket, sys_socket)
 #define __NR_socketpair 199
-__SYSCALL(__NR_socketpair, sys_socketpair)
+__SC_WRAP(__NR_socketpair, sys_socketpair)
 #define __NR_bind 200
-__SYSCALL(__NR_bind, sys_bind)
+__SC_WRAP(__NR_bind, sys_bind)
 #define __NR_listen 201
 __SYSCALL(__NR_listen, sys_listen)
 #define __NR_accept 202
 __SYSCALL(__NR_accept, sys_accept)
 #define __NR_connect 203
-__SYSCALL(__NR_connect, sys_connect)
+__SC_WRAP(__NR_connect, sys_connect)
 #define __NR_getsockname 204
-__SYSCALL(__NR_getsockname, sys_getsockname)
+__SC_WRAP(__NR_getsockname, sys_getsockname)
 #define __NR_getpeername 205
-__SYSCALL(__NR_getpeername, sys_getpeername)
+__SC_WRAP(__NR_getpeername, sys_getpeername)
 #define __NR_sendto 206
-__SYSCALL(__NR_sendto, sys_sendto)
+__SC_WRAP(__NR_sendto, sys_sendto)
 #define __NR_recvfrom 207
 __SC_COMP(__NR_recvfrom, sys_recvfrom, compat_sys_recvfrom)
 #define __NR_setsockopt 208
@@ -588,23 +588,23 @@ __SC_COMP(__NR_readahead, sys_readahead, compat_sys_readahead)
 
 /* mm/nommu.c, also with MMU */
 #define __NR_brk 214
-__SYSCALL(__NR_brk, sys_brk)
+__SC_WRAP(__NR_brk, sys_brk)
 #define __NR_munmap 215
-__SYSCALL(__NR_munmap, sys_munmap)
+__SC_WRAP(__NR_munmap, sys_munmap)
 #define __NR_mremap 216
-__SYSCALL(__NR_mremap, sys_mremap)
+__SC_WRAP(__NR_mremap, sys_mremap)
 
 /* security/keys/keyctl.c */
 #define __NR_add_key 217
-__SYSCALL(__NR_add_key, sys_add_key)
+__SC_WRAP(__NR_add_key, sys_add_key)
 #define __NR_request_key 218
-__SYSCALL(__NR_request_key, sys_request_key)
+__SC_WRAP(__NR_request_key, sys_request_key)
 #define __NR_keyctl 219
 __SC_COMP(__NR_keyctl, sys_keyctl, compat_sys_keyctl)
 
 /* arch/example/kernel/sys_example.c */
 #define __NR_clone 220
-__SYSCALL(__NR_clone, sys_clone)
+__SC_WRAP(__NR_clone, sys_clone)
 #define __NR_execve 221
 __SC_COMP(__NR_execve, sys_execve, compat_sys_execve)
 
@@ -617,27 +617,27 @@ __SC_COMP(__NR3264_fadvise64, sys_fadvise64_64, compat_sys_fadvise64_64)
 /* mm/, CONFIG_MMU only */
 #ifndef __ARCH_NOMMU
 #define __NR_swapon 224
-__SYSCALL(__NR_swapon, sys_swapon)
+__SC_WRAP(__NR_swapon, sys_swapon)
 #define __NR_swapoff 225
-__SYSCALL(__NR_swapoff, sys_swapoff)
+__SC_WRAP(__NR_swapoff, sys_swapoff)
 #define __NR_mprotect 226
-__SYSCALL(__NR_mprotect, sys_mprotect)
+__SC_WRAP(__NR_mprotect, sys_mprotect)
 #define __NR_msync 227
-__SYSCALL(__NR_msync, sys_msync)
+__SC_WRAP(__NR_msync, sys_msync)
 #define __NR_mlock 228
-__SYSCALL(__NR_mlock, sys_mlock)
+__SC_WRAP(__NR_mlock, sys_mlock)
 #define __NR_munlock 229
-__SYSCALL(__NR_munlock, sys_munlock)
+__SC_WRAP(__NR_munlock, sys_munlock)
 #define __NR_mlockall 230
 __SYSCALL(__NR_mlockall, sys_mlockall)
 #define __NR_munlockall 231
 __SYSCALL(__NR_munlockall, sys_munlockall)
 #define __NR_mincore 232
-__SYSCALL(__NR_mincore, sys_mincore)
+__SC_WRAP(__NR_mincore, sys_mincore)
 #define __NR_madvise 233
-__SYSCALL(__NR_madvise, sys_madvise)
+__SC_WRAP(__NR_madvise, sys_madvise)
 #define __NR_remap_file_pages 234
-__SYSCALL(__NR_remap_file_pages, sys_remap_file_pages)
+__SC_WRAP(__NR_remap_file_pages, sys_remap_file_pages)
 #define __NR_mbind 235
 __SC_COMP(__NR_mbind, sys_mbind, compat_sys_mbind)
 #define __NR_get_mempolicy 236
@@ -654,9 +654,9 @@ __SC_COMP(__NR_move_pages, sys_move_pages, compat_sys_move_pages)
 __SC_COMP(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, \
 	  compat_sys_rt_tgsigqueueinfo)
 #define __NR_perf_event_open 241
-__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
+__SC_WRAP(__NR_perf_event_open, sys_perf_event_open)
 #define __NR_accept4 242
-__SYSCALL(__NR_accept4, sys_accept4)
+__SC_WRAP(__NR_accept4, sys_accept4)
 #define __NR_recvmmsg 243
 __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
 
@@ -669,13 +669,13 @@ __SC_COMP(__NR_recvmmsg, sys_recvmmsg, compat_sys_recvmmsg)
 #define __NR_wait4 260
 __SC_COMP(__NR_wait4, sys_wait4, compat_sys_wait4)
 #define __NR_prlimit64 261
-__SYSCALL(__NR_prlimit64, sys_prlimit64)
+__SC_WRAP(__NR_prlimit64, sys_prlimit64)
 #define __NR_fanotify_init 262
 __SYSCALL(__NR_fanotify_init, sys_fanotify_init)
 #define __NR_fanotify_mark 263
 __SYSCALL(__NR_fanotify_mark, sys_fanotify_mark)
 #define __NR_name_to_handle_at         264
-__SYSCALL(__NR_name_to_handle_at, sys_name_to_handle_at)
+__SC_WRAP(__NR_name_to_handle_at, sys_name_to_handle_at)
 #define __NR_open_by_handle_at         265
 __SC_COMP(__NR_open_by_handle_at, sys_open_by_handle_at, \
 	  compat_sys_open_by_handle_at)
@@ -694,23 +694,23 @@ __SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \
 __SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \
           compat_sys_process_vm_writev)
 #define __NR_kcmp 272
-__SYSCALL(__NR_kcmp, sys_kcmp)
+__SC_WRAP(__NR_kcmp, sys_kcmp)
 #define __NR_finit_module 273
-__SYSCALL(__NR_finit_module, sys_finit_module)
+__SC_WRAP(__NR_finit_module, sys_finit_module)
 #define __NR_sched_setattr 274
-__SYSCALL(__NR_sched_setattr, sys_sched_setattr)
+__SC_WRAP(__NR_sched_setattr, sys_sched_setattr)
 #define __NR_sched_getattr 275
-__SYSCALL(__NR_sched_getattr, sys_sched_getattr)
+__SC_WRAP(__NR_sched_getattr, sys_sched_getattr)
 #define __NR_renameat2 276
-__SYSCALL(__NR_renameat2, sys_renameat2)
+__SC_WRAP(__NR_renameat2, sys_renameat2)
 #define __NR_seccomp 277
-__SYSCALL(__NR_seccomp, sys_seccomp)
+__SC_WRAP(__NR_seccomp, sys_seccomp)
 #define __NR_getrandom 278
-__SYSCALL(__NR_getrandom, sys_getrandom)
+__SC_WRAP(__NR_getrandom, sys_getrandom)
 #define __NR_memfd_create 279
-__SYSCALL(__NR_memfd_create, sys_memfd_create)
+__SC_WRAP(__NR_memfd_create, sys_memfd_create)
 #define __NR_bpf 280
-__SYSCALL(__NR_bpf, sys_bpf)
+__SC_WRAP(__NR_bpf, sys_bpf)
 #define __NR_execveat 281
 __SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
 #define __NR_userfaultfd 282
@@ -718,7 +718,7 @@ __SYSCALL(__NR_userfaultfd, sys_userfaultfd)
 #define __NR_membarrier 283
 __SYSCALL(__NR_membarrier, sys_membarrier)
 #define __NR_mlock2 284
-__SYSCALL(__NR_mlock2, sys_mlock2)
+__SC_WRAP(__NR_mlock2, sys_mlock2)
 
 #undef __NR_syscalls
 #define __NR_syscalls 285
@@ -735,29 +735,29 @@ __SYSCALL(__NR_mlock2, sys_mlock2)
 #define __NR_open 1024
 __SYSCALL(__NR_open, sys_open)
 #define __NR_link 1025
-__SYSCALL(__NR_link, sys_link)
+__SC_WRAP(__NR_link, sys_link)
 #define __NR_unlink 1026
-__SYSCALL(__NR_unlink, sys_unlink)
+__SC_WRAP(__NR_unlink, sys_unlink)
 #define __NR_mknod 1027
-__SYSCALL(__NR_mknod, sys_mknod)
+__SC_WRAP(__NR_mknod, sys_mknod)
 #define __NR_chmod 1028
-__SYSCALL(__NR_chmod, sys_chmod)
+__SC_WRAP(__NR_chmod, sys_chmod)
 #define __NR_chown 1029
-__SYSCALL(__NR_chown, sys_chown)
+__SC_WRAP(__NR_chown, sys_chown)
 #define __NR_mkdir 1030
-__SYSCALL(__NR_mkdir, sys_mkdir)
+__SC_WRAP(__NR_mkdir, sys_mkdir)
 #define __NR_rmdir 1031
-__SYSCALL(__NR_rmdir, sys_rmdir)
+__SC_WRAP(__NR_rmdir, sys_rmdir)
 #define __NR_lchown 1032
-__SYSCALL(__NR_lchown, sys_lchown)
+__SC_WRAP(__NR_lchown, sys_lchown)
 #define __NR_access 1033
-__SYSCALL(__NR_access, sys_access)
+__SC_WRAP(__NR_access, sys_access)
 #define __NR_rename 1034
-__SYSCALL(__NR_rename, sys_rename)
+__SC_WRAP(__NR_rename, sys_rename)
 #define __NR_readlink 1035
-__SYSCALL(__NR_readlink, sys_readlink)
+__SC_WRAP(__NR_readlink, sys_readlink)
 #define __NR_symlink 1036
-__SYSCALL(__NR_symlink, sys_symlink)
+__SC_WRAP(__NR_symlink, sys_symlink)
 #define __NR_utimes 1037
 __SYSCALL(__NR_utimes, sys_utimes)
 #define __NR3264_stat 1038
@@ -771,7 +771,7 @@ __SC_3264(__NR3264_lstat, sys_lstat64, sys_newlstat)
 
 #ifdef __ARCH_WANT_SYSCALL_NO_FLAGS
 #define __NR_pipe 1040
-__SYSCALL(__NR_pipe, sys_pipe)
+__SC_WRAP(__NR_pipe, sys_pipe)
 #define __NR_dup2 1041
 __SYSCALL(__NR_dup2, sys_dup2)
 #define __NR_epoll_create 1042
@@ -841,7 +841,7 @@ __SYSCALL(__NR_time, sys_time)
 __SYSCALL(__NR_utime, sys_utime)
 
 #define __NR_creat 1064
-__SYSCALL(__NR_creat, sys_creat)
+__SC_WRAP(__NR_creat, sys_creat)
 #define __NR_getdents 1065
 #define __ARCH_WANT_SYS_GETDENTS
 __SYSCALL(__NR_getdents, sys_getdents)
@@ -851,9 +851,9 @@ __SYSCALL(__NR_futimesat, sys_futimesat)
 #define __ARCH_WANT_SYS_SELECT
 __SYSCALL(__NR_select, sys_select)
 #define __NR_poll 1068
-__SYSCALL(__NR_poll, sys_poll)
+__SC_WRAP(__NR_poll, sys_poll)
 #define __NR_epoll_wait 1069
-__SYSCALL(__NR_epoll_wait, sys_epoll_wait)
+__SC_WRAP(__NR_epoll_wait, sys_epoll_wait)
 #define __NR_ustat 1070
 __SYSCALL(__NR_ustat, sys_ustat)
 #define __NR_vfork 1071
@@ -865,12 +865,12 @@ __SYSCALL(__NR_recv, sys_recv)
 #define __NR_send 1074
 __SYSCALL(__NR_send, sys_send)
 #define __NR_bdflush 1075
-__SYSCALL(__NR_bdflush, sys_bdflush)
+__SC_WRAP(__NR_bdflush, sys_bdflush)
 #define __NR_umount 1076
-__SYSCALL(__NR_umount, sys_oldumount)
+__SC_WRAP(__NR_umount, sys_oldumount)
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __NR_uselib 1077
-__SYSCALL(__NR_uselib, sys_uselib)
+__SC_WRAP(__NR_uselib, sys_uselib)
 #define __NR__sysctl 1078
 __SYSCALL(__NR__sysctl, sys_sysctl)
 
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 161a180..01b8d15 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -27,6 +27,7 @@
 #include <linux/vmalloc.h>
 #include <linux/netlink.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/audit.h>
 #include <linux/signal.h>
 #include <linux/mutex.h>
@@ -849,7 +850,7 @@ out_putname:
 	return fd;
 }
 
-SYSCALL_DEFINE1(mq_unlink, const char __user *, u_name)
+SYSCALL_DEFINE_WRAP1(mq_unlink, const char __user *, u_name)
 {
 	int err;
 	struct filename *name;
diff --git a/kernel/acct.c b/kernel/acct.c
index 74963d1..76fc391 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -54,6 +54,7 @@
 #include <linux/jiffies.h>
 #include <linux/times.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mount.h>
 #include <linux/uaccess.h>
 #include <asm/div64.h>
@@ -267,7 +268,7 @@ static DEFINE_MUTEX(acct_on_mutex);
  * should be written. If the filename is NULL, accounting will be
  * shutdown.
  */
-SYSCALL_DEFINE1(acct, const char __user *, name)
+SYSCALL_DEFINE_WRAP1(acct, const char __user *, name)
 {
 	int error = 0;
 
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 3b39550..bfd5e87 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -11,6 +11,7 @@
  */
 #include <linux/bpf.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/anon_inodes.h>
 #include <linux/file.h>
@@ -706,7 +707,7 @@ static int bpf_obj_get(const union bpf_attr *attr)
 	return bpf_obj_get_user(u64_to_ptr(attr->pathname));
 }
 
-SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
+SYSCALL_DEFINE_WRAP3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, size)
 {
 	union bpf_attr attr = {};
 	int err;
diff --git a/kernel/capability.c b/kernel/capability.c
index 45432b5..f353690 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -15,6 +15,7 @@
 #include <linux/export.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/pid_namespace.h>
 #include <linux/user_namespace.h>
 #include <asm/uaccess.h>
@@ -146,7 +147,7 @@ static inline int cap_get_target_pid(pid_t pid, kernel_cap_t *pEp,
  *
  * Returns 0 on success and < 0 on error.
  */
-SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
+SYSCALL_DEFINE_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
 {
 	int ret = 0;
 	pid_t pid;
@@ -220,7 +221,7 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
  *
  * Returns 0 on success and < 0 on error.
  */
-SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
+SYSCALL_DEFINE_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data)
 {
 	struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
 	unsigned i, tocopy, copybytes;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index cfc227c..7b35332 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8243,7 +8243,7 @@ static int perf_event_set_clock(struct perf_event *event, clockid_t clk_id)
  * @cpu:		target cpu
  * @group_fd:		group leader event fd
  */
-SYSCALL_DEFINE5(perf_event_open,
+SYSCALL_DEFINE_WRAP5(perf_event_open,
 		struct perf_event_attr __user *, attr_uptr,
 		pid_t, pid, int, cpu, int, group_fd, unsigned long, flags)
 {
diff --git a/kernel/fork.c b/kernel/fork.c
index 1155eac..6bd4aff 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1196,7 +1196,7 @@ static void copy_seccomp(struct task_struct *p)
 #endif
 }
 
-SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)
+SYSCALL_DEFINE_WRAP1(set_tid_address, int __user *, tidptr)
 {
 	current->clear_child_tid = tidptr;
 
@@ -1806,23 +1806,23 @@ SYSCALL_DEFINE0(vfork)
 
 #ifdef __ARCH_WANT_SYS_CLONE
 #ifdef CONFIG_CLONE_BACKWARDS
-SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, clone_flags, unsigned long, newsp,
 		 int __user *, parent_tidptr,
 		 unsigned long, tls,
 		 int __user *, child_tidptr)
 #elif defined(CONFIG_CLONE_BACKWARDS2)
-SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, newsp, unsigned long, clone_flags,
 		 int __user *, parent_tidptr,
 		 int __user *, child_tidptr,
 		 unsigned long, tls)
 #elif defined(CONFIG_CLONE_BACKWARDS3)
-SYSCALL_DEFINE6(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP6(clone, unsigned long, clone_flags, unsigned long, newsp,
 		int, stack_size,
 		int __user *, parent_tidptr,
 		int __user *, child_tidptr,
 		unsigned long, tls)
 #else
-SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
+SYSCALL_DEFINE_WRAP5(clone, unsigned long, clone_flags, unsigned long, newsp,
 		 int __user *, parent_tidptr,
 		 int __user *, child_tidptr,
 		 unsigned long, tls)
@@ -1953,7 +1953,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp
  * constructed. Here we are modifying the current, active,
  * task_struct.
  */
-SYSCALL_DEFINE1(unshare, unsigned long, unshare_flags)
+SYSCALL_DEFINE_WRAP1(unshare, unsigned long, unshare_flags)
 {
 	struct fs_struct *fs, *new_fs = NULL;
 	struct files_struct *fd, *new_fd = NULL;
diff --git a/kernel/groups.c b/kernel/groups.c
index 74d431d..b92dd33 100644
--- a/kernel/groups.c
+++ b/kernel/groups.c
@@ -6,6 +6,7 @@
 #include <linux/slab.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/user_namespace.h>
 #include <asm/uaccess.h>
 
@@ -187,7 +188,7 @@ int set_current_groups(struct group_info *group_info)
 
 EXPORT_SYMBOL(set_current_groups);
 
-SYSCALL_DEFINE2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
+SYSCALL_DEFINE_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
 	const struct cred *cred = current_cred();
 	int i;
@@ -224,7 +225,7 @@ bool may_setgroups(void)
  *	without another task interfering.
  */
 
-SYSCALL_DEFINE2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
+SYSCALL_DEFINE_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist)
 {
 	struct group_info *group_info;
 	int retval;
diff --git a/kernel/kcmp.c b/kernel/kcmp.c
index 0aa69ea..deca910 100644
--- a/kernel/kcmp.c
+++ b/kernel/kcmp.c
@@ -1,5 +1,6 @@
 #include <linux/kernel.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fdtable.h>
 #include <linux/string.h>
 #include <linux/random.h>
@@ -94,7 +95,7 @@ static int kcmp_lock(struct mutex *m1, struct mutex *m2)
 	return err;
 }
 
-SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
+SYSCALL_DEFINE_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
 		unsigned long, idx1, unsigned long, idx2)
 {
 	struct task_struct *task1, *task2;
diff --git a/kernel/module.c b/kernel/module.c
index 38c7bd5..89fcca7 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -32,6 +32,7 @@
 #include <linux/security.h>
 #include <linux/seq_file.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 #include <linux/rcupdate.h>
 #include <linux/capability.h>
@@ -947,7 +948,7 @@ EXPORT_SYMBOL(module_refcount);
 /* This exists whether we can unload or not */
 static void free_module(struct module *mod);
 
-SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
+SYSCALL_DEFINE_WRAP2(delete_module, const char __user *, name_user,
 		unsigned int, flags)
 {
 	struct module *mod;
@@ -3586,7 +3587,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
 	return err;
 }
 
-SYSCALL_DEFINE3(init_module, void __user *, umod,
+SYSCALL_DEFINE_WRAP3(init_module, void __user *, umod,
 		unsigned long, len, const char __user *, uargs)
 {
 	int err;
@@ -3606,7 +3607,7 @@ SYSCALL_DEFINE3(init_module, void __user *, umod,
 	return load_module(&info, uargs, 0);
 }
 
-SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
+SYSCALL_DEFINE_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags)
 {
 	int err;
 	struct load_info info = { };
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 2ce8826..156f37e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -33,6 +33,7 @@
 #include <linux/bootmem.h>
 #include <linux/memblock.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/kexec.h>
 #include <linux/kdb.h>
 #include <linux/ratelimit.h>
@@ -1420,7 +1421,7 @@ out:
 	return error;
 }
 
-SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len)
+SYSCALL_DEFINE_WRAP3(syslog, int, type, char __user *, buf, int, len)
 {
 	return do_syslog(type, buf, len, SYSLOG_FROM_READER);
 }
diff --git a/kernel/reboot.c b/kernel/reboot.c
index bd30a97..70e4537 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -14,6 +14,7 @@
 #include <linux/reboot.h>
 #include <linux/suspend.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/syscore_ops.h>
 #include <linux/uaccess.h>
 
@@ -277,7 +278,7 @@ static DEFINE_MUTEX(reboot_mutex);
  *
  * reboot doesn't sync: do that yourself before calling this.
  */
-SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
+SYSCALL_DEFINE_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd,
 		void __user *, arg)
 {
 	struct pid_namespace *pid_ns = task_active_pid_ns(current);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 732e993..1f20193 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -58,6 +58,7 @@
 #include <linux/seq_file.h>
 #include <linux/sysctl.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/times.h>
 #include <linux/tsacct_kern.h>
 #include <linux/kprobes.h>
@@ -4184,7 +4185,7 @@ err_size:
  *
  * Return: 0 on success. An error code otherwise.
  */
-SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy,
+SYSCALL_DEFINE_WRAP3(sched_setscheduler, pid_t, pid, int, policy,
 		struct sched_param __user *, param)
 {
 	/* negative values for policy are not valid */
@@ -4201,7 +4202,7 @@ SYSCALL_DEFINE3(sched_setscheduler, pid_t, pid, int, policy,
  *
  * Return: 0 on success. An error code otherwise.
  */
-SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
+SYSCALL_DEFINE_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
 {
 	return do_sched_setscheduler(pid, SETPARAM_POLICY, param);
 }
@@ -4212,7 +4213,7 @@ SYSCALL_DEFINE2(sched_setparam, pid_t, pid, struct sched_param __user *, param)
  * @uattr: structure containing the extended parameters.
  * @flags: for future extension.
  */
-SYSCALL_DEFINE3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
+SYSCALL_DEFINE_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, uattr,
 			       unsigned int, flags)
 {
 	struct sched_attr attr;
@@ -4275,7 +4276,7 @@ SYSCALL_DEFINE1(sched_getscheduler, pid_t, pid)
  * Return: On success, 0 and the RT priority is in @param. Otherwise, an error
  * code.
  */
-SYSCALL_DEFINE2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
+SYSCALL_DEFINE_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param)
 {
 	struct sched_param lp = { .sched_priority = 0 };
 	struct task_struct *p;
@@ -4353,7 +4354,7 @@ static int sched_read_attr(struct sched_attr __user *uattr,
  * @size: sizeof(attr) for fwd/bwd comp.
  * @flags: for future extension.
  */
-SYSCALL_DEFINE4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
+SYSCALL_DEFINE_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr,
 		unsigned int, size, unsigned int, flags)
 {
 	struct sched_attr attr = {
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 580ac2d..b9cb4f5 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -829,7 +829,7 @@ static long do_seccomp(unsigned int op, unsigned int flags,
 	}
 }
 
-SYSCALL_DEFINE3(seccomp, unsigned int, op, unsigned int, flags,
+SYSCALL_DEFINE_WRAP3(seccomp, unsigned int, op, unsigned int, flags,
 			 const char __user *, uargs)
 {
 	return do_seccomp(op, flags, uargs);
diff --git a/kernel/signal.c b/kernel/signal.c
index f3f1f7a..476de6d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3475,7 +3475,7 @@ SYSCALL_DEFINE1(ssetmask, int, newmask)
 /*
  * For backwards compatibility.  Functionality superseded by sigaction.
  */
-SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
+SYSCALL_DEFINE_WRAP2(signal, int, sig, __sighandler_t, handler)
 {
 	struct k_sigaction new_sa, old_sa;
 	int ret;
@@ -3556,7 +3556,7 @@ COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_
 #endif
 
 #ifdef CONFIG_OLD_SIGSUSPEND
-SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
+SYSCALL_DEFINE_WRAP1(sigsuspend, old_sigset_t, mask)
 {
 	sigset_t blocked;
 	siginitset(&blocked, mask);
@@ -3564,7 +3564,7 @@ SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
 }
 #endif
 #ifdef CONFIG_OLD_SIGSUSPEND3
-SYSCALL_DEFINE3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask)
+SYSCALL_DEFINE_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask)
 {
 	sigset_t blocked;
 	siginitset(&blocked, mask);
diff --git a/kernel/sys.c b/kernel/sys.c
index 6af9212..c5689dd 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -642,7 +642,7 @@ error:
 	return retval;
 }
 
-SYSCALL_DEFINE3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t __user *, suidp)
+SYSCALL_DEFINE_WRAP3(getresuid, uid_t __user *, ruidp, uid_t __user *, euidp, uid_t __user *, suidp)
 {
 	const struct cred *cred = current_cred();
 	int retval;
@@ -716,7 +716,7 @@ error:
 	return retval;
 }
 
-SYSCALL_DEFINE3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp)
+SYSCALL_DEFINE_WRAP3(getresgid, gid_t __user *, rgidp, gid_t __user *, egidp, gid_t __user *, sgidp)
 {
 	const struct cred *cred = current_cred();
 	int retval;
@@ -1138,7 +1138,7 @@ static int override_release(char __user *release, size_t len)
 	return ret;
 }
 
-SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
+SYSCALL_DEFINE_WRAP1(newuname, struct new_utsname __user *, name)
 {
 	int errno = 0;
 
@@ -1212,7 +1212,7 @@ SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
 }
 #endif
 
-SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
+SYSCALL_DEFINE_WRAP2(sethostname, char __user *, name, int, len)
 {
 	int errno;
 	char tmp[__NEW_UTS_LEN];
@@ -1263,7 +1263,7 @@ SYSCALL_DEFINE2(gethostname, char __user *, name, int, len)
  * Only setdomainname; getdomainname can be implemented by calling
  * uname()
  */
-SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len)
+SYSCALL_DEFINE_WRAP2(setdomainname, char __user *, name, int, len)
 {
 	int errno;
 	char tmp[__NEW_UTS_LEN];
@@ -1445,7 +1445,7 @@ static int check_prlimit_permission(struct task_struct *task)
 	return -EPERM;
 }
 
-SYSCALL_DEFINE4(prlimit64, pid_t, pid, unsigned int, resource,
+SYSCALL_DEFINE_WRAP4(prlimit64, pid_t, pid, unsigned int, resource,
 		const struct rlimit64 __user *, new_rlim,
 		struct rlimit64 __user *, old_rlim)
 {
@@ -2072,7 +2072,7 @@ static int prctl_get_tid_address(struct task_struct *me, int __user **tid_addr)
 }
 #endif
 
-SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
+SYSCALL_DEFINE_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 		unsigned long, arg4, unsigned long, arg5)
 {
 	struct task_struct *me = current;
@@ -2273,7 +2273,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
 	return error;
 }
 
-SYSCALL_DEFINE3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
+SYSCALL_DEFINE_WRAP3(getcpu, unsigned __user *, cpup, unsigned __user *, nodep,
 		struct getcpu_cache __user *, unused)
 {
 	int err = 0;
diff --git a/mm/madvise.c b/mm/madvise.c
index c889fcb..8390012 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -8,6 +8,7 @@
 #include <linux/mman.h>
 #include <linux/pagemap.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mempolicy.h>
 #include <linux/page-isolation.h>
 #include <linux/hugetlb.h>
@@ -457,7 +458,7 @@ madvise_behavior_valid(int behavior)
  *  -EBADF  - map exists, but area maps something that isn't a file.
  *  -EAGAIN - a kernel resource was temporarily unavailable.
  */
-SYSCALL_DEFINE3(madvise, unsigned long, start, size_t, len_in, int, behavior)
+SYSCALL_DEFINE_WRAP3(madvise, unsigned long, start, size_t, len_in, int, behavior)
 {
 	unsigned long end, tmp;
 	struct vm_area_struct *vma, *prev;
diff --git a/mm/mincore.c b/mm/mincore.c
index 14bb9fb..d6e4395 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -12,6 +12,7 @@
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/hugetlb.h>
@@ -217,7 +218,7 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
  *		mapped
  *  -EAGAIN - A kernel resource was temporarily unavailable.
  */
-SYSCALL_DEFINE3(mincore, unsigned long, start, size_t, len,
+SYSCALL_DEFINE_WRAP3(mincore, unsigned long, start, size_t, len,
 		unsigned char __user *, vec)
 {
 	long retval;
diff --git a/mm/mlock.c b/mm/mlock.c
index 339d9e0..e37e60f 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -14,6 +14,7 @@
 #include <linux/pagevec.h>
 #include <linux/mempolicy.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/sched.h>
 #include <linux/export.h>
 #include <linux/rmap.h>
@@ -640,12 +641,12 @@ static int do_mlock(unsigned long start, size_t len, vm_flags_t flags)
 	return 0;
 }
 
-SYSCALL_DEFINE2(mlock, unsigned long, start, size_t, len)
+SYSCALL_DEFINE_WRAP2(mlock, unsigned long, start, size_t, len)
 {
 	return do_mlock(start, len, VM_LOCKED);
 }
 
-SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
+SYSCALL_DEFINE_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags)
 {
 	vm_flags_t vm_flags = VM_LOCKED;
 
@@ -658,7 +659,7 @@ SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
 	return do_mlock(start, len, vm_flags);
 }
 
-SYSCALL_DEFINE2(munlock, unsigned long, start, size_t, len)
+SYSCALL_DEFINE_WRAP2(munlock, unsigned long, start, size_t, len)
 {
 	int ret;
 
diff --git a/mm/mmap.c b/mm/mmap.c
index 2ce04a6..9b9ae80 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -18,6 +18,7 @@
 #include <linux/pagemap.h>
 #include <linux/swap.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/capability.h>
 #include <linux/init.h>
 #include <linux/file.h>
@@ -283,7 +284,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
 
 static unsigned long do_brk(unsigned long addr, unsigned long len);
 
-SYSCALL_DEFINE1(brk, unsigned long, brk)
+SYSCALL_DEFINE_WRAP1(brk, unsigned long, brk)
 {
 	unsigned long retval;
 	unsigned long newbrk, oldbrk;
@@ -2631,7 +2632,7 @@ int vm_munmap(unsigned long start, size_t len)
 }
 EXPORT_SYMBOL(vm_munmap);
 
-SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+SYSCALL_DEFINE_WRAP2(munmap, unsigned long, addr, size_t, len)
 {
 	profile_munmap(addr);
 	return vm_munmap(addr, len);
@@ -2641,7 +2642,7 @@ SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
 /*
  * Emulation of deprecated remap_file_pages() syscall.
  */
-SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+SYSCALL_DEFINE_WRAP5(remap_file_pages, unsigned long, start, unsigned long, size,
 		unsigned long, prot, unsigned long, pgoff, unsigned long, flags)
 {
 
diff --git a/mm/mprotect.c b/mm/mprotect.c
index ef5be8e..eec7d57 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -18,6 +18,7 @@
 #include <linux/mempolicy.h>
 #include <linux/personality.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/mmu_notifier.h>
@@ -344,7 +345,7 @@ fail:
 	return error;
 }
 
-SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
+SYSCALL_DEFINE_WRAP3(mprotect, unsigned long, start, size_t, len,
 		unsigned long, prot)
 {
 	unsigned long vm_flags, nstart, end, tmp, reqprot;
diff --git a/mm/mremap.c b/mm/mremap.c
index c25bc62..b81462a 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -19,6 +19,7 @@
 #include <linux/highmem.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/mmu_notifier.h>
 #include <linux/sched/sysctl.h>
 #include <linux/uaccess.h>
@@ -468,7 +469,7 @@ static int vma_expandable(struct vm_area_struct *vma, unsigned long delta)
  * MREMAP_FIXED option added 5-Dec-1999 by Benjamin LaHaise
  * This option implies MREMAP_MAYMOVE.
  */
-SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+SYSCALL_DEFINE_WRAP5(mremap, unsigned long, addr, unsigned long, old_len,
 		unsigned long, new_len, unsigned long, flags,
 		unsigned long, new_addr)
 {
diff --git a/mm/msync.c b/mm/msync.c
index 24e612f..1fd9f6a 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -12,6 +12,7 @@
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/sched.h>
 
 /*
@@ -28,7 +29,7 @@
  * So by _not_ starting I/O in MS_ASYNC we provide complete flexibility to
  * applications.
  */
-SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
+SYSCALL_DEFINE_WRAP3(msync, unsigned long, start, size_t, len, int, flags)
 {
 	unsigned long end;
 	struct mm_struct *mm = current->mm;
diff --git a/mm/nommu.c b/mm/nommu.c
index 92be862..59c6baf 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -32,6 +32,7 @@
 #include <linux/personality.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/audit.h>
 #include <linux/sched/sysctl.h>
 #include <linux/printk.h>
@@ -526,7 +527,7 @@ EXPORT_SYMBOL(vm_insert_page);
  *  to a regular file.  in this case, the unmapping will need
  *  to invoke file system routines that need the global lock.
  */
-SYSCALL_DEFINE1(brk, unsigned long, brk)
+SYSCALL_DEFINE_WRAP1(brk, unsigned long, brk)
 {
 	struct mm_struct *mm = current->mm;
 
@@ -1684,7 +1685,7 @@ int vm_munmap(unsigned long addr, size_t len)
 }
 EXPORT_SYMBOL(vm_munmap);
 
-SYSCALL_DEFINE2(munmap, unsigned long, addr, size_t, len)
+SYSCALL_DEFINE_WRAP2(munmap, unsigned long, addr, size_t, len)
 {
 	return vm_munmap(addr, len);
 }
@@ -1760,7 +1761,7 @@ static unsigned long do_mremap(unsigned long addr,
 	return vma->vm_start;
 }
 
-SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
+SYSCALL_DEFINE_WRAP5(mremap, unsigned long, addr, unsigned long, old_len,
 		unsigned long, new_len, unsigned long, flags,
 		unsigned long, new_addr)
 {
diff --git a/mm/shmem.c b/mm/shmem.c
index 2afcdbb..154d3b7 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -67,6 +67,7 @@ static struct vfsmount *shm_mnt;
 #include <linux/seq_file.h>
 #include <linux/magic.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/fcntl.h>
 #include <uapi/linux/memfd.h>
 
@@ -2921,7 +2922,7 @@ static int shmem_show_options(struct seq_file *seq, struct dentry *root)
 
 #define MFD_ALL_FLAGS (MFD_CLOEXEC | MFD_ALLOW_SEALING)
 
-SYSCALL_DEFINE2(memfd_create,
+SYSCALL_DEFINE_WRAP2(memfd_create,
 		const char __user *, uname,
 		unsigned int, flags)
 {
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 5887731..3bb701c 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -28,6 +28,7 @@
 #include <linux/mutex.h>
 #include <linux/capability.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/memcontrol.h>
 #include <linux/poll.h>
 #include <linux/oom.h>
@@ -1841,7 +1842,7 @@ static void reinsert_swap_info(struct swap_info_struct *p)
 	spin_unlock(&swap_lock);
 }
 
-SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
+SYSCALL_DEFINE_WRAP1(swapoff, const char __user *, specialfile)
 {
 	struct swap_info_struct *p = NULL;
 	unsigned char *swap_map;
@@ -2383,7 +2384,7 @@ static bool swap_discardable(struct swap_info_struct *si)
 	return true;
 }
 
-SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
+SYSCALL_DEFINE_WRAP2(swapon, const char __user *, specialfile, int, swap_flags)
 {
 	struct swap_info_struct *p;
 	struct filename *name;
diff --git a/net/socket.c b/net/socket.c
index d730ef9..62b2769 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1251,7 +1251,7 @@ out_release:
  *	Create a pair of connected sockets.
  */
 
-SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol,
+SYSCALL_DEFINE_WRAP4(socketpair, int, family, int, type, int, protocol,
 		int __user *, usockvec)
 {
 	struct socket *sock1, *sock2;
@@ -1360,7 +1360,7 @@ out:
  *	the protocol layer (having also checked the address is ok).
  */
 
-SYSCALL_DEFINE3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
+SYSCALL_DEFINE_WRAP3(bind, int, fd, struct sockaddr __user *, umyaddr, int, addrlen)
 {
 	struct socket *sock;
 	struct sockaddr_storage address;
@@ -1422,7 +1422,7 @@ SYSCALL_DEFINE2(listen, int, fd, int, backlog)
  *	clean when we restucture accept also.
  */
 
-SYSCALL_DEFINE4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
+SYSCALL_DEFINE_WRAP4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
 		int __user *, upeer_addrlen, int, flags)
 {
 	struct socket *sock, *newsock;
@@ -1521,7 +1521,7 @@ SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr,
  *	include the -EINPROGRESS status for such sockets.
  */
 
-SYSCALL_DEFINE3(connect, int, fd, struct sockaddr __user *, uservaddr,
+SYSCALL_DEFINE_WRAP3(connect, int, fd, struct sockaddr __user *, uservaddr,
 		int, addrlen)
 {
 	struct socket *sock;
@@ -1553,7 +1553,7 @@ out:
  *	name to user space.
  */
 
-SYSCALL_DEFINE3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
+SYSCALL_DEFINE_WRAP3(getsockname, int, fd, struct sockaddr __user *, usockaddr,
 		int __user *, usockaddr_len)
 {
 	struct socket *sock;
@@ -1584,7 +1584,7 @@ out:
  *	name to user space.
  */
 
-SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
+SYSCALL_DEFINE_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
 		int __user *, usockaddr_len)
 {
 	struct socket *sock;
@@ -1616,7 +1616,7 @@ SYSCALL_DEFINE3(getpeername, int, fd, struct sockaddr __user *, usockaddr,
  *	the protocol.
  */
 
-SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len,
+SYSCALL_DEFINE_WRAP6(sendto, int, fd, void __user *, buff, size_t, len,
 		unsigned int, flags, struct sockaddr __user *, addr,
 		int, addr_len)
 {
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 1c3872a..bae5a04 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/key.h>
 #include <linux/keyctl.h>
 #include <linux/fs.h>
@@ -57,7 +58,7 @@ static int key_get_type_from_user(char *type,
  * If successful, the new key's serial number is returned, otherwise an error
  * code is returned.
  */
-SYSCALL_DEFINE5(add_key, const char __user *, _type,
+SYSCALL_DEFINE_WRAP5(add_key, const char __user *, _type,
 		const char __user *, _description,
 		const void __user *, _payload,
 		size_t, plen,
@@ -155,7 +156,7 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type,
  * passed to /sbin/request-key to aid with completing the request.  If the
  * _callout_info string is "" then it will be changed to "-".
  */
-SYSCALL_DEFINE4(request_key, const char __user *, _type,
+SYSCALL_DEFINE_WRAP4(request_key, const char __user *, _type,
 		const char __user *, _description,
 		const char __user *, _callout_info,
 		key_serial_t, destringid)
-- 
2.5.0

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

* [PATCH 4/5] all: wrap getdents64 syscall
  2016-01-25 16:57 ` Yury Norov
  (?)
@ 2016-01-25 16:57   ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

This system call may be handled by compat handler if
__ARCH_WANT_COMPAT_SYS_GETDENTS64 is defined. So we
should declare wrapper otherwise only.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 fs/readdir.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/readdir.c b/fs/readdir.c
index ced6791..d34cc49 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -17,6 +17,7 @@
 #include <linux/dirent.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/unistd.h>
 
 #include <asm/uaccess.h>
@@ -274,8 +275,13 @@ efault:
 	return -EFAULT;
 }
 
+#ifndef __ARCH_WANT_COMPAT_SYS_GETDENTS64
+SYSCALL_DEFINE_WRAP3(getdents64, unsigned int, fd,
+		struct linux_dirent64 __user *, dirent, unsigned int, count)
+#else
 SYSCALL_DEFINE3(getdents64, unsigned int, fd,
 		struct linux_dirent64 __user *, dirent, unsigned int, count)
+#endif
 {
 	struct fd f;
 	struct linux_dirent64 __user * lastdirent;
-- 
2.5.0

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

* [PATCH 4/5] all: wrap getdents64 syscall
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

This system call may be handled by compat handler if
__ARCH_WANT_COMPAT_SYS_GETDENTS64 is defined. So we
should declare wrapper otherwise only.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 fs/readdir.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/readdir.c b/fs/readdir.c
index ced6791..d34cc49 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -17,6 +17,7 @@
 #include <linux/dirent.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/unistd.h>
 
 #include <asm/uaccess.h>
@@ -274,8 +275,13 @@ efault:
 	return -EFAULT;
 }
 
+#ifndef __ARCH_WANT_COMPAT_SYS_GETDENTS64
+SYSCALL_DEFINE_WRAP3(getdents64, unsigned int, fd,
+		struct linux_dirent64 __user *, dirent, unsigned int, count)
+#else
 SYSCALL_DEFINE3(getdents64, unsigned int, fd,
 		struct linux_dirent64 __user *, dirent, unsigned int, count)
+#endif
 {
 	struct fd f;
 	struct linux_dirent64 __user * lastdirent;
-- 
2.5.0

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

* [PATCH 4/5] all: wrap getdents64 syscall
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

This system call may be handled by compat handler if
__ARCH_WANT_COMPAT_SYS_GETDENTS64 is defined. So we
should declare wrapper otherwise only.

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 fs/readdir.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/readdir.c b/fs/readdir.c
index ced6791..d34cc49 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -17,6 +17,7 @@
 #include <linux/dirent.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/compat.h>
 #include <linux/unistd.h>
 
 #include <asm/uaccess.h>
@@ -274,8 +275,13 @@ efault:
 	return -EFAULT;
 }
 
+#ifndef __ARCH_WANT_COMPAT_SYS_GETDENTS64
+SYSCALL_DEFINE_WRAP3(getdents64, unsigned int, fd,
+		struct linux_dirent64 __user *, dirent, unsigned int, count)
+#else
 SYSCALL_DEFINE3(getdents64, unsigned int, fd,
 		struct linux_dirent64 __user *, dirent, unsigned int, count)
+#endif
 {
 	struct fd f;
 	struct linux_dirent64 __user * lastdirent;
-- 
2.5.0

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

* [PATCH 5/5] all: introduce COMPAT_WRAPPER option and enable it for s390
  2016-01-25 16:57 ` Yury Norov
  (?)
@ 2016-01-25 16:57   ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/Kconfig      | 4 ++++
 arch/s390/Kconfig | 1 +
 2 files changed, 5 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 4e949e5..ab7692e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -518,6 +518,10 @@ config HAVE_COPY_THREAD_TLS
 	  normal C parameter passing, rather than extracting the syscall
 	  argument from pt_regs.
 
+config COMPAT_WRAPPER
+	bool
+	depends on COMPAT
+
 #
 # ABI hall of shame
 #
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 3a55f49..88f48b0 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -336,6 +336,7 @@ config COMPAT
 	select COMPAT_BINFMT_ELF if BINFMT_ELF
 	select ARCH_WANT_OLD_COMPAT_IPC
 	select COMPAT_OLD_SIGACTION
+	select COMPAT_WRAPPER
 	depends on MULTIUSER
 	help
 	  Select this option if you want to enable your system kernel to
-- 
2.5.0

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

* [PATCH 5/5] all: introduce COMPAT_WRAPPER option and enable it for s390
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch
  Cc: Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/Kconfig      | 4 ++++
 arch/s390/Kconfig | 1 +
 2 files changed, 5 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 4e949e5..ab7692e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -518,6 +518,10 @@ config HAVE_COPY_THREAD_TLS
 	  normal C parameter passing, rather than extracting the syscall
 	  argument from pt_regs.
 
+config COMPAT_WRAPPER
+	bool
+	depends on COMPAT
+
 #
 # ABI hall of shame
 #
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 3a55f49..88f48b0 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -336,6 +336,7 @@ config COMPAT
 	select COMPAT_BINFMT_ELF if BINFMT_ELF
 	select ARCH_WANT_OLD_COMPAT_IPC
 	select COMPAT_OLD_SIGACTION
+	select COMPAT_WRAPPER
 	depends on MULTIUSER
 	help
 	  Select this option if you want to enable your system kernel to
-- 
2.5.0

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

* [PATCH 5/5] all: introduce COMPAT_WRAPPER option and enable it for s390
@ 2016-01-25 16:57   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-25 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
 arch/Kconfig      | 4 ++++
 arch/s390/Kconfig | 1 +
 2 files changed, 5 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 4e949e5..ab7692e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -518,6 +518,10 @@ config HAVE_COPY_THREAD_TLS
 	  normal C parameter passing, rather than extracting the syscall
 	  argument from pt_regs.
 
+config COMPAT_WRAPPER
+	bool
+	depends on COMPAT
+
 #
 # ABI hall of shame
 #
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 3a55f49..88f48b0 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -336,6 +336,7 @@ config COMPAT
 	select COMPAT_BINFMT_ELF if BINFMT_ELF
 	select ARCH_WANT_OLD_COMPAT_IPC
 	select COMPAT_OLD_SIGACTION
+	select COMPAT_WRAPPER
 	depends on MULTIUSER
 	help
 	  Select this option if you want to enable your system kernel to
-- 
2.5.0

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-01-25 16:57   ` Yury Norov
  (?)
  (?)
@ 2016-01-25 18:10     ` kbuild test robot
  -1 siblings, 0 replies; 50+ messages in thread
From: kbuild test robot @ 2016-01-25 18:10 UTC (permalink / raw)
  To: Yury Norov
  Cc: kbuild-all, arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch,
	Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

[-- Attachment #1: Type: text/plain, Size: 38622 bytes --]

Hi Yury,

[auto build test ERROR on v4.4-rc8]
[also build test ERROR on next-20160125]
[cannot apply to s390/features v4.5-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134
config: s390-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

Note: the linux-review/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134 HEAD ef38065534a44f2efabd66ed0860b822cf98e49e builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   fs/notify/fanotify/fanotify_user.c: In function 'compat_SyS_fanotify_mark':
   fs/notify/fanotify/fanotify_user.c:913:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
>> include/linux/syscalls.h:43:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:42:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:915:5: error: expected expression before '__u32'
        __u32, mask0, __u32, mask1, int, dfd,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:41:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP4(m,t,a,...) m(t,a), __MAP3(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:42:35: note: in expansion of macro '__MAP4'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
--
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_chown16':
   arch/s390/kernel/compat_linux.c:89:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:38:23: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP1(m,t,a) m(t,a)
                          ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_lchown16':
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:96:20: error: expected expression before 'u16'
             filename, u16, user, u16, group)
                       ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
..

vim +11 arch/s390/kernel/compat_wrapper.c

1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   5   */
1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   6  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   7  #include <linux/syscalls.h>
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   8  #include <linux/compat.h>
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   9  #include "entry.h"
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  10  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @11  COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  12  COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  13  COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @14  COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  15  COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  16  COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @17  COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  18  COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @19  COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @20  COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  21  COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @22  COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @23  COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  24  COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  25  COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  26  COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  27  COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  28  COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  29  COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  30  COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  31  COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  32  COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  33  COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  34  COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  35  COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @36  COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  37  COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @38  COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @39  COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  40  COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @41  COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  42  COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  43  COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  44  COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  45  COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  46  COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @47  COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  48  COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  49  COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @50  COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  51  COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  52  COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  53  COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @54  COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  55  COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  56  COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @57  COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  58  COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @59  COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @60  COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  61  COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @62  COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @63  COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  64  COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group);
24e4c2aa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  65  COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  66  COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  67  COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  68  COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  69  COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  70  COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  71  COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  72  COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  73  COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  74  COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  75  COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  76  COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  77  COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  78  COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  79  COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  80  COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28 @81  COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  82  COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  83  COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @84  COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  85  COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  86  COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  87  COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id);

:::::: The code at line 11 was first introduced by commit
:::::: b07edab23c7f93db0e7ab09bd7f5eddc421f6e8c s390/compat: convert system call wrappers to C part 01

:::::: TO: Heiko Carstens <heiko.carstens@de.ibm.com>
:::::: CC: Heiko Carstens <heiko.carstens@de.ibm.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 39393 bytes --]

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-25 18:10     ` kbuild test robot
  0 siblings, 0 replies; 50+ messages in thread
From: kbuild test robot @ 2016-01-25 18:10 UTC (permalink / raw)
  Cc: kbuild-all, arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch,
	Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux, Yury Norov

[-- Attachment #1: Type: text/plain, Size: 38622 bytes --]

Hi Yury,

[auto build test ERROR on v4.4-rc8]
[also build test ERROR on next-20160125]
[cannot apply to s390/features v4.5-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134
config: s390-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

Note: the linux-review/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134 HEAD ef38065534a44f2efabd66ed0860b822cf98e49e builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   fs/notify/fanotify/fanotify_user.c: In function 'compat_SyS_fanotify_mark':
   fs/notify/fanotify/fanotify_user.c:913:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
>> include/linux/syscalls.h:43:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:42:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:915:5: error: expected expression before '__u32'
        __u32, mask0, __u32, mask1, int, dfd,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:41:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP4(m,t,a,...) m(t,a), __MAP3(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:42:35: note: in expansion of macro '__MAP4'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
--
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_chown16':
   arch/s390/kernel/compat_linux.c:89:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:38:23: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP1(m,t,a) m(t,a)
                          ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_lchown16':
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:96:20: error: expected expression before 'u16'
             filename, u16, user, u16, group)
                       ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
..

vim +11 arch/s390/kernel/compat_wrapper.c

1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   5   */
1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   6  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   7  #include <linux/syscalls.h>
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   8  #include <linux/compat.h>
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   9  #include "entry.h"
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  10  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @11  COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  12  COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  13  COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @14  COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  15  COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  16  COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @17  COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  18  COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @19  COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @20  COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  21  COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @22  COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @23  COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  24  COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  25  COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  26  COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  27  COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  28  COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  29  COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  30  COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  31  COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  32  COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  33  COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  34  COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  35  COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @36  COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  37  COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @38  COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @39  COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  40  COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @41  COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  42  COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  43  COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  44  COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  45  COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  46  COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @47  COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  48  COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  49  COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @50  COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  51  COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  52  COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  53  COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @54  COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  55  COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  56  COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @57  COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  58  COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @59  COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @60  COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  61  COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @62  COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @63  COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  64  COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group);
24e4c2aa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  65  COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  66  COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  67  COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  68  COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  69  COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  70  COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  71  COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  72  COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  73  COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  74  COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  75  COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  76  COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  77  COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  78  COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  79  COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  80  COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28 @81  COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  82  COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  83  COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @84  COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  85  COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  86  COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  87  COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id);

:::::: The code at line 11 was first introduced by commit
:::::: b07edab23c7f93db0e7ab09bd7f5eddc421f6e8c s390/compat: convert system call wrappers to C part 01

:::::: TO: Heiko Carstens <heiko.carstens@de.ibm.com>
:::::: CC: Heiko Carstens <heiko.carstens@de.ibm.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 39393 bytes --]

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-25 18:10     ` kbuild test robot
  0 siblings, 0 replies; 50+ messages in thread
From: kbuild test robot @ 2016-01-25 18:10 UTC (permalink / raw)
  To: Yury Norov
  Cc: kbuild-all, arnd, catalin.marinas, heiko.carstens, schwidefsky,
	linux-arm-kernel, linux-kernel, linux-s390, linux-arch,
	Prasun.Kapoor, pinskia, agraf, broonie, joseph,
	christoph.muellner, Nathan_Lynch, klimov.linux

[-- Attachment #1: Type: text/plain, Size: 38622 bytes --]

Hi Yury,

[auto build test ERROR on v4.4-rc8]
[also build test ERROR on next-20160125]
[cannot apply to s390/features v4.5-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134
config: s390-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

Note: the linux-review/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134 HEAD ef38065534a44f2efabd66ed0860b822cf98e49e builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   fs/notify/fanotify/fanotify_user.c: In function 'compat_SyS_fanotify_mark':
   fs/notify/fanotify/fanotify_user.c:913:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
>> include/linux/syscalls.h:43:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:42:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:915:5: error: expected expression before '__u32'
        __u32, mask0, __u32, mask1, int, dfd,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:41:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP4(m,t,a,...) m(t,a), __MAP3(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:42:35: note: in expansion of macro '__MAP4'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
--
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_chown16':
   arch/s390/kernel/compat_linux.c:89:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:38:23: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP1(m,t,a) m(t,a)
                          ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_lchown16':
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:96:20: error: expected expression before 'u16'
             filename, u16, user, u16, group)
                       ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
..

vim +11 arch/s390/kernel/compat_wrapper.c

1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   5   */
1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   6  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   7  #include <linux/syscalls.h>
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   8  #include <linux/compat.h>
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   9  #include "entry.h"
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  10  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @11  COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  12  COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  13  COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @14  COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  15  COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  16  COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @17  COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  18  COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @19  COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @20  COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  21  COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @22  COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @23  COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  24  COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  25  COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  26  COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  27  COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  28  COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  29  COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  30  COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  31  COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  32  COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  33  COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  34  COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  35  COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @36  COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  37  COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @38  COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @39  COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  40  COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @41  COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  42  COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  43  COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  44  COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  45  COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  46  COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @47  COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  48  COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  49  COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @50  COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  51  COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  52  COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  53  COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @54  COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  55  COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  56  COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @57  COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  58  COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @59  COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @60  COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  61  COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @62  COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @63  COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  64  COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group);
24e4c2aa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  65  COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  66  COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  67  COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  68  COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  69  COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  70  COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  71  COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  72  COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  73  COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  74  COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  75  COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  76  COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  77  COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  78  COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  79  COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  80  COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28 @81  COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  82  COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  83  COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @84  COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  85  COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  86  COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  87  COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id);

:::::: The code at line 11 was first introduced by commit
:::::: b07edab23c7f93db0e7ab09bd7f5eddc421f6e8c s390/compat: convert system call wrappers to C part 01

:::::: TO: Heiko Carstens <heiko.carstens@de.ibm.com>
:::::: CC: Heiko Carstens <heiko.carstens@de.ibm.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 39393 bytes --]

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-25 18:10     ` kbuild test robot
  0 siblings, 0 replies; 50+ messages in thread
From: kbuild test robot @ 2016-01-25 18:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Yury,

[auto build test ERROR on v4.4-rc8]
[also build test ERROR on next-20160125]
[cannot apply to s390/features v4.5-rc1]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134
config: s390-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=s390 

Note: the linux-review/Yury-Norov/all-s390-move-wrapper-infrastructure-to-generic-headers/20160126-010134 HEAD ef38065534a44f2efabd66ed0860b822cf98e49e builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   fs/notify/fanotify/fanotify_user.c: In function 'compat_SyS_fanotify_mark':
   fs/notify/fanotify/fanotify_user.c:913:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
>> include/linux/syscalls.h:43:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:5: error: expected expression before 'int'
        int, fanotify_fd, unsigned int, flags,
        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:42:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/linux/compat.h:19:0,
                    from fs/notify/fanotify/fanotify_user.c:16:
   fs/notify/fanotify/fanotify_user.c:914:23: error: expected expression before 'unsigned'
        int, fanotify_fd, unsigned int, flags,
                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP6'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
>> include/linux/compat.h:45:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
     ^
   fs/notify/fanotify/fanotify_user.c:913:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6'
    COMPAT_SYSCALL_DEFINE6(fanotify_mark,
    ^
   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/fanotify.h:4,
                    from include/linux/fanotify.h:4,
                    from fs/notify/fanotify/fanotify_user.c:1:
   fs/notify/fanotify/fanotify_user.c:915:5: error: expected expression before '__u32'
        __u32, mask0, __u32, mask1, int, dfd,
        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:41:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP4(m,t,a,...) m(t,a), __MAP3(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:42:35: note: in expansion of macro '__MAP4'
    #define __MAP5(m,t,a,...) m(t,a), __MAP4(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:43:35: note: in expansion of macro '__MAP5'
    #define __MAP6(m,t,a,...) m(t,a), __MAP5(m,__VA_ARGS__)
                                      ^
--
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_chown16':
   arch/s390/kernel/compat_linux.c:89:1: error: implicit declaration of function '__TYPE_IS_PTR' [-Werror=implicit-function-declaration]
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:89:38: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
                                         ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:10: error: expected expression before 'u16'
             u16, user, u16, group)
             ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:38:23: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP1(m,t,a) m(t,a)
                          ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:90:21: error: expected expression before 'u16'
             u16, user, u16, group)
                        ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
>> include/linux/syscalls.h:39:35: note: in expansion of macro '__MAP1'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                                      ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:89:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c: In function 'compat_SyS_s390_lchown16':
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:40:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                              ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from arch/s390/include/asm/elf.h:119:0,
                    from include/linux/elf.h:4,
                    from include/linux/module.h:15,
                    from arch/s390/kernel/compat_linux.c:31:
   arch/s390/kernel/compat_linux.c:95:39: error: expected expression before 'const'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
                                          ^
   arch/s390/include/asm/compat.h:12:20: note: in definition of macro '__SC_DELOUSE'
     (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \
                       ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
>> include/linux/compat.h:54:23: note: in expansion of macro '__MAP'
      return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
                          ^
   include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx'
     COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
     ^
   arch/s390/kernel/compat_linux.c:95:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE3'
    COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *,
    ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from arch/s390/kernel/compat_linux.c:17:
   arch/s390/kernel/compat_linux.c:96:20: error: expected expression before 'u16'
             filename, u16, user, u16, group)
                       ^
   include/linux/compiler.h:464:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^
   include/linux/compiler.h:484:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^
   include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^
   include/linux/bug.h:74:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
     ^
>> arch/s390/include/asm/compat.h:11:2: note: in expansion of macro 'BUILD_BUG_ON'
     BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \
     ^
   include/linux/syscalls.h:39:27: note: in expansion of macro '__SC_DELOUSE'
    #define __MAP2(m,t,a,...) m(t,a), __MAP1(m,__VA_ARGS__)
                              ^
>> include/linux/syscalls.h:40:35: note: in expansion of macro '__MAP2'
    #define __MAP3(m,t,a,...) m(t,a), __MAP2(m,__VA_ARGS__)
                                      ^
   include/linux/syscalls.h:44:22: note: in expansion of macro '__MAP3'
    #define __MAP(n,...) __MAP##n(__VA_ARGS__)
                         ^
..

vim +11 arch/s390/kernel/compat_wrapper.c

1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   5   */
1e4ec621 arch/s390/kernel/compat_wrapper.c Heiko Carstens 2014-03-29   6  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   7  #include <linux/syscalls.h>
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   8  #include <linux/compat.h>
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27   9  #include "entry.h"
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  10  
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @11  COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  12  COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  13  COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @14  COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  15  COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  16  COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @17  COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name);
b07edab2 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  18  COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @19  COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @20  COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  21  COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @22  COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @23  COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  24  COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  25  COMPAT_SYSCALL_WRAP1(acct, const char __user *, name);
473a0657 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  26  COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  27  COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  28  COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  29  COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  30  COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  31  COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  32  COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library);
be06fbf8 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  33  COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  34  COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  35  COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @36  COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  37  COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @38  COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len);
c355ce18 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @39  COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  40  COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @41  COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  42  COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags);
86d295e1 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  43  COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  44  COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  45  COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  46  COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @47  COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  48  COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  49  COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @50  COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  51  COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  52  COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  53  COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @54  COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  55  COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  56  COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27 @57  COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr);
0ebe3eec arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-27  58  COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @59  COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @60  COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  61  COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @62  COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @63  COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  64  COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group);
24e4c2aa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  65  COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  66  COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  67  COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  68  COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  69  COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  70  COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  71  COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  72  COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  73  COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  74  COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  75  COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  76  COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  77  COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  78  COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  79  COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name);
18421166 arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  80  COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28 @81  COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  82  COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  83  COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01 @84  COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  85  COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result);
9c4d62fa arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-02-28  86  COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name);
ab4f8bba arch/s390/kernel/compat_wrap.c    Heiko Carstens 2014-03-01  87  COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id);

:::::: The code at line 11 was first introduced by commit
:::::: b07edab23c7f93db0e7ab09bd7f5eddc421f6e8c s390/compat: convert system call wrappers to C part 01

:::::: TO: Heiko Carstens <heiko.carstens@de.ibm.com>
:::::: CC: Heiko Carstens <heiko.carstens@de.ibm.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 39393 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160126/ec98ea50/attachment-0001.obj>

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-01-25 16:57   ` Yury Norov
@ 2016-01-28 12:16     ` Heiko Carstens
  -1 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-01-28 12:16 UTC (permalink / raw)
  To: Yury Norov
  Cc: arnd, catalin.marinas, schwidefsky, linux-arm-kernel,
	linux-kernel, linux-s390, linux-arch, Prasun.Kapoor, pinskia,
	agraf, broonie, joseph, christoph.muellner, Nathan_Lynch,
	klimov.linux

Hello Yury,

On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> unsigned long and pointer types are all 32-bit length.
> 
> linux/syscalls_structs.h header is introduced, because from now (see next patch)
> structure types listed there are needed for both normal and compat mode.
> 
> cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> compat wrappers are enabled.
> 
> Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> asm-generated syscall table. But architectures that generate that tables with
> C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> 
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>

...

> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index a76c917..1a761ea 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -718,4 +718,67 @@ asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32,
>  #define is_compat_task() (0)
>  
>  #endif /* CONFIG_COMPAT */
> +
> +#ifdef CONFIG_COMPAT_WRAPPER
> +
> +#ifndef __TYPE_IS_PTR
> +#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
> +#endif
> +
> +#ifndef __SC_COMPAT_TYPE
> +#define __SC_COMPAT_TYPE(t, a) \
> +	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
> +#endif
> +
> +#ifndef __SC_COMPAT_CAST
> +#define __SC_COMPAT_CAST(t, a) ({					\
> +	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
> +		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
> +	((t) ((t)(-1) < 0 ? (s64)(s32)(a) : (u64)(u32)(a)));		\
> +})
> +#endif
> +
> +#ifndef SYSCALL_DEFINE_WRAPx
> +/*
> + * The SYSCALL_DEFINE_WRAP macro generates system call wrappers to be used by
> + * compat tasks. These wrappers will only be used for system calls where only
> + * the system call arguments need sign or zero extension or zeroing of upper
> + * bits of pointers.
> + * Note: since the wrapper function will afterwards call a system call which
> + * again performs zero and sign extension for all system call arguments with
> + * a size of less than eight bytes, these compat wrappers only touch those
> + * system call arguments with a size of eight bytes ((unsigned) long and
> + * pointers). Zero and sign extension for e.g. int parameters will be done by
> + * the regular system call wrappers.
> + */
> +#define SYSCALL_DEFINE_WRAPx(x, name, ...)						\
> +asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));				\
> +asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))			\
> +		__attribute__((alias(__stringify(compat_SyS##name))));			\
> +asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));		\
> +asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))			\
> +{											\
> +	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));			\
> +}											\
> +SYSCALL_DEFINEx(x, name, __VA_ARGS__)
> +#endif
> +
> +#define SYSCALL_DEFINE_WRAP1(name, ...) SYSCALL_DEFINE_WRAPx(1, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP2(name, ...) SYSCALL_DEFINE_WRAPx(2, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP3(name, ...) SYSCALL_DEFINE_WRAPx(3, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP4(name, ...) SYSCALL_DEFINE_WRAPx(4, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
> +
> +#else
> +
> +#define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
> +#define SYSCALL_DEFINE_WRAP2    SYSCALL_DEFINE2
> +#define SYSCALL_DEFINE_WRAP3    SYSCALL_DEFINE3
> +#define SYSCALL_DEFINE_WRAP4    SYSCALL_DEFINE4
> +#define SYSCALL_DEFINE_WRAP5    SYSCALL_DEFINE5
> +#define SYSCALL_DEFINE_WRAP6    SYSCALL_DEFINE6
> +
> +#endif /* CONFIG_COMPAT_WRAPPER */

How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
has the semantics that no dedicated compat system call exists (aka system
call is compat safe).

Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
variant exists to SYSCALL_COMPAT_DEFINE.

This would allow to specify "compat_sys_<syscallname>" in the compat system
call table for _all_ system calls.

No need to look up if a compat variant (or wrapper) exists or
sys_<syscallname> should be used instead. Also no possibility for security
bugs that could creep in because SYSCALL_DEFINE has been used instead of
SYSCALL_DEFINE_WRAP.

Ideally the implementation would only generate an alias if no sign/zero
extension is necessary.

Trivially this would be true for system calls without arguments like e.g.
sys_fork() which would get a compat_sys_fork alias without any further
code.

I'm not sure how difficult it is to implement the same logic for system
calls that have parameters. That is: either generate a
compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
macro figures out that no zero sign extension is required, only an alias
without any additional code.

I think in the long term something like this is much easier to maintain.

Does that make sense?

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-28 12:16     ` Heiko Carstens
  0 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-01-28 12:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Yury,

On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> unsigned long and pointer types are all 32-bit length.
> 
> linux/syscalls_structs.h header is introduced, because from now (see next patch)
> structure types listed there are needed for both normal and compat mode.
> 
> cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> compat wrappers are enabled.
> 
> Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> asm-generated syscall table. But architectures that generate that tables with
> C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> 
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>

...

> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index a76c917..1a761ea 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -718,4 +718,67 @@ asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32,
>  #define is_compat_task() (0)
>  
>  #endif /* CONFIG_COMPAT */
> +
> +#ifdef CONFIG_COMPAT_WRAPPER
> +
> +#ifndef __TYPE_IS_PTR
> +#define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64))
> +#endif
> +
> +#ifndef __SC_COMPAT_TYPE
> +#define __SC_COMPAT_TYPE(t, a) \
> +	__typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a
> +#endif
> +
> +#ifndef __SC_COMPAT_CAST
> +#define __SC_COMPAT_CAST(t, a) ({					\
> +	BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) &&		\
> +		     !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t));		\
> +	((t) ((t)(-1) < 0 ? (s64)(s32)(a) : (u64)(u32)(a)));		\
> +})
> +#endif
> +
> +#ifndef SYSCALL_DEFINE_WRAPx
> +/*
> + * The SYSCALL_DEFINE_WRAP macro generates system call wrappers to be used by
> + * compat tasks. These wrappers will only be used for system calls where only
> + * the system call arguments need sign or zero extension or zeroing of upper
> + * bits of pointers.
> + * Note: since the wrapper function will afterwards call a system call which
> + * again performs zero and sign extension for all system call arguments with
> + * a size of less than eight bytes, these compat wrappers only touch those
> + * system call arguments with a size of eight bytes ((unsigned) long and
> + * pointers). Zero and sign extension for e.g. int parameters will be done by
> + * the regular system call wrappers.
> + */
> +#define SYSCALL_DEFINE_WRAPx(x, name, ...)						\
> +asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));				\
> +asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))			\
> +		__attribute__((alias(__stringify(compat_SyS##name))));			\
> +asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));		\
> +asmlinkage long compat_SyS##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__))			\
> +{											\
> +	return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__));			\
> +}											\
> +SYSCALL_DEFINEx(x, name, __VA_ARGS__)
> +#endif
> +
> +#define SYSCALL_DEFINE_WRAP1(name, ...) SYSCALL_DEFINE_WRAPx(1, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP2(name, ...) SYSCALL_DEFINE_WRAPx(2, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP3(name, ...) SYSCALL_DEFINE_WRAPx(3, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP4(name, ...) SYSCALL_DEFINE_WRAPx(4, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP5(name, ...) SYSCALL_DEFINE_WRAPx(5, _##name, __VA_ARGS__)
> +#define SYSCALL_DEFINE_WRAP6(name, ...) SYSCALL_DEFINE_WRAPx(6, _##name, __VA_ARGS__)
> +
> +#else
> +
> +#define SYSCALL_DEFINE_WRAP1	SYSCALL_DEFINE1
> +#define SYSCALL_DEFINE_WRAP2    SYSCALL_DEFINE2
> +#define SYSCALL_DEFINE_WRAP3    SYSCALL_DEFINE3
> +#define SYSCALL_DEFINE_WRAP4    SYSCALL_DEFINE4
> +#define SYSCALL_DEFINE_WRAP5    SYSCALL_DEFINE5
> +#define SYSCALL_DEFINE_WRAP6    SYSCALL_DEFINE6
> +
> +#endif /* CONFIG_COMPAT_WRAPPER */

How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
has the semantics that no dedicated compat system call exists (aka system
call is compat safe).

Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
variant exists to SYSCALL_COMPAT_DEFINE.

This would allow to specify "compat_sys_<syscallname>" in the compat system
call table for _all_ system calls.

No need to look up if a compat variant (or wrapper) exists or
sys_<syscallname> should be used instead. Also no possibility for security
bugs that could creep in because SYSCALL_DEFINE has been used instead of
SYSCALL_DEFINE_WRAP.

Ideally the implementation would only generate an alias if no sign/zero
extension is necessary.

Trivially this would be true for system calls without arguments like e.g.
sys_fork() which would get a compat_sys_fork alias without any further
code.

I'm not sure how difficult it is to implement the same logic for system
calls that have parameters. That is: either generate a
compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
macro figures out that no zero sign extension is required, only an alias
without any additional code.

I think in the long term something like this is much easier to maintain.

Does that make sense?

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-01-28 12:16     ` Heiko Carstens
  (?)
@ 2016-01-28 16:31       ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-28 16:31 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: arnd, catalin.marinas, schwidefsky, linux-arm-kernel,
	linux-kernel, linux-s390, linux-arch, Prasun.Kapoor, pinskia,
	agraf, broonie, joseph, christoph.muellner, Nathan_Lynch,
	klimov.linux

On Thu, Jan 28, 2016 at 01:16:18PM +0100, Heiko Carstens wrote:
> Hello Yury,
> 
> On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> > __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> > moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> > unsigned long and pointer types are all 32-bit length.
> > 
> > linux/syscalls_structs.h header is introduced, because from now (see next patch)
> > structure types listed there are needed for both normal and compat mode.
> > 
> > cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> > compat wrappers are enabled.
> > 
> > Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> > asm-generated syscall table. But architectures that generate that tables with
> > C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> > 
> > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> 
> ...
> 

Hi Heiko,

> How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
> has the semantics that no dedicated compat system call exists (aka system
> call is compat safe).
> 
> Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
> variant exists to SYSCALL_COMPAT_DEFINE.
> 
> This would allow to specify "compat_sys_<syscallname>" in the compat system
> call table for _all_ system calls.
> 

We can modify SYSCALL_DEFINEx macro to declare weak "compat_sys_<syscallname>"
symbol for each syscall. So if strong compat symbol will be declared
somwere else, it will owerride the weak one. Being under COMPAT_WRAPPER
config, it will not affect someone else except s390 and aarch64/ilp32.
The downside of this approach is that we'll have to move wrapper
machinery to 'include/linux/syscalls.h', thought under wrapper config.

> No need to look up if a compat variant (or wrapper) exists or
> sys_<syscallname> should be used instead. Also no possibility for security
> bugs that could creep in because SYSCALL_DEFINE has been used instead of
> SYSCALL_DEFINE_WRAP.

If we'll choose to stay with current approach, we'll definitely need
to update documentation.

> 
> Ideally the implementation would only generate an alias if no sign/zero
> extension is necessary.
> 
> Trivially this would be true for system calls without arguments like e.g.
> sys_fork() which would get a compat_sys_fork alias without any further
> code.
> 
> I'm not sure how difficult it is to implement the same logic for system
> calls that have parameters. That is: either generate a
> compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
> macro figures out that no zero sign extension is required, only an alias
> without any additional code.
> 
> I think in the long term something like this is much easier to maintain.
> 
> Does that make sense?

For me, the most important adwantage of this approach is that we don't
need the list of 'magic' system calls anymore. It's even more
important if we'll face a requirement to support ABI that differs from
both natural and ilp32 ABIs. New __SC_COMPAT_CAST will do all the job
for us.

The downsides are that we'll have unneeded wrappers for some syscalls,
if linker will not clear them, and wasting of space if we'll find no
way how to explain compiler to generate simple alias when it's
enough... 

I'll play with it and write you what I'll come to.

Yury.

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-28 16:31       ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-28 16:31 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: arnd, catalin.marinas, schwidefsky, linux-arm-kernel,
	linux-kernel, linux-s390, linux-arch, Prasun.Kapoor, pinskia,
	agraf, broonie, joseph, christoph.muellner, Nathan_Lynch,
	klimov.linux

On Thu, Jan 28, 2016 at 01:16:18PM +0100, Heiko Carstens wrote:
> Hello Yury,
> 
> On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> > __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> > moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> > unsigned long and pointer types are all 32-bit length.
> > 
> > linux/syscalls_structs.h header is introduced, because from now (see next patch)
> > structure types listed there are needed for both normal and compat mode.
> > 
> > cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> > compat wrappers are enabled.
> > 
> > Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> > asm-generated syscall table. But architectures that generate that tables with
> > C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> > 
> > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> 
> ...
> 

Hi Heiko,

> How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
> has the semantics that no dedicated compat system call exists (aka system
> call is compat safe).
> 
> Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
> variant exists to SYSCALL_COMPAT_DEFINE.
> 
> This would allow to specify "compat_sys_<syscallname>" in the compat system
> call table for _all_ system calls.
> 

We can modify SYSCALL_DEFINEx macro to declare weak "compat_sys_<syscallname>"
symbol for each syscall. So if strong compat symbol will be declared
somwere else, it will owerride the weak one. Being under COMPAT_WRAPPER
config, it will not affect someone else except s390 and aarch64/ilp32.
The downside of this approach is that we'll have to move wrapper
machinery to 'include/linux/syscalls.h', thought under wrapper config.

> No need to look up if a compat variant (or wrapper) exists or
> sys_<syscallname> should be used instead. Also no possibility for security
> bugs that could creep in because SYSCALL_DEFINE has been used instead of
> SYSCALL_DEFINE_WRAP.

If we'll choose to stay with current approach, we'll definitely need
to update documentation.

> 
> Ideally the implementation would only generate an alias if no sign/zero
> extension is necessary.
> 
> Trivially this would be true for system calls without arguments like e.g.
> sys_fork() which would get a compat_sys_fork alias without any further
> code.
> 
> I'm not sure how difficult it is to implement the same logic for system
> calls that have parameters. That is: either generate a
> compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
> macro figures out that no zero sign extension is required, only an alias
> without any additional code.
> 
> I think in the long term something like this is much easier to maintain.
> 
> Does that make sense?

For me, the most important adwantage of this approach is that we don't
need the list of 'magic' system calls anymore. It's even more
important if we'll face a requirement to support ABI that differs from
both natural and ilp32 ABIs. New __SC_COMPAT_CAST will do all the job
for us.

The downsides are that we'll have unneeded wrappers for some syscalls,
if linker will not clear them, and wasting of space if we'll find no
way how to explain compiler to generate simple alias when it's
enough... 

I'll play with it and write you what I'll come to.

Yury.

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-01-28 16:31       ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-01-28 16:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 28, 2016 at 01:16:18PM +0100, Heiko Carstens wrote:
> Hello Yury,
> 
> On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> > __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> > moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> > unsigned long and pointer types are all 32-bit length.
> > 
> > linux/syscalls_structs.h header is introduced, because from now (see next patch)
> > structure types listed there are needed for both normal and compat mode.
> > 
> > cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> > compat wrappers are enabled.
> > 
> > Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> > asm-generated syscall table. But architectures that generate that tables with
> > C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> > 
> > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> 
> ...
> 

Hi Heiko,

> How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
> has the semantics that no dedicated compat system call exists (aka system
> call is compat safe).
> 
> Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
> variant exists to SYSCALL_COMPAT_DEFINE.
> 
> This would allow to specify "compat_sys_<syscallname>" in the compat system
> call table for _all_ system calls.
> 

We can modify SYSCALL_DEFINEx macro to declare weak "compat_sys_<syscallname>"
symbol for each syscall. So if strong compat symbol will be declared
somwere else, it will owerride the weak one. Being under COMPAT_WRAPPER
config, it will not affect someone else except s390 and aarch64/ilp32.
The downside of this approach is that we'll have to move wrapper
machinery to 'include/linux/syscalls.h', thought under wrapper config.

> No need to look up if a compat variant (or wrapper) exists or
> sys_<syscallname> should be used instead. Also no possibility for security
> bugs that could creep in because SYSCALL_DEFINE has been used instead of
> SYSCALL_DEFINE_WRAP.

If we'll choose to stay with current approach, we'll definitely need
to update documentation.

> 
> Ideally the implementation would only generate an alias if no sign/zero
> extension is necessary.
> 
> Trivially this would be true for system calls without arguments like e.g.
> sys_fork() which would get a compat_sys_fork alias without any further
> code.
> 
> I'm not sure how difficult it is to implement the same logic for system
> calls that have parameters. That is: either generate a
> compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
> macro figures out that no zero sign extension is required, only an alias
> without any additional code.
> 
> I think in the long term something like this is much easier to maintain.
> 
> Does that make sense?

For me, the most important adwantage of this approach is that we don't
need the list of 'magic' system calls anymore. It's even more
important if we'll face a requirement to support ABI that differs from
both natural and ilp32 ABIs. New __SC_COMPAT_CAST will do all the job
for us.

The downsides are that we'll have unneeded wrappers for some syscalls,
if linker will not clear them, and wasting of space if we'll find no
way how to explain compiler to generate simple alias when it's
enough... 

I'll play with it and write you what I'll come to.

Yury.

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-01-28 16:31       ` Yury Norov
  (?)
@ 2016-02-01 11:42         ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-01 11:42 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Thu, Jan 28, 2016 at 07:31:09PM +0300, Yury Norov wrote:
> On Thu, Jan 28, 2016 at 01:16:18PM +0100, Heiko Carstens wrote:
> > Hello Yury,
> > 
> > On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> > > __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> > > moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> > > unsigned long and pointer types are all 32-bit length.
> > > 
> > > linux/syscalls_structs.h header is introduced, because from now (see next patch)
> > > structure types listed there are needed for both normal and compat mode.
> > > 
> > > cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> > > compat wrappers are enabled.
> > > 
> > > Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> > > asm-generated syscall table. But architectures that generate that tables with
> > > C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> > > 
> > > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> > 
> > ...
> > 
> 
> Hi Heiko,
> 
> > How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
> > has the semantics that no dedicated compat system call exists (aka system
> > call is compat safe).
> > 
> > Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
> > variant exists to SYSCALL_COMPAT_DEFINE.
> > 
> > This would allow to specify "compat_sys_<syscallname>" in the compat system
> > call table for _all_ system calls.
> > 
> 
> We can modify SYSCALL_DEFINEx macro to declare weak "compat_sys_<syscallname>"
> symbol for each syscall. So if strong compat symbol will be declared
> somwere else, it will owerride the weak one. Being under COMPAT_WRAPPER
> config, it will not affect someone else except s390 and aarch64/ilp32.
> The downside of this approach is that we'll have to move wrapper
> machinery to 'include/linux/syscalls.h', thought under wrapper config.
> 
> > No need to look up if a compat variant (or wrapper) exists or
> > sys_<syscallname> should be used instead. Also no possibility for security
> > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > SYSCALL_DEFINE_WRAP.
> 
> If we'll choose to stay with current approach, we'll definitely need
> to update documentation.
> 
> > 
> > Ideally the implementation would only generate an alias if no sign/zero
> > extension is necessary.
> > 
> > Trivially this would be true for system calls without arguments like e.g.
> > sys_fork() which would get a compat_sys_fork alias without any further
> > code.
> > 
> > I'm not sure how difficult it is to implement the same logic for system
> > calls that have parameters. That is: either generate a
> > compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
> > macro figures out that no zero sign extension is required, only an alias
> > without any additional code.
> > 
> > I think in the long term something like this is much easier to maintain.
> > 
> > Does that make sense?
> 
> For me, the most important adwantage of this approach is that we don't
> need the list of 'magic' system calls anymore. It's even more
> important if we'll face a requirement to support ABI that differs from
> both natural and ilp32 ABIs. New __SC_COMPAT_CAST will do all the job
> for us.
> 
> The downsides are that we'll have unneeded wrappers for some syscalls,
> if linker will not clear them, and wasting of space if we'll find no
> way how to explain compiler to generate simple alias when it's
> enough... 
> 
> I'll play with it and write you what I'll come to.
> 
> Yury.

Hi Heiko,

I tried this idea, and I don't like what happened.
 - Wrappers around safe syscalls does exist. We can remove it by
   overcomplicating __SC_COMPAT_CAST, but I don't like it.
 - We still need to declare numerous list of new compat syscalls.
   And it becomes even bigger, as we need to declare all compat
   syscall versions not declared in include/linux/compat.h already.
   (Currently - only for unsafe syscalls.)
 - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
   some new prefix for wrapped syscalls. Or declare all non-compat
   syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
   replacements grow. And for me, it's harder to explain why we are
   wrapping safe syscalls. Or we introduce another bunch of useless
   wrappers (with new prefix), and have to handle it in non-compat code.
 - With all listed above, we move all wrapper logic to non-compat
   'include/linux/syscalls.h' header. Which is not a good idea, if it
   doesn't benefit us much in return.

> > No need to look up if a compat variant (or wrapper) exists or
> > sys_<syscallname> should be used instead. Also no possibility for security
> > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > SYSCALL_DEFINE_WRAP.

I thought again about it. With current version, it's very easy to
define whether we have wrapper or not - just by macro we use. Once
reviewed, this list is hardly to be changed frequently. If someone is
introducing new syscall, it will attract much attention, so security
risk is minimal.

Maybe I missed some elegant implementation, and if so  I'll be happy
if someone'll point me out. But with what I see, I'd vote for what we
have now. (Plus description in docs, plus renaming new macro.)

Yury.

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-01 11:42         ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-01 11:42 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Thu, Jan 28, 2016 at 07:31:09PM +0300, Yury Norov wrote:
> On Thu, Jan 28, 2016 at 01:16:18PM +0100, Heiko Carstens wrote:
> > Hello Yury,
> > 
> > On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> > > __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> > > moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> > > unsigned long and pointer types are all 32-bit length.
> > > 
> > > linux/syscalls_structs.h header is introduced, because from now (see next patch)
> > > structure types listed there are needed for both normal and compat mode.
> > > 
> > > cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> > > compat wrappers are enabled.
> > > 
> > > Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> > > asm-generated syscall table. But architectures that generate that tables with
> > > C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> > > 
> > > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> > 
> > ...
> > 
> 
> Hi Heiko,
> 
> > How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
> > has the semantics that no dedicated compat system call exists (aka system
> > call is compat safe).
> > 
> > Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
> > variant exists to SYSCALL_COMPAT_DEFINE.
> > 
> > This would allow to specify "compat_sys_<syscallname>" in the compat system
> > call table for _all_ system calls.
> > 
> 
> We can modify SYSCALL_DEFINEx macro to declare weak "compat_sys_<syscallname>"
> symbol for each syscall. So if strong compat symbol will be declared
> somwere else, it will owerride the weak one. Being under COMPAT_WRAPPER
> config, it will not affect someone else except s390 and aarch64/ilp32.
> The downside of this approach is that we'll have to move wrapper
> machinery to 'include/linux/syscalls.h', thought under wrapper config.
> 
> > No need to look up if a compat variant (or wrapper) exists or
> > sys_<syscallname> should be used instead. Also no possibility for security
> > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > SYSCALL_DEFINE_WRAP.
> 
> If we'll choose to stay with current approach, we'll definitely need
> to update documentation.
> 
> > 
> > Ideally the implementation would only generate an alias if no sign/zero
> > extension is necessary.
> > 
> > Trivially this would be true for system calls without arguments like e.g.
> > sys_fork() which would get a compat_sys_fork alias without any further
> > code.
> > 
> > I'm not sure how difficult it is to implement the same logic for system
> > calls that have parameters. That is: either generate a
> > compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
> > macro figures out that no zero sign extension is required, only an alias
> > without any additional code.
> > 
> > I think in the long term something like this is much easier to maintain.
> > 
> > Does that make sense?
> 
> For me, the most important adwantage of this approach is that we don't
> need the list of 'magic' system calls anymore. It's even more
> important if we'll face a requirement to support ABI that differs from
> both natural and ilp32 ABIs. New __SC_COMPAT_CAST will do all the job
> for us.
> 
> The downsides are that we'll have unneeded wrappers for some syscalls,
> if linker will not clear them, and wasting of space if we'll find no
> way how to explain compiler to generate simple alias when it's
> enough... 
> 
> I'll play with it and write you what I'll come to.
> 
> Yury.

Hi Heiko,

I tried this idea, and I don't like what happened.
 - Wrappers around safe syscalls does exist. We can remove it by
   overcomplicating __SC_COMPAT_CAST, but I don't like it.
 - We still need to declare numerous list of new compat syscalls.
   And it becomes even bigger, as we need to declare all compat
   syscall versions not declared in include/linux/compat.h already.
   (Currently - only for unsafe syscalls.)
 - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
   some new prefix for wrapped syscalls. Or declare all non-compat
   syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
   replacements grow. And for me, it's harder to explain why we are
   wrapping safe syscalls. Or we introduce another bunch of useless
   wrappers (with new prefix), and have to handle it in non-compat code.
 - With all listed above, we move all wrapper logic to non-compat
   'include/linux/syscalls.h' header. Which is not a good idea, if it
   doesn't benefit us much in return.

> > No need to look up if a compat variant (or wrapper) exists or
> > sys_<syscallname> should be used instead. Also no possibility for security
> > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > SYSCALL_DEFINE_WRAP.

I thought again about it. With current version, it's very easy to
define whether we have wrapper or not - just by macro we use. Once
reviewed, this list is hardly to be changed frequently. If someone is
introducing new syscall, it will attract much attention, so security
risk is minimal.

Maybe I missed some elegant implementation, and if so  I'll be happy
if someone'll point me out. But with what I see, I'd vote for what we
have now. (Plus description in docs, plus renaming new macro.)

Yury.

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-01 11:42         ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-01 11:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 28, 2016 at 07:31:09PM +0300, Yury Norov wrote:
> On Thu, Jan 28, 2016 at 01:16:18PM +0100, Heiko Carstens wrote:
> > Hello Yury,
> > 
> > On Mon, Jan 25, 2016 at 07:57:23PM +0300, Yury Norov wrote:
> > > __SC_COMPAT_CAST for s390 is too specific due to 31-bit pointer length, so it's
> > > moved to arch/s390/include/asm/compat.h. Generic declaration assumes that long,
> > > unsigned long and pointer types are all 32-bit length.
> > > 
> > > linux/syscalls_structs.h header is introduced, because from now (see next patch)
> > > structure types listed there are needed for both normal and compat mode.
> > > 
> > > cond_syscall_wrapped now defined two symbols: sys_foo() and compat_sys_foo(), if
> > > compat wrappers are enabled.
> > > 
> > > Here __SC_WRAP() macro is introduced as well. s390 doesn't need it as it uses
> > > asm-generated syscall table. But architectures that generate that tables with
> > > C code (ARM64/ILP32) should redefine it as '#define __SC_WRAP(name) compat_##name'.
> > > 
> > > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> > 
> > ...
> > 
> 
> Hi Heiko,
> 
> > How about if you rename SYSCALL_DEFINE_WRAP to SYSCALL_COMPAT_DEFINE which
> > has the semantics that no dedicated compat system call exists (aka system
> > call is compat safe).
> > 
> > Then convert all existing SYSCALL_DEFINE'd system calls for which no compat
> > variant exists to SYSCALL_COMPAT_DEFINE.
> > 
> > This would allow to specify "compat_sys_<syscallname>" in the compat system
> > call table for _all_ system calls.
> > 
> 
> We can modify SYSCALL_DEFINEx macro to declare weak "compat_sys_<syscallname>"
> symbol for each syscall. So if strong compat symbol will be declared
> somwere else, it will owerride the weak one. Being under COMPAT_WRAPPER
> config, it will not affect someone else except s390 and aarch64/ilp32.
> The downside of this approach is that we'll have to move wrapper
> machinery to 'include/linux/syscalls.h', thought under wrapper config.
> 
> > No need to look up if a compat variant (or wrapper) exists or
> > sys_<syscallname> should be used instead. Also no possibility for security
> > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > SYSCALL_DEFINE_WRAP.
> 
> If we'll choose to stay with current approach, we'll definitely need
> to update documentation.
> 
> > 
> > Ideally the implementation would only generate an alias if no sign/zero
> > extension is necessary.
> > 
> > Trivially this would be true for system calls without arguments like e.g.
> > sys_fork() which would get a compat_sys_fork alias without any further
> > code.
> > 
> > I'm not sure how difficult it is to implement the same logic for system
> > calls that have parameters. That is: either generate a
> > compat_sys_<syscallname> wrapper function, or if the SYSCALL_COMPAT_DEFINE
> > macro figures out that no zero sign extension is required, only an alias
> > without any additional code.
> > 
> > I think in the long term something like this is much easier to maintain.
> > 
> > Does that make sense?
> 
> For me, the most important adwantage of this approach is that we don't
> need the list of 'magic' system calls anymore. It's even more
> important if we'll face a requirement to support ABI that differs from
> both natural and ilp32 ABIs. New __SC_COMPAT_CAST will do all the job
> for us.
> 
> The downsides are that we'll have unneeded wrappers for some syscalls,
> if linker will not clear them, and wasting of space if we'll find no
> way how to explain compiler to generate simple alias when it's
> enough... 
> 
> I'll play with it and write you what I'll come to.
> 
> Yury.

Hi Heiko,

I tried this idea, and I don't like what happened.
 - Wrappers around safe syscalls does exist. We can remove it by
   overcomplicating __SC_COMPAT_CAST, but I don't like it.
 - We still need to declare numerous list of new compat syscalls.
   And it becomes even bigger, as we need to declare all compat
   syscall versions not declared in include/linux/compat.h already.
   (Currently - only for unsafe syscalls.)
 - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
   some new prefix for wrapped syscalls. Or declare all non-compat
   syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
   replacements grow. And for me, it's harder to explain why we are
   wrapping safe syscalls. Or we introduce another bunch of useless
   wrappers (with new prefix), and have to handle it in non-compat code.
 - With all listed above, we move all wrapper logic to non-compat
   'include/linux/syscalls.h' header. Which is not a good idea, if it
   doesn't benefit us much in return.

> > No need to look up if a compat variant (or wrapper) exists or
> > sys_<syscallname> should be used instead. Also no possibility for security
> > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > SYSCALL_DEFINE_WRAP.

I thought again about it. With current version, it's very easy to
define whether we have wrapper or not - just by macro we use. Once
reviewed, this list is hardly to be changed frequently. If someone is
introducing new syscall, it will attract much attention, so security
risk is minimal.

Maybe I missed some elegant implementation, and if so  I'll be happy
if someone'll point me out. But with what I see, I'd vote for what we
have now. (Plus description in docs, plus renaming new macro.)

Yury.

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-01 11:42         ` Yury Norov
@ 2016-02-02  7:39           ` Heiko Carstens
  -1 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-02  7:39 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Mon, Feb 01, 2016 at 02:42:51PM +0300, Yury Norov wrote:
> Hi Heiko,
> 
> I tried this idea, and I don't like what happened.
>  - Wrappers around safe syscalls does exist. We can remove it by
>    overcomplicating __SC_COMPAT_CAST, but I don't like it.
>  - We still need to declare numerous list of new compat syscalls.
>    And it becomes even bigger, as we need to declare all compat
>    syscall versions not declared in include/linux/compat.h already.
>    (Currently - only for unsafe syscalls.)
>  - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
>    some new prefix for wrapped syscalls. Or declare all non-compat
>    syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
>    replacements grow. And for me, it's harder to explain why we are
>    wrapping safe syscalls. Or we introduce another bunch of useless
>    wrappers (with new prefix), and have to handle it in non-compat code.
>  - With all listed above, we move all wrapper logic to non-compat
>    'include/linux/syscalls.h' header. Which is not a good idea, if it
>    doesn't benefit us much in return.
> 
> > > No need to look up if a compat variant (or wrapper) exists or
> > > sys_<syscallname> should be used instead. Also no possibility for security
> > > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > > SYSCALL_DEFINE_WRAP.
> 
> I thought again about it. With current version, it's very easy to
> define whether we have wrapper or not - just by macro we use. Once
> reviewed, this list is hardly to be changed frequently. If someone is
> introducing new syscall, it will attract much attention, so security
> risk is minimal.
> 
> Maybe I missed some elegant implementation, and if so  I'll be happy
> if someone'll point me out. But with what I see, I'd vote for what we
> have now. (Plus description in docs, plus renaming new macro.)

Well, I'd like to have some proof by the compiler or linker that nothing
went wrong. Which seems hard if only selected system call defines will be
converted to the new defines.

How can you tell that nothing has been forgotten?

Also, what happens if the prototype of a system call get's changed shortly
after it was merged. We might miss such changes and have bugs.

Therefore, and to get to a solution, I think we should stick with your
first idea, which only moves the compat_wrapper.c file.

Before doing that I think you should actually revert this patch: my commit
7681df456f97 ("s390/compat: remove superfluous compat wrappers") probably
wasn't a very bright idea :)

This again allows me to use only compat system calls in s390's system call
table (execpt for system calls without parameters, but that can be easily
fixed).

What I still don't like is that you need to add all the protoypes. Why are
the system call tables actually written in C and not in asm?

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-02  7:39           ` Heiko Carstens
  0 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-02  7:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 01, 2016 at 02:42:51PM +0300, Yury Norov wrote:
> Hi Heiko,
> 
> I tried this idea, and I don't like what happened.
>  - Wrappers around safe syscalls does exist. We can remove it by
>    overcomplicating __SC_COMPAT_CAST, but I don't like it.
>  - We still need to declare numerous list of new compat syscalls.
>    And it becomes even bigger, as we need to declare all compat
>    syscall versions not declared in include/linux/compat.h already.
>    (Currently - only for unsafe syscalls.)
>  - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
>    some new prefix for wrapped syscalls. Or declare all non-compat
>    syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
>    replacements grow. And for me, it's harder to explain why we are
>    wrapping safe syscalls. Or we introduce another bunch of useless
>    wrappers (with new prefix), and have to handle it in non-compat code.
>  - With all listed above, we move all wrapper logic to non-compat
>    'include/linux/syscalls.h' header. Which is not a good idea, if it
>    doesn't benefit us much in return.
> 
> > > No need to look up if a compat variant (or wrapper) exists or
> > > sys_<syscallname> should be used instead. Also no possibility for security
> > > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > > SYSCALL_DEFINE_WRAP.
> 
> I thought again about it. With current version, it's very easy to
> define whether we have wrapper or not - just by macro we use. Once
> reviewed, this list is hardly to be changed frequently. If someone is
> introducing new syscall, it will attract much attention, so security
> risk is minimal.
> 
> Maybe I missed some elegant implementation, and if so  I'll be happy
> if someone'll point me out. But with what I see, I'd vote for what we
> have now. (Plus description in docs, plus renaming new macro.)

Well, I'd like to have some proof by the compiler or linker that nothing
went wrong. Which seems hard if only selected system call defines will be
converted to the new defines.

How can you tell that nothing has been forgotten?

Also, what happens if the prototype of a system call get's changed shortly
after it was merged. We might miss such changes and have bugs.

Therefore, and to get to a solution, I think we should stick with your
first idea, which only moves the compat_wrapper.c file.

Before doing that I think you should actually revert this patch: my commit
7681df456f97 ("s390/compat: remove superfluous compat wrappers") probably
wasn't a very bright idea :)

This again allows me to use only compat system calls in s390's system call
table (execpt for system calls without parameters, but that can be easily
fixed).

What I still don't like is that you need to add all the protoypes. Why are
the system call tables actually written in C and not in asm?

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-02  7:39           ` Heiko Carstens
  (?)
@ 2016-02-02 15:43             ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-02 15:43 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Tue, Feb 02, 2016 at 08:39:13AM +0100, Heiko Carstens wrote:
> On Mon, Feb 01, 2016 at 02:42:51PM +0300, Yury Norov wrote:
> > Hi Heiko,
> > 
> > I tried this idea, and I don't like what happened.
> >  - Wrappers around safe syscalls does exist. We can remove it by
> >    overcomplicating __SC_COMPAT_CAST, but I don't like it.
> >  - We still need to declare numerous list of new compat syscalls.
> >    And it becomes even bigger, as we need to declare all compat
> >    syscall versions not declared in include/linux/compat.h already.
> >    (Currently - only for unsafe syscalls.)
> >  - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
> >    some new prefix for wrapped syscalls. Or declare all non-compat
> >    syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
> >    replacements grow. And for me, it's harder to explain why we are
> >    wrapping safe syscalls. Or we introduce another bunch of useless
> >    wrappers (with new prefix), and have to handle it in non-compat code.
> >  - With all listed above, we move all wrapper logic to non-compat
> >    'include/linux/syscalls.h' header. Which is not a good idea, if it
> >    doesn't benefit us much in return.
> > 
> > > > No need to look up if a compat variant (or wrapper) exists or
> > > > sys_<syscallname> should be used instead. Also no possibility for security
> > > > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > > > SYSCALL_DEFINE_WRAP.
> > 
> > I thought again about it. With current version, it's very easy to
> > define whether we have wrapper or not - just by macro we use. Once
> > reviewed, this list is hardly to be changed frequently. If someone is
> > introducing new syscall, it will attract much attention, so security
> > risk is minimal.
> > 
> > Maybe I missed some elegant implementation, and if so  I'll be happy
> > if someone'll point me out. But with what I see, I'd vote for what we
> > have now. (Plus description in docs, plus renaming new macro.)
> 
> Well, I'd like to have some proof by the compiler or linker that nothing
> went wrong. Which seems hard if only selected system call defines will be
> converted to the new defines.
> 
> How can you tell that nothing has been forgotten?
> 
> Also, what happens if the prototype of a system call get's changed shortly
> after it was merged. We might miss such changes and have bugs.
> 

As for now, there's no such proof, and everything is OK. Syscall ABI
is extremely conservative, and Greg KH, and other people spent a lot
of efforts to keep it that way. This is the only reason for me to not
worry much about it. Modification of syscall ABI is virtually
impossible now, because it breaks binary compatibility. Even addition
of new syscall is very difficult procedure.
(Documentation/adding-syscalls.txt begins with section "System Call
Alternatives".)

We can invent some protection, but it will cost us in complexity and/or
runtime delays. Because syscall ABI is so stable, I think it's OK to
review wrappers carefully once, and they will be fine for long time.

> Therefore, and to get to a solution, I think we should stick with your
> first idea, which only moves the compat_wrapper.c file.
> 
> Before doing that I think you should actually revert this patch: my commit
> 7681df456f97 ("s390/compat: remove superfluous compat wrappers") probably
> wasn't a very bright idea :)
> 

This patch is OK for me. pid_t, uid_t, gid_t, unsigned and signed int
types are all 32-bit both on LP64 and ILP32. Normally, compiler should
care about top halves... Did I miss something?

> This again allows me to use only compat system calls in s390's system call
> table (execpt for system calls without parameters, but that can be easily
> fixed).
> 
> What I still don't like is that you need to add all the protoypes. Why are
> the system call tables actually written in C and not in asm?

Because generic unistd code is multi-platform by intention.

I don't know much about s390 specifics. Maybe because of that I do not
understand completely your worries. I'm OK with both 1st and 2nd
version, but I'd choose 2nd one because it allows inlines, and we
don't need the compat_wrapper.c. 

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-02 15:43             ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-02 15:43 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Tue, Feb 02, 2016 at 08:39:13AM +0100, Heiko Carstens wrote:
> On Mon, Feb 01, 2016 at 02:42:51PM +0300, Yury Norov wrote:
> > Hi Heiko,
> > 
> > I tried this idea, and I don't like what happened.
> >  - Wrappers around safe syscalls does exist. We can remove it by
> >    overcomplicating __SC_COMPAT_CAST, but I don't like it.
> >  - We still need to declare numerous list of new compat syscalls.
> >    And it becomes even bigger, as we need to declare all compat
> >    syscall versions not declared in include/linux/compat.h already.
> >    (Currently - only for unsafe syscalls.)
> >  - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
> >    some new prefix for wrapped syscalls. Or declare all non-compat
> >    syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
> >    replacements grow. And for me, it's harder to explain why we are
> >    wrapping safe syscalls. Or we introduce another bunch of useless
> >    wrappers (with new prefix), and have to handle it in non-compat code.
> >  - With all listed above, we move all wrapper logic to non-compat
> >    'include/linux/syscalls.h' header. Which is not a good idea, if it
> >    doesn't benefit us much in return.
> > 
> > > > No need to look up if a compat variant (or wrapper) exists or
> > > > sys_<syscallname> should be used instead. Also no possibility for security
> > > > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > > > SYSCALL_DEFINE_WRAP.
> > 
> > I thought again about it. With current version, it's very easy to
> > define whether we have wrapper or not - just by macro we use. Once
> > reviewed, this list is hardly to be changed frequently. If someone is
> > introducing new syscall, it will attract much attention, so security
> > risk is minimal.
> > 
> > Maybe I missed some elegant implementation, and if so  I'll be happy
> > if someone'll point me out. But with what I see, I'd vote for what we
> > have now. (Plus description in docs, plus renaming new macro.)
> 
> Well, I'd like to have some proof by the compiler or linker that nothing
> went wrong. Which seems hard if only selected system call defines will be
> converted to the new defines.
> 
> How can you tell that nothing has been forgotten?
> 
> Also, what happens if the prototype of a system call get's changed shortly
> after it was merged. We might miss such changes and have bugs.
> 

As for now, there's no such proof, and everything is OK. Syscall ABI
is extremely conservative, and Greg KH, and other people spent a lot
of efforts to keep it that way. This is the only reason for me to not
worry much about it. Modification of syscall ABI is virtually
impossible now, because it breaks binary compatibility. Even addition
of new syscall is very difficult procedure.
(Documentation/adding-syscalls.txt begins with section "System Call
Alternatives".)

We can invent some protection, but it will cost us in complexity and/or
runtime delays. Because syscall ABI is so stable, I think it's OK to
review wrappers carefully once, and they will be fine for long time.

> Therefore, and to get to a solution, I think we should stick with your
> first idea, which only moves the compat_wrapper.c file.
> 
> Before doing that I think you should actually revert this patch: my commit
> 7681df456f97 ("s390/compat: remove superfluous compat wrappers") probably
> wasn't a very bright idea :)
> 

This patch is OK for me. pid_t, uid_t, gid_t, unsigned and signed int
types are all 32-bit both on LP64 and ILP32. Normally, compiler should
care about top halves... Did I miss something?

> This again allows me to use only compat system calls in s390's system call
> table (execpt for system calls without parameters, but that can be easily
> fixed).
> 
> What I still don't like is that you need to add all the protoypes. Why are
> the system call tables actually written in C and not in asm?

Because generic unistd code is multi-platform by intention.

I don't know much about s390 specifics. Maybe because of that I do not
understand completely your worries. I'm OK with both 1st and 2nd
version, but I'd choose 2nd one because it allows inlines, and we
don't need the compat_wrapper.c. 

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-02 15:43             ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-02 15:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 02, 2016 at 08:39:13AM +0100, Heiko Carstens wrote:
> On Mon, Feb 01, 2016 at 02:42:51PM +0300, Yury Norov wrote:
> > Hi Heiko,
> > 
> > I tried this idea, and I don't like what happened.
> >  - Wrappers around safe syscalls does exist. We can remove it by
> >    overcomplicating __SC_COMPAT_CAST, but I don't like it.
> >  - We still need to declare numerous list of new compat syscalls.
> >    And it becomes even bigger, as we need to declare all compat
> >    syscall versions not declared in include/linux/compat.h already.
> >    (Currently - only for unsafe syscalls.)
> >  - 'Weak' trick doesn't work for the whole kernel, so we'd figure out
> >    some new prefix for wrapped syscalls. Or declare all non-compat
> >    syscalls explicitly with SYSCALL_COMPAT_DEFINE. So the list of
> >    replacements grow. And for me, it's harder to explain why we are
> >    wrapping safe syscalls. Or we introduce another bunch of useless
> >    wrappers (with new prefix), and have to handle it in non-compat code.
> >  - With all listed above, we move all wrapper logic to non-compat
> >    'include/linux/syscalls.h' header. Which is not a good idea, if it
> >    doesn't benefit us much in return.
> > 
> > > > No need to look up if a compat variant (or wrapper) exists or
> > > > sys_<syscallname> should be used instead. Also no possibility for security
> > > > bugs that could creep in because SYSCALL_DEFINE has been used instead of
> > > > SYSCALL_DEFINE_WRAP.
> > 
> > I thought again about it. With current version, it's very easy to
> > define whether we have wrapper or not - just by macro we use. Once
> > reviewed, this list is hardly to be changed frequently. If someone is
> > introducing new syscall, it will attract much attention, so security
> > risk is minimal.
> > 
> > Maybe I missed some elegant implementation, and if so  I'll be happy
> > if someone'll point me out. But with what I see, I'd vote for what we
> > have now. (Plus description in docs, plus renaming new macro.)
> 
> Well, I'd like to have some proof by the compiler or linker that nothing
> went wrong. Which seems hard if only selected system call defines will be
> converted to the new defines.
> 
> How can you tell that nothing has been forgotten?
> 
> Also, what happens if the prototype of a system call get's changed shortly
> after it was merged. We might miss such changes and have bugs.
> 

As for now, there's no such proof, and everything is OK. Syscall ABI
is extremely conservative, and Greg KH, and other people spent a lot
of efforts to keep it that way. This is the only reason for me to not
worry much about it. Modification of syscall ABI is virtually
impossible now, because it breaks binary compatibility. Even addition
of new syscall is very difficult procedure.
(Documentation/adding-syscalls.txt begins with section "System Call
Alternatives".)

We can invent some protection, but it will cost us in complexity and/or
runtime delays. Because syscall ABI is so stable, I think it's OK to
review wrappers carefully once, and they will be fine for long time.

> Therefore, and to get to a solution, I think we should stick with your
> first idea, which only moves the compat_wrapper.c file.
> 
> Before doing that I think you should actually revert this patch: my commit
> 7681df456f97 ("s390/compat: remove superfluous compat wrappers") probably
> wasn't a very bright idea :)
> 

This patch is OK for me. pid_t, uid_t, gid_t, unsigned and signed int
types are all 32-bit both on LP64 and ILP32. Normally, compiler should
care about top halves... Did I miss something?

> This again allows me to use only compat system calls in s390's system call
> table (execpt for system calls without parameters, but that can be easily
> fixed).
> 
> What I still don't like is that you need to add all the protoypes. Why are
> the system call tables actually written in C and not in asm?

Because generic unistd code is multi-platform by intention.

I don't know much about s390 specifics. Maybe because of that I do not
understand completely your worries. I'm OK with both 1st and 2nd
version, but I'd choose 2nd one because it allows inlines, and we
don't need the compat_wrapper.c. 

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-02 15:43             ` Yury Norov
@ 2016-02-02 16:08               ` Heiko Carstens
  -1 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-02 16:08 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Tue, Feb 02, 2016 at 06:43:31PM +0300, Yury Norov wrote:
> > Well, I'd like to have some proof by the compiler or linker that nothing
> > went wrong. Which seems hard if only selected system call defines will be
> > converted to the new defines.
> > 
> > How can you tell that nothing has been forgotten?
> > 
> > Also, what happens if the prototype of a system call get's changed shortly
> > after it was merged. We might miss such changes and have bugs.
> > 
> 
> As for now, there's no such proof, and everything is OK. Syscall ABI
> is extremely conservative, and Greg KH, and other people spent a lot
> of efforts to keep it that way. This is the only reason for me to not
> worry much about it. Modification of syscall ABI is virtually
> impossible now, because it breaks binary compatibility. Even addition
> of new syscall is very difficult procedure.
> (Documentation/adding-syscalls.txt begins with section "System Call
> Alternatives".)

Well... during the years a lot of system calls have been added. And we've
also seen last-minute changes or reverts. So I don't share your optimistic
view here :)

See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
"unsigned int" instead of u_long") would have been a candidate which could
silently break architectures which need compat wrappers.

> We can invent some protection, but it will cost us in complexity and/or
> runtime delays. Because syscall ABI is so stable, I think it's OK to
> review wrappers carefully once, and they will be fine for long time.

Here I don't agree with you. These interfaces are so important that I'd
like to have a waterproof method that these don't break.  If this involves
a couple of superfluous instructions then that's what I'm willing to pay
for it.

> > Before doing that I think you should actually revert this patch: my commit
> > 7681df456f97 ("s390/compat: remove superfluous compat wrappers") probably
> > wasn't a very bright idea :)
> This patch is OK for me. pid_t, uid_t, gid_t, unsigned and signed int
> types are all 32-bit both on LP64 and ILP32. Normally, compiler should
> care about top halves... Did I miss something?

The patch was correct when writing it, but e.g. a patch like named above
would introduce a possible bug which would go in unnoticed.
The only thing we save is a _single_ unconditional branch here. I'd say
that's well worth it if you get a (hopefully) always bug free sign and zero
extension infrastructure in return.

> I don't know much about s390 specifics. Maybe because of that I do not
> understand completely your worries. I'm OK with both 1st and 2nd
> version, but I'd choose 2nd one because it allows inlines, and we
> don't need the compat_wrapper.c.

It would be only nicer if we can guarentee correctness all the time. That
being said I'm about to revert my own commit :)

So if you want to go without compat_wrapper.c then we should have a
solution which will do the right thing all the time without that a system
call author has to know about the sign and zero extension issue some
architectures face. It _will_ go wrong.

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-02 16:08               ` Heiko Carstens
  0 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-02 16:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 02, 2016 at 06:43:31PM +0300, Yury Norov wrote:
> > Well, I'd like to have some proof by the compiler or linker that nothing
> > went wrong. Which seems hard if only selected system call defines will be
> > converted to the new defines.
> > 
> > How can you tell that nothing has been forgotten?
> > 
> > Also, what happens if the prototype of a system call get's changed shortly
> > after it was merged. We might miss such changes and have bugs.
> > 
> 
> As for now, there's no such proof, and everything is OK. Syscall ABI
> is extremely conservative, and Greg KH, and other people spent a lot
> of efforts to keep it that way. This is the only reason for me to not
> worry much about it. Modification of syscall ABI is virtually
> impossible now, because it breaks binary compatibility. Even addition
> of new syscall is very difficult procedure.
> (Documentation/adding-syscalls.txt begins with section "System Call
> Alternatives".)

Well... during the years a lot of system calls have been added. And we've
also seen last-minute changes or reverts. So I don't share your optimistic
view here :)

See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
"unsigned int" instead of u_long") would have been a candidate which could
silently break architectures which need compat wrappers.

> We can invent some protection, but it will cost us in complexity and/or
> runtime delays. Because syscall ABI is so stable, I think it's OK to
> review wrappers carefully once, and they will be fine for long time.

Here I don't agree with you. These interfaces are so important that I'd
like to have a waterproof method that these don't break.  If this involves
a couple of superfluous instructions then that's what I'm willing to pay
for it.

> > Before doing that I think you should actually revert this patch: my commit
> > 7681df456f97 ("s390/compat: remove superfluous compat wrappers") probably
> > wasn't a very bright idea :)
> This patch is OK for me. pid_t, uid_t, gid_t, unsigned and signed int
> types are all 32-bit both on LP64 and ILP32. Normally, compiler should
> care about top halves... Did I miss something?

The patch was correct when writing it, but e.g. a patch like named above
would introduce a possible bug which would go in unnoticed.
The only thing we save is a _single_ unconditional branch here. I'd say
that's well worth it if you get a (hopefully) always bug free sign and zero
extension infrastructure in return.

> I don't know much about s390 specifics. Maybe because of that I do not
> understand completely your worries. I'm OK with both 1st and 2nd
> version, but I'd choose 2nd one because it allows inlines, and we
> don't need the compat_wrapper.c.

It would be only nicer if we can guarentee correctness all the time. That
being said I'm about to revert my own commit :)

So if you want to go without compat_wrapper.c then we should have a
solution which will do the right thing all the time without that a system
call author has to know about the sign and zero extension issue some
architectures face. It _will_ go wrong.

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-02 16:08               ` Heiko Carstens
@ 2016-02-02 19:54                 ` Heiko Carstens
  -1 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-02 19:54 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

Hi Yury,

On Tue, Feb 02, 2016 at 05:08:26PM +0100, Heiko Carstens wrote:
> See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
> "unsigned int" instead of u_long") would have been a candidate which could
> silently break architectures which need compat wrappers.

Ok, this example is of course wrong. But now I can claim that also somebody
who should know better makes these mistakes.. :)

> > I don't know much about s390 specifics. Maybe because of that I do not
> > understand completely your worries. I'm OK with both 1st and 2nd
> > version, but I'd choose 2nd one because it allows inlines, and we
> > don't need the compat_wrapper.c.
> 
> It would be only nicer if we can guarentee correctness all the time. That
> being said I'm about to revert my own commit :)
> 
> So if you want to go without compat_wrapper.c then we should have a
> solution which will do the right thing all the time without that a system
> call author has to know about the sign and zero extension issue some
> architectures face. It _will_ go wrong.

So I think I can summarize my point to: if you can enforce correctness, why
shouldn't you do it if the performance impact is only a single instruction.

However I'll try to write an addon patch to your patch series. Maybe we can
still get rid of compat_wrapper.c in a way which makes both of us happy.
Also.. the idea with the alias names for compat wrappers does seem to have
the disadvantage that it will pollute /proc/kallsyms for example.

Anyway, I'm not sure if I will be able to come up with something this week
though.

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-02 19:54                 ` Heiko Carstens
  0 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-02 19:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Yury,

On Tue, Feb 02, 2016 at 05:08:26PM +0100, Heiko Carstens wrote:
> See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
> "unsigned int" instead of u_long") would have been a candidate which could
> silently break architectures which need compat wrappers.

Ok, this example is of course wrong. But now I can claim that also somebody
who should know better makes these mistakes.. :)

> > I don't know much about s390 specifics. Maybe because of that I do not
> > understand completely your worries. I'm OK with both 1st and 2nd
> > version, but I'd choose 2nd one because it allows inlines, and we
> > don't need the compat_wrapper.c.
> 
> It would be only nicer if we can guarentee correctness all the time. That
> being said I'm about to revert my own commit :)
> 
> So if you want to go without compat_wrapper.c then we should have a
> solution which will do the right thing all the time without that a system
> call author has to know about the sign and zero extension issue some
> architectures face. It _will_ go wrong.

So I think I can summarize my point to: if you can enforce correctness, why
shouldn't you do it if the performance impact is only a single instruction.

However I'll try to write an addon patch to your patch series. Maybe we can
still get rid of compat_wrapper.c in a way which makes both of us happy.
Also.. the idea with the alias names for compat wrappers does seem to have
the disadvantage that it will pollute /proc/kallsyms for example.

Anyway, I'm not sure if I will be able to come up with something this week
though.

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-02 19:54                 ` Heiko Carstens
  (?)
@ 2016-02-02 20:41                   ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-02 20:41 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Tue, Feb 02, 2016 at 08:54:34PM +0100, Heiko Carstens wrote:
> Hi Yury,
> 
> On Tue, Feb 02, 2016 at 05:08:26PM +0100, Heiko Carstens wrote:
> > See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
> > "unsigned int" instead of u_long") would have been a candidate which could
> > silently break architectures which need compat wrappers.
> 
> Ok, this example is of course wrong. But now I can claim that also somebody
> who should know better makes these mistakes.. :)
> 

Yep, this is a bad example. :) Moreover, this patch is coming from year 2010,
and it shows how stable the syscall ABI is.

> > > I don't know much about s390 specifics. Maybe because of that I do not
> > > understand completely your worries. I'm OK with both 1st and 2nd
> > > version, but I'd choose 2nd one because it allows inlines, and we
> > > don't need the compat_wrapper.c.
> > 
> > It would be only nicer if we can guarentee correctness all the time. That
> > being said I'm about to revert my own commit :)
> > 
> > So if you want to go without compat_wrapper.c then we should have a
> > solution which will do the right thing all the time without that a system
> > call author has to know about the sign and zero extension issue some
> > architectures face. It _will_ go wrong.
> 
> So I think I can summarize my point to: if you can enforce correctness, why
> shouldn't you do it if the performance impact is only a single instruction.

For aarch64 it's 5 instructions. But what's more important (if ever),
another wrapper takes another i-cache line...
        <compat_SyS_ftruncate>:
        stp     x29, x30, [sp,#-16]!
        mov     x29, sp
        bl      d40 <do_sys_ftruncate.constprop.3>
        ldp     x29, x30, [sp],#16
        ret

> 
> However I'll try to write an addon patch to your patch series. Maybe we can
> still get rid of compat_wrapper.c in a way which makes both of us happy.
> Also.. the idea with the alias names for compat wrappers does seem to have
> the disadvantage that it will pollute /proc/kallsyms for example.
> 
> Anyway, I'm not sure if I will be able to come up with something this week
> though.

Great, I'm looking forward...

My point is. Syscall ABI is so stable and so important that too much
people are involved in development and testing of it. So automatic
checks are almost useless, as all bugs will be found during
development and review. I think, community is able to pay enough
attention to review a couple of such patches per decade.
But I'm OK with some automatic checker, if it will be :
 - not too complicated, as complex code makes bugs by itself;
 - not too expensive;
 - not too ugly (my one is definitely ugly).

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-02 20:41                   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-02 20:41 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Tue, Feb 02, 2016 at 08:54:34PM +0100, Heiko Carstens wrote:
> Hi Yury,
> 
> On Tue, Feb 02, 2016 at 05:08:26PM +0100, Heiko Carstens wrote:
> > See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
> > "unsigned int" instead of u_long") would have been a candidate which could
> > silently break architectures which need compat wrappers.
> 
> Ok, this example is of course wrong. But now I can claim that also somebody
> who should know better makes these mistakes.. :)
> 

Yep, this is a bad example. :) Moreover, this patch is coming from year 2010,
and it shows how stable the syscall ABI is.

> > > I don't know much about s390 specifics. Maybe because of that I do not
> > > understand completely your worries. I'm OK with both 1st and 2nd
> > > version, but I'd choose 2nd one because it allows inlines, and we
> > > don't need the compat_wrapper.c.
> > 
> > It would be only nicer if we can guarentee correctness all the time. That
> > being said I'm about to revert my own commit :)
> > 
> > So if you want to go without compat_wrapper.c then we should have a
> > solution which will do the right thing all the time without that a system
> > call author has to know about the sign and zero extension issue some
> > architectures face. It _will_ go wrong.
> 
> So I think I can summarize my point to: if you can enforce correctness, why
> shouldn't you do it if the performance impact is only a single instruction.

For aarch64 it's 5 instructions. But what's more important (if ever),
another wrapper takes another i-cache line...
        <compat_SyS_ftruncate>:
        stp     x29, x30, [sp,#-16]!
        mov     x29, sp
        bl      d40 <do_sys_ftruncate.constprop.3>
        ldp     x29, x30, [sp],#16
        ret

> 
> However I'll try to write an addon patch to your patch series. Maybe we can
> still get rid of compat_wrapper.c in a way which makes both of us happy.
> Also.. the idea with the alias names for compat wrappers does seem to have
> the disadvantage that it will pollute /proc/kallsyms for example.
> 
> Anyway, I'm not sure if I will be able to come up with something this week
> though.

Great, I'm looking forward...

My point is. Syscall ABI is so stable and so important that too much
people are involved in development and testing of it. So automatic
checks are almost useless, as all bugs will be found during
development and review. I think, community is able to pay enough
attention to review a couple of such patches per decade.
But I'm OK with some automatic checker, if it will be :
 - not too complicated, as complex code makes bugs by itself;
 - not too expensive;
 - not too ugly (my one is definitely ugly).

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-02 20:41                   ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-02 20:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 02, 2016 at 08:54:34PM +0100, Heiko Carstens wrote:
> Hi Yury,
> 
> On Tue, Feb 02, 2016 at 05:08:26PM +0100, Heiko Carstens wrote:
> > See e.g. 485d52768685 ("sys_personality: change sys_personality() to accept
> > "unsigned int" instead of u_long") would have been a candidate which could
> > silently break architectures which need compat wrappers.
> 
> Ok, this example is of course wrong. But now I can claim that also somebody
> who should know better makes these mistakes.. :)
> 

Yep, this is a bad example. :) Moreover, this patch is coming from year 2010,
and it shows how stable the syscall ABI is.

> > > I don't know much about s390 specifics. Maybe because of that I do not
> > > understand completely your worries. I'm OK with both 1st and 2nd
> > > version, but I'd choose 2nd one because it allows inlines, and we
> > > don't need the compat_wrapper.c.
> > 
> > It would be only nicer if we can guarentee correctness all the time. That
> > being said I'm about to revert my own commit :)
> > 
> > So if you want to go without compat_wrapper.c then we should have a
> > solution which will do the right thing all the time without that a system
> > call author has to know about the sign and zero extension issue some
> > architectures face. It _will_ go wrong.
> 
> So I think I can summarize my point to: if you can enforce correctness, why
> shouldn't you do it if the performance impact is only a single instruction.

For aarch64 it's 5 instructions. But what's more important (if ever),
another wrapper takes another i-cache line...
        <compat_SyS_ftruncate>:
        stp     x29, x30, [sp,#-16]!
        mov     x29, sp
        bl      d40 <do_sys_ftruncate.constprop.3>
        ldp     x29, x30, [sp],#16
        ret

> 
> However I'll try to write an addon patch to your patch series. Maybe we can
> still get rid of compat_wrapper.c in a way which makes both of us happy.
> Also.. the idea with the alias names for compat wrappers does seem to have
> the disadvantage that it will pollute /proc/kallsyms for example.
> 
> Anyway, I'm not sure if I will be able to come up with something this week
> though.

Great, I'm looking forward...

My point is. Syscall ABI is so stable and so important that too much
people are involved in development and testing of it. So automatic
checks are almost useless, as all bugs will be found during
development and review. I think, community is able to pay enough
attention to review a couple of such patches per decade.
But I'm OK with some automatic checker, if it will be :
 - not too complicated, as complex code makes bugs by itself;
 - not too expensive;
 - not too ugly (my one is definitely ugly).

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-02 20:41                   ` Yury Norov
@ 2016-02-03  8:01                     ` Heiko Carstens
  -1 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-03  8:01 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Tue, Feb 02, 2016 at 11:41:56PM +0300, Yury Norov wrote:
> On Tue, Feb 02, 2016 at 08:54:34PM +0100, Heiko Carstens wrote:
> > So I think I can summarize my point to: if you can enforce correctness, why
> > shouldn't you do it if the performance impact is only a single instruction.
> 
> For aarch64 it's 5 instructions. But what's more important (if ever),
> another wrapper takes another i-cache line...
>         <compat_SyS_ftruncate>:
>         stp     x29, x30, [sp,#-16]!
>         mov     x29, sp
>         bl      d40 <do_sys_ftruncate.constprop.3>
>         ldp     x29, x30, [sp],#16
>         ret

Why does gcc allocate a stackframe here? Don't you have tail call
optimization?

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-03  8:01                     ` Heiko Carstens
  0 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-03  8:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 02, 2016 at 11:41:56PM +0300, Yury Norov wrote:
> On Tue, Feb 02, 2016 at 08:54:34PM +0100, Heiko Carstens wrote:
> > So I think I can summarize my point to: if you can enforce correctness, why
> > shouldn't you do it if the performance impact is only a single instruction.
> 
> For aarch64 it's 5 instructions. But what's more important (if ever),
> another wrapper takes another i-cache line...
>         <compat_SyS_ftruncate>:
>         stp     x29, x30, [sp,#-16]!
>         mov     x29, sp
>         bl      d40 <do_sys_ftruncate.constprop.3>
>         ldp     x29, x30, [sp],#16
>         ret

Why does gcc allocate a stackframe here? Don't you have tail call
optimization?

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-02 20:41                   ` Yury Norov
@ 2016-02-17  8:22                     ` Heiko Carstens
  -1 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-17  8:22 UTC (permalink / raw)
  To: Yury Norov
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, joseph, schwidefsky, linux-arm-kernel,
	christoph.muellner

On Tue, Feb 02, 2016 at 11:41:56PM +0300, Yury Norov wrote:
> > However I'll try to write an addon patch to your patch series. Maybe we can
> > still get rid of compat_wrapper.c in a way which makes both of us happy.
> > Also.. the idea with the alias names for compat wrappers does seem to have
> > the disadvantage that it will pollute /proc/kallsyms for example.
> > 
> > Anyway, I'm not sure if I will be able to come up with something this week
> > though.
> 
> Great, I'm looking forward...

Hi Yuri,

after playing around with this a bit I couldn't come up with a solution
that I'm happy with, unfortunately.

So in order to make some progress here I'd vote that we simply move the
existing compat_wrapper.c from arch/s390 to common code like you did in
your first approach and leave the existing SYSCALL macros alone.

That will have hardly any effect to anybody else and your problem is
solved while s390 still works.

Does that make sense?

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-17  8:22                     ` Heiko Carstens
  0 siblings, 0 replies; 50+ messages in thread
From: Heiko Carstens @ 2016-02-17  8:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 02, 2016 at 11:41:56PM +0300, Yury Norov wrote:
> > However I'll try to write an addon patch to your patch series. Maybe we can
> > still get rid of compat_wrapper.c in a way which makes both of us happy.
> > Also.. the idea with the alias names for compat wrappers does seem to have
> > the disadvantage that it will pollute /proc/kallsyms for example.
> > 
> > Anyway, I'm not sure if I will be able to come up with something this week
> > though.
> 
> Great, I'm looking forward...

Hi Yuri,

after playing around with this a bit I couldn't come up with a solution
that I'm happy with, unfortunately.

So in order to make some progress here I'd vote that we simply move the
existing compat_wrapper.c from arch/s390 to common code like you did in
your first approach and leave the existing SYSCALL macros alone.

That will have hardly any effect to anybody else and your problem is
solved while s390 still works.

Does that make sense?

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
  2016-02-17  8:22                     ` Heiko Carstens
  (?)
@ 2016-02-17 13:57                       ` Yury Norov
  -1 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-17 13:57 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, linux-arm-kernel, schwidefsky, joseph,
	christoph.muellner

On Wed, Feb 17, 2016 at 09:22:10AM +0100, Heiko Carstens wrote:
> On Tue, Feb 02, 2016 at 11:41:56PM +0300, Yury Norov wrote:
> > > However I'll try to write an addon patch to your patch series. Maybe we can
> > > still get rid of compat_wrapper.c in a way which makes both of us happy.
> > > Also.. the idea with the alias names for compat wrappers does seem to have
> > > the disadvantage that it will pollute /proc/kallsyms for example.
> > > 
> > > Anyway, I'm not sure if I will be able to come up with something this week
> > > though.
> > 
> > Great, I'm looking forward...
> 
> Hi Yuri,
> 
> after playing around with this a bit I couldn't come up with a solution
> that I'm happy with, unfortunately.
> 
> So in order to make some progress here I'd vote that we simply move the
> existing compat_wrapper.c from arch/s390 to common code like you did in
> your first approach and leave the existing SYSCALL macros alone.
> 
> That will have hardly any effect to anybody else and your problem is
> solved while s390 still works.
> 
> Does that make sense?
> 

OK. This week I'll split v1 as I did with v2, and send it here. So
we'll have two versions, and so will start true elections. :)

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-17 13:57                       ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-17 13:57 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-arch, linux-s390, arnd, pinskia, Prasun.Kapoor,
	catalin.marinas, Nathan_Lynch, linux-kernel, agraf, klimov.linux,
	broonie, linux-arm-kernel, schwidefsky, joseph,
	christoph.muellner

On Wed, Feb 17, 2016 at 09:22:10AM +0100, Heiko Carstens wrote:
> On Tue, Feb 02, 2016 at 11:41:56PM +0300, Yury Norov wrote:
> > > However I'll try to write an addon patch to your patch series. Maybe we can
> > > still get rid of compat_wrapper.c in a way which makes both of us happy.
> > > Also.. the idea with the alias names for compat wrappers does seem to have
> > > the disadvantage that it will pollute /proc/kallsyms for example.
> > > 
> > > Anyway, I'm not sure if I will be able to come up with something this week
> > > though.
> > 
> > Great, I'm looking forward...
> 
> Hi Yuri,
> 
> after playing around with this a bit I couldn't come up with a solution
> that I'm happy with, unfortunately.
> 
> So in order to make some progress here I'd vote that we simply move the
> existing compat_wrapper.c from arch/s390 to common code like you did in
> your first approach and leave the existing SYSCALL macros alone.
> 
> That will have hardly any effect to anybody else and your problem is
> solved while s390 still works.
> 
> Does that make sense?
> 

OK. This week I'll split v1 as I did with v2, and send it here. So
we'll have two versions, and so will start true elections. :)

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers
@ 2016-02-17 13:57                       ` Yury Norov
  0 siblings, 0 replies; 50+ messages in thread
From: Yury Norov @ 2016-02-17 13:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 17, 2016 at 09:22:10AM +0100, Heiko Carstens wrote:
> On Tue, Feb 02, 2016 at 11:41:56PM +0300, Yury Norov wrote:
> > > However I'll try to write an addon patch to your patch series. Maybe we can
> > > still get rid of compat_wrapper.c in a way which makes both of us happy.
> > > Also.. the idea with the alias names for compat wrappers does seem to have
> > > the disadvantage that it will pollute /proc/kallsyms for example.
> > > 
> > > Anyway, I'm not sure if I will be able to come up with something this week
> > > though.
> > 
> > Great, I'm looking forward...
> 
> Hi Yuri,
> 
> after playing around with this a bit I couldn't come up with a solution
> that I'm happy with, unfortunately.
> 
> So in order to make some progress here I'd vote that we simply move the
> existing compat_wrapper.c from arch/s390 to common code like you did in
> your first approach and leave the existing SYSCALL macros alone.
> 
> That will have hardly any effect to anybody else and your problem is
> solved while s390 still works.
> 
> Does that make sense?
> 

OK. This week I'll split v1 as I did with v2, and send it here. So
we'll have two versions, and so will start true elections. :)

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2016-02-17 13:57 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 16:57 [PATCH 0/5] all: s390: make compat wrappers the generic solution Yury Norov
2016-01-25 16:57 ` Yury Norov
2016-01-25 16:57 ` Yury Norov
2016-01-25 16:57 ` Yury Norov
2016-01-25 16:57 ` [PATCH 1/5] all: s390: move wrapper infrastructure to generic headers Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 18:10   ` kbuild test robot
2016-01-25 18:10     ` kbuild test robot
2016-01-25 18:10     ` kbuild test robot
2016-01-25 18:10     ` kbuild test robot
2016-01-28 12:16   ` Heiko Carstens
2016-01-28 12:16     ` Heiko Carstens
2016-01-28 16:31     ` Yury Norov
2016-01-28 16:31       ` Yury Norov
2016-01-28 16:31       ` Yury Norov
2016-02-01 11:42       ` Yury Norov
2016-02-01 11:42         ` Yury Norov
2016-02-01 11:42         ` Yury Norov
2016-02-02  7:39         ` Heiko Carstens
2016-02-02  7:39           ` Heiko Carstens
2016-02-02 15:43           ` Yury Norov
2016-02-02 15:43             ` Yury Norov
2016-02-02 15:43             ` Yury Norov
2016-02-02 16:08             ` Heiko Carstens
2016-02-02 16:08               ` Heiko Carstens
2016-02-02 19:54               ` Heiko Carstens
2016-02-02 19:54                 ` Heiko Carstens
2016-02-02 20:41                 ` Yury Norov
2016-02-02 20:41                   ` Yury Norov
2016-02-02 20:41                   ` Yury Norov
2016-02-03  8:01                   ` Heiko Carstens
2016-02-03  8:01                     ` Heiko Carstens
2016-02-17  8:22                   ` Heiko Carstens
2016-02-17  8:22                     ` Heiko Carstens
2016-02-17 13:57                     ` Yury Norov
2016-02-17 13:57                       ` Yury Norov
2016-02-17 13:57                       ` Yury Norov
2016-01-25 16:57 ` [PATCH 2/5] all: declare new wrappers Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57 ` [PATCH 3/5] all: s390: redefine wrappers in generic code Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57 ` [PATCH 4/5] all: wrap getdents64 syscall Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57 ` [PATCH 5/5] all: introduce COMPAT_WRAPPER option and enable it for s390 Yury Norov
2016-01-25 16:57   ` Yury Norov
2016-01-25 16:57   ` Yury Norov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.