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]
Message-ID: <72af935f4a2a4e23b68845d2f6855103@AcuMS.aculab.com>
Date: Sun, 6 Oct 2024 19:52:49 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Mathieu Desnoyers' <mathieu.desnoyers@...icios.com>, Boqun Feng
	<boqun.feng@...il.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Linus
 Torvalds" <torvalds@...ux-foundation.org>, Andrew Morton
	<akpm@...ux-foundation.org>, Peter Zijlstra <peterz@...radead.org>, "Nicholas
 Piggin" <npiggin@...il.com>, Michael Ellerman <mpe@...erman.id.au>, "Greg
 Kroah-Hartman" <gregkh@...uxfoundation.org>, Sebastian Andrzej Siewior
	<bigeasy@...utronix.de>, "Paul E. McKenney" <paulmck@...nel.org>, Will Deacon
	<will@...nel.org>, Alan Stern <stern@...land.harvard.edu>, John Stultz
	<jstultz@...gle.com>, Neeraj Upadhyay <Neeraj.Upadhyay@....com>, "Frederic
 Weisbecker" <frederic@...nel.org>, Joel Fernandes <joel@...lfernandes.org>,
	Josh Triplett <josh@...htriplett.org>, Uladzislau Rezki <urezki@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>, Lai Jiangshan <jiangshanlai@...il.com>,
	Zqiang <qiang.zhang1211@...il.com>, Ingo Molnar <mingo@...hat.com>, "Waiman
 Long" <longman@...hat.com>, Mark Rutland <mark.rutland@....com>, "Thomas
 Gleixner" <tglx@...utronix.de>, Vlastimil Babka <vbabka@...e.cz>,
	"maged.michael@...il.com" <maged.michael@...il.com>, Mateusz Guzik
	<mjguzik@...il.com>, Jonas Oberhauser <jonas.oberhauser@...weicloud.com>,
	"rcu@...r.kernel.org" <rcu@...r.kernel.org>, "linux-mm@...ck.org"
	<linux-mm@...ck.org>, "lkmm@...ts.linux.dev" <lkmm@...ts.linux.dev>, Gary Guo
	<gary@...yguo.net>, Nikita Popov <github@...pov.com>, "llvm@...ts.linux.dev"
	<llvm@...ts.linux.dev>
Subject: RE: [RFC PATCH v2 2/4] Documentation: RCU: Refer to ptr_eq()

From: Mathieu Desnoyers
> Sent: 04 October 2024 19:28
> 
> Refer to ptr_eq() in the rcu_dereference() documentation.
> 
> ptr_eq() is a mechanism that preserves address dependencies when
> comparing pointers, and should be favored when comparing a pointer
> obtained from rcu_dereference() against another pointer.

Why does this ever really matter for rcu?

The check just ensure that any speculative load uses
a specific one of the pointers when they are different.
This can only matter if you care about the side effects
of the speculative load.

But rcu is all about (things like) lockless list following.
So you need to wait until it is impossible for another
execution context to have a reference to some memory
before actually completely invalidating it (ie kfree()).

And that 50 line comment is pointless.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ