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:	Tue, 23 Sep 2014 23:47:59 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	"LF.Tan" <lftan.linux@...il.com>
cc:	Linux-Arch <linux-arch@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	Arnd Bergmann <arnd@...db.de>, Ley Foon Tan <lftan@...era.com>,
	Chung-Lin Tang <cltang@...esourcery.com>
Subject: Re: [PATCH v3 01/29] asm-generic: add generic futex for
 !CONFIG_SMP

On Tue, 23 Sep 2014, LF.Tan wrote:
> On Mon, Sep 8, 2014 at 5:22 PM, Ley Foon Tan <lftan@...era.com> wrote:
> > Follow m68k futex implementation for !CONFIG_SMP.

Great. Follow arch/random implementation blindly and copy all the bugs
in it.

> > +static inline int
> > +futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
> > +                             u32 oldval, u32 newval)
> > +{
> > +       u32 val;
> > +
> > +       if (unlikely(get_user(val, uaddr) != 0))
> > +               return -EFAULT;
> > +
> > +       if (val == oldval && unlikely(put_user(newval, uaddr) != 0))
> > +               return -EFAULT;
> > +
> > +       *uval = val;
> > +
> > +       return 0;
> > +}

Care to explain how this works reliably and resembles proper cmpxchg
semantics under all circumstances?

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ