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]
Message-ID: <CALCETrXUjM9g2e5v7chFXWoadvUO_7cqhGvuFn2s7YVpyff__Q@mail.gmail.com>
Date:   Tue, 16 Jun 2020 09:49:00 -0700
From:   Andy Lutomirski <luto@...nel.org>
To:     Brian Gerst <brgerst@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
        "H . Peter Anvin" <hpa@...or.com>,
        Andy Lutomirski <luto@...nel.org>,
        Christoph Hellwig <hch@....de>, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH 1/2] x86/x32: Use __x64 prefix for X32 compat syscalls

On Tue, Jun 16, 2020 at 7:23 AM Brian Gerst <brgerst@...il.com> wrote:
>
> The ABI prefix for syscalls specifies the argument register mapping, so
> there is no specific reason to continue using the __x32 prefix for the
> compat syscalls.  This change will allow using native syscalls in the X32
> specific portion of the syscall table.

Okay, I realize that the x86 syscall machinery is held together by
duct tape and a lot of luck, but:

>
> Signed-off-by: Brian Gerst <brgerst@...il.com>
> ---
>  arch/x86/entry/syscall_x32.c           |  8 +++-----
>  arch/x86/include/asm/syscall_wrapper.h | 10 +++++-----
>  2 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/arch/x86/entry/syscall_x32.c b/arch/x86/entry/syscall_x32.c
> index 3d8d70d3896c..f993e6254043 100644
> --- a/arch/x86/entry/syscall_x32.c
> +++ b/arch/x86/entry/syscall_x32.c
> @@ -9,15 +9,13 @@
>  #include <asm/syscall.h>
>
>  #define __SYSCALL_64(nr, sym)
> +#define __SYSCALL_COMMON(nr, sym) __SYSCALL_X32(nr, sym)
>
> -#define __SYSCALL_X32(nr, sym) extern long __x32_##sym(const struct pt_regs *);
> -#define __SYSCALL_COMMON(nr, sym) extern long __x64_##sym(const struct pt_regs *);
> +#define __SYSCALL_X32(nr, sym) extern long __x64_##sym(const struct pt_regs *);
>  #include <asm/syscalls_64.h>
>  #undef __SYSCALL_X32
> -#undef __SYSCALL_COMMON
>
> -#define __SYSCALL_X32(nr, sym) [nr] = __x32_##sym,
> -#define __SYSCALL_COMMON(nr, sym) [nr] = __x64_##sym,
> +#define __SYSCALL_X32(nr, sym) [nr] = __x64_##sym,
>
>  asmlinkage const sys_call_ptr_t x32_sys_call_table[__NR_x32_syscall_max+1] = {
>         /*
> diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h
> index a84333adeef2..267fae9904ff 100644
> --- a/arch/x86/include/asm/syscall_wrapper.h
> +++ b/arch/x86/include/asm/syscall_wrapper.h
> @@ -17,7 +17,7 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs);
>   * __x64_sys_*()         - 64-bit native syscall
>   * __ia32_sys_*()        - 32-bit native syscall or common compat syscall
>   * __ia32_compat_sys_*() - 32-bit compat syscall

On a 64-bit kernel, an "ia32" compat syscall is __ia32_compat_sys_*, but...

> - * __x32_compat_sys_*()  - 64-bit X32 compat syscall
> + * __x64_compat_sys_*()  - 64-bit X32 compat syscall

Now an x32 compat syscall is __x64_compat?  This seems nonsensical.
I'm also a bit confused as to how this is even necessary for your
other patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ