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:	Mon, 20 Feb 2012 09:28:42 -0800
From:	Richard Henderson <rth@...ddle.net>
To:	Michael Cree <mcree@...on.net.nz>
CC:	Michel Lespinasse <walken@...gle.com>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>,
	linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org,
	Matt Turner <mattst88@...il.com>
Subject: Re: alpha: futex regression bisected

On 02/20/12 00:20, Michael Cree wrote:
> I have noticed some user space problems (pulseaudio crashes in pthread
> code, glibc/nptl test suite failures, java compiler freezes on SMP alpha
> systems) that arise when using a 2.6.39 or later kernel on Alpha.
> Bisecting between 2.6.38 and 2.6.39 (using glibc/nptl test suite as
> criterion for good/bad kernel) eventually leads to:
> 
> 8d7718aa082aaf30a0b4989e1f04858952f941bc is the first bad commit
> commit 8d7718aa082aaf30a0b4989e1f04858952f941bc
> Author: Michel Lespinasse <walken@...gle.com>
> Date:   Thu Mar 10 18:50:58 2011 -0800
> 
>     futex: Sanitize futex ops argument types
> 
>     Change futex_atomic_op_inuser and futex_atomic_cmpxchg_inatomic
>     prototypes to use u32 types for the futex as this is the data type the
>     futex core code uses all over the place.


futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
                              u32 oldval, u32 newval)
...
        :       "r"(uaddr), "r"((long)oldval), "r"(newval)


There is no 32-bit compare instruction.  These are implemented by
consistently extending the values to a 64-bit type.  Since the
load instruction sign-extends, we want to sign-extend the other
quantity as well (despite the fact it's logically unsigned).

So:

-        :       "r"(uaddr), "r"((long)oldval), "r"(newval)
+        :       "r"(uaddr), "r"((long)(int)oldval), "r"(newval)

should do the trick.


r~
--
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