public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH locking/Documentation 1/2] Add note of release-acquire store vulnerability
@ 2016-09-29 15:54 Paul E. McKenney
  2016-09-29 15:58 ` Peter Zijlstra
  0 siblings, 1 reply; 27+ messages in thread
From: Paul E. McKenney @ 2016-09-29 15:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo, dhowells, will.deacon, peterz, stern

If two processes are related by a RELEASE+ACQUIRE pair, ordering can be
broken if a third process overwrites the value written by the RELEASE
operation before the ACQUIRE operation has a chance of reading it.
This commit therefore updates the documentation to call this vulnerability
out explicitly.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 Documentation/memory-barriers.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index ba818ecce6f9..a57679ec9441 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -490,14 +490,18 @@ And a couple of implicit varieties:
      the subsection "MMIO write barrier").  In addition, a RELEASE+ACQUIRE
      pair is -not- guaranteed to act as a full memory barrier.  However, after
      an ACQUIRE on a given variable, all memory accesses preceding any prior
-     RELEASE on that same variable are guaranteed to be visible.  In other
-     words, within a given variable's critical section, all accesses of all
-     previous critical sections for that variable are guaranteed to have
-     completed.
+     RELEASE on that same variable in that same chain of RELEASE+ACQUIRE
+     pairs are guaranteed to be visible.  In other words, within a given
+     variable's critical section, all accesses of all previous critical
+     sections for that variable are guaranteed to have completed.
 
      This means that ACQUIRE acts as a minimal "acquire" operation and
      RELEASE acts as a minimal "release" operation.
 
+     However, please note that a chain of RELEASE+ACQUIRE pairs may be
+     broken by a store by another thread that overwrites the RELEASE
+     operation's store before the ACQUIRE operation's read.
+
 A subset of the atomic operations described in atomic_ops.txt have ACQUIRE
 and RELEASE variants in addition to fully-ordered and relaxed (no barrier
 semantics) definitions.  For compound atomics performing both a load and a
-- 
2.5.2

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2016-09-30 13:35 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-29 15:54 [PATCH locking/Documentation 1/2] Add note of release-acquire store vulnerability Paul E. McKenney
2016-09-29 15:58 ` Peter Zijlstra
2016-09-29 16:03   ` Will Deacon
2016-09-29 16:17     ` Peter Zijlstra
2016-09-29 16:44       ` Paul E. McKenney
2016-09-29 16:43     ` Paul E. McKenney
2016-09-29 17:10       ` Will Deacon
2016-09-29 17:23         ` Paul E. McKenney
2016-09-29 18:04           ` Paul E. McKenney
2016-09-29 18:10             ` Paul E. McKenney
2016-09-29 18:44               ` Peter Zijlstra
2016-09-29 19:18                 ` Paul E. McKenney
2016-09-29 19:36                   ` Alan Stern
2016-09-29 20:26                     ` Paul E. McKenney
2016-09-30  8:53                     ` Peter Zijlstra
2016-09-30  9:00                   ` Peter Zijlstra
2016-09-30  9:57                   ` Peter Zijlstra
2016-09-30 12:14                     ` Paul E. McKenney
2016-09-30 12:51                       ` Peter Zijlstra
2016-09-30 13:35                         ` Paul E. McKenney
2016-09-30  5:53           ` Boqun Feng
2016-09-30  9:20             ` Will Deacon
2016-09-30 11:35               ` Paul E. McKenney
2016-09-30 10:25       ` Peter Zijlstra
2016-09-30 12:17         ` Paul E. McKenney
2016-09-30 12:45           ` Peter Zijlstra
2016-09-30 13:10             ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox