Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1403100

Re: [RFC PATCH 01/15] cmpxchg_local() is not signed-value safe, so fix generic atomics

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 01/15] cmpxchg_local() is not signed-value safe, so fix generic atomics
Date 2016-05-18 17:40 +0200
Message-ID <rAbJM-3Wj-17@gated-at.bofh.it> (permalink)
References <rAbqp-3On-7@gated-at.bofh.it> <rAbqr-3On-57@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wednesday 18 May 2016 16:10:45 David Howells wrote:
> cmpxchg_local() is not signed-value safe because on a 64-bit machine signed
> int arguments to it may be sign-extended to signed long _before_ begin cast
> to unsigned long.  This potentially causes comparisons to fail when dealing
> with negative values.
> 
> Fix the generic atomic functions that are implemented in terms of cmpxchg()
> to cast their arguments to unsigned int before calling cmpxchg().
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> 

Isn't the problem you describe something that cmpxchg() could prevent instead?

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC PATCH 01/15] cmpxchg_local() is not signed-value safe,  so fix generic atomics David Howells <dhowells@redhat.com> - 2016-05-18 17:20 +0200
  Re: [RFC PATCH 01/15] cmpxchg_local() is not signed-value safe, so fix generic atomics Arnd Bergmann <arnd@arndb.de> - 2016-05-18 17:40 +0200

csiph-web