lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Jan 2019 14:31:15 +0100
From:   Heiko Carstens <heiko.carstens@...ibm.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     linux-s390@...r.kernel.org,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        linux-kernel@...r.kernel.org, y2038@...ts.linaro.org,
        Dominik Brodowski <linux@...inikbrodowski.net>,
        Mark Rutland <mark.rutland@....com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH 4/5] s390: autogenerate compat syscall wrappers

On Wed, Jan 16, 2019 at 02:15:22PM +0100, Arnd Bergmann wrote:
> Any system call that takes a pointer argument on s390 requires
> a wrapper function to do a 31-to-64 zero-extension, these are
> currently generated in arch/s390/kernel/compat_wrapper.c.
> 
> On arm64 and x86, we already generate similar wrappers for all
> system calls in the place of their definition, just for a different
> purpose (they load the arguments from pt_regs).
> 
> We can do the same thing here, by adding an asm/syscall_wrapper.h
> file with a copy of all the relevant macros to override the generic
> version. Besides the addition of the compat entry point, these also
> rename the entry points with a __s390_ or __s390x_ prefix, similar
> to what we do on arm64 and x86. This in turn requires renaming
> a few things, and adding a proper ni_syscall() entry point.
> 
> In order to still compile system call definitions that pass an
> loff_t argument, the __SC_COMPAT_CAST() macro checks for that
> and forces an -ENOSYS error, which was the best I could come up
> with. Those functions must obviously not get called from user
> space, but instead require hand-written compat_sys_*() handlers,
> which fortunately already exist.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  arch/s390/Kconfig                       |   1 +
>  arch/s390/include/asm/syscall_wrapper.h | 136 ++++++++++++++++++++++++
>  arch/s390/kernel/compat_wrapper.c       |  23 +---
>  arch/s390/kernel/entry.S                |   4 +-
>  arch/s390/kernel/sys_s390.c             |   5 +
>  5 files changed, 148 insertions(+), 21 deletions(-)
>  create mode 100644 arch/s390/include/asm/syscall_wrapper.h

The patch below is needed as compile fix (allnoconfig).
I will add this to your patch, no resend needed.

diff --git a/arch/s390/include/asm/syscall_wrapper.h b/arch/s390/include/asm/syscall_wrapper.h
index 27ebe871692f..873e7a7794b3 100644
--- a/arch/s390/include/asm/syscall_wrapper.h
+++ b/arch/s390/include/asm/syscall_wrapper.h
@@ -106,11 +106,10 @@
 	asmlinkage long __s390x_sys_##sname(void)
 
 #define COND_SYSCALL(name)						\
-	cond_syscall(__s390x_sys_##name)				\
-	cond_syscall(__s390_sys_##name)
+	cond_syscall(__s390x_sys_##name)
 
 #define SYS_NI(name)							\
-	SYSCALL_ALIAS(__s390_sys_##name, sys_ni_posix_timers);
+	SYSCALL_ALIAS(__s390x_sys_##name, sys_ni_posix_timers);
 
 #endif /* CONFIG_COMPAT */
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ