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>] [day] [month] [year] [list]
Message-ID: <162927352167.25758.12237136355668920471.tip-bot2@tip-bot2>
Date:   Wed, 18 Aug 2021 07:58:41 -0000
From:   "tip-bot2 for Paul E. McKenney" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Manfred Spraul <manfred@...orfullife.com>,
        "Paul E. McKenney" <paulmck@...nel.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: locking/debug] tools/memory-model: Make read_foo_diagnostic()
 more clearly diagnostic

The following commit has been merged into the locking/debug branch of tip:

Commit-ID:     1846a7fa767fbf8cf42d71daf75d51e30e3c8327
Gitweb:        https://git.kernel.org/tip/1846a7fa767fbf8cf42d71daf75d51e30e3c8327
Author:        Paul E. McKenney <paulmck@...nel.org>
AuthorDate:    Thu, 13 May 2021 11:17:02 -07:00
Committer:     Paul E. McKenney <paulmck@...nel.org>
CommitterDate: Tue, 20 Jul 2021 13:52:03 -07:00

tools/memory-model: Make read_foo_diagnostic() more clearly diagnostic

The current definition of read_foo_diagnostic() in the "Lock Protection
With Lockless Diagnostic Access" section returns a value, which could
be use for any purpose.  This could mislead people into incorrectly
using data_race() in cases where READ_ONCE() is required.  This commit
therefore makes read_foo_diagnostic() simply print the value read.

Reported-by: Manfred Spraul <manfred@...orfullife.com>
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
---
 tools/memory-model/Documentation/access-marking.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/memory-model/Documentation/access-marking.txt b/tools/memory-model/Documentation/access-marking.txt
index 1ab189f..58bff26 100644
--- a/tools/memory-model/Documentation/access-marking.txt
+++ b/tools/memory-model/Documentation/access-marking.txt
@@ -259,9 +259,9 @@ diagnostic purposes.  The code might look as follows:
 		return ret;
 	}
 
-	int read_foo_diagnostic(void)
+	void read_foo_diagnostic(void)
 	{
-		return data_race(foo);
+		pr_info("Current value of foo: %d\n", data_race(foo));
 	}
 
 The reader-writer lock prevents the compiler from introducing concurrency

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ