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]
Message-ID: <20061130232354.GA12359@muc.de>
Date:	Fri, 1 Dec 2006 00:23:54 +0100
From:	Andi Kleen <ak@....de>
To:	Mathieu Desnoyers <compudj@...stal.dyndns.org>
Cc:	vojtech@...e.cz, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] atomic_cmpxchg return type error

On Thu, Nov 30, 2006 at 04:17:06PM -0500, Mathieu Desnoyers wrote:
> Hi,
> 
> I just noticed that a atomic_cmpxchg, that would be given an atomic64_t
> parameter, would cast the return value as a (int). In the typical use of this
> primitive, the result would be that the 32 MSB would be lost when comparing
> against the original value. It also affects atomic_add_unless. Note that there
> is no atomic64_cmpxchg nor atomic64_add_unless, which might make things a
> little clearer.

Normally you're supposed to only use atomic64_* with atomic64_t

While it works for most by accident on x86 to just use atomic_* 
with atomic64_t it's not portable to other architectures.

If you want to use those with atomic64_t suitable macros would need
to be added on all architectures.

-Andi
-
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