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] [day] [month] [year] [list]
Date:   Fri, 25 Jan 2019 10:29:35 -0800
From:   Max Filippov <jcmvbkbc@...il.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Arnd Bergmann <arnd@...db.de>,
        Paul Burton <paul.burton@...s.com>,
        Ralf Baechle <ralf@...ux-mips.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Greg Ungerer <gerg@...ux-m68k.org>
Subject: Re: [PATCH] treewide: get rid of HAVE_FUTEX_CMPXCHG

Hi Geert,

> > --- a/arch/m68k/Kconfig
> > +++ b/arch/m68k/Kconfig
> > @@ -20,7 +20,6 @@ config M68K
> >         select GENERIC_STRNLEN_USER if MMU
> >         select ARCH_WANT_IPC_PARSE_VERSION
> >         select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
> > -       select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
>
> I guess it didn't really matter for !MMU?

I see that m68k uses generic futex.h, which doesn't depend on
MMU vs noMMU.

> > --- a/include/asm-generic/futex.h
> > +++ b/include/asm-generic/futex.h
> > @@ -136,6 +136,8 @@ arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr)
> >         return ret;
> >  }
> >
> > +#define arch_have_futex_cmpxchg() (0)
>
> This is for the SMP=y case only, right?

Yes, that's where generic implementation always returns -ENOSYS

> > --- a/kernel/futex.c
> > +++ b/kernel/futex.c
> > @@ -174,7 +174,11 @@
> >   * double_lock_hb() and double_unlock_hb(), respectively.
> >   */
> >
> > -#ifdef CONFIG_HAVE_FUTEX_CMPXCHG
> > +/*
> > + * Architectures should define this macro if futex_atomic_cmpxchg_inatomic()
> > + * may not be always working.
> > + */
> > +#ifdef arch_have_futex_cmpxchg
>
> Shouldn't this be #ifndef now...

Oops, thank you.
I thought I've build-tested both cases, but I obviously haven't...

> > @@ -3880,7 +3864,9 @@ static int __init futex_init(void)
> >                                                futex_hashsize, futex_hashsize);
> >         futex_hashsize = 1UL << futex_shift;
> >
> > -       futex_detect_cmpxchg();
> > +#ifdef arch_have_futex_cmpxchg
> > +       futex_cmpxchg_enabled = arch_have_futex_cmpxchg();
>
> ... else you're assigning to the constant:
>
>     error: lvalue required as left operand of assignment

Will send v2...

-- 
Thanks.
-- Max

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ