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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190913113355.GA32453@lakrids.cambridge.arm.com>
Date:   Fri, 13 Sep 2019 12:33:55 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Will Deacon <will@...nel.org>
Cc:     Sami Tolvanen <samitolvanen@...gle.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Kees Cook <keescook@...omium.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64: fix function types in COND_SYSCALL

On Thu, Sep 12, 2019 at 02:11:44PM +0100, Will Deacon wrote:
> On Wed, Sep 11, 2019 at 04:15:46PM +0100, Mark Rutland wrote:
> > On Tue, Sep 10, 2019 at 03:40:44PM -0700, Sami Tolvanen wrote:
> > > Define a weak function in COND_SYSCALL instead of a weak alias to
> > > sys_ni_syscall, which has an incompatible type. This fixes indirect
> > > call mismatches with Control-Flow Integrity (CFI) checking.
> > > 
> > > Signed-off-by: Sami Tolvanen <samitolvanen@...gle.com>
> > 
> > This looks correct to me, builds fine, and I asume has been tested, so FWIW:
> > 
> > Acked-by: Mark Rutland <mark.rutland@....com>
> > 
> > In looking at this, I came to the conclusion that we can drop the ifdeffery
> > around our SYSCALL_DEFINE0(), COND_SYSCALL(), and SYS_NI(), which I evidently
> > cargo-culted from x86 (where the ifdeffery is actually necessary).
> 
> Curious: why is it required on x86?

Due to the way they share some native calls with (IA32) compat, but need
slightly different wrappers to marshall registers, they have ifdeffery
like:

#ifdef CONFIG_IA32_EMULATION
#define COND_SYSCALL(name)                                              \
        cond_syscall(__x64_sys_##name);                                 \
        cond_syscall(__ia32_sys_##name)
#endif

#ifndef COND_SYSCALL
#define COND_SYSCALL(name) cond_syscall(__x64_sys_##name)
#endif

... so that they define the compat wrapper when necessary, but not otherwise.

As we don't share the native syscall table with compat tasks, we don't
need to do anything like that, and can unconditionally define the native
case once.

> > I can send a follow up for that.
> 
> Yes, please.

I'll cook that up now, atop of Sami's patch applied to arm64's
for-next/core.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ