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-next>] [day] [month] [year] [list]
Message-Id: <20250911162641.796716-1-kaushlendra.kumar@intel.com>
Date: Thu, 11 Sep 2025 21:56:41 +0530
From: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
To: dave@...olabs.net,
	paulmck@...nel.org,
	josh@...htriplett.org,
	frederic@...nel.org,
	neeraj.upadhyay@...nel.org,
	rostedt@...dmis.org
Cc: linux-kernel@...r.kernel.org,
	rcu@...r.kernel.org,
	Kaushlendra Kumar <kaushlendra.kumar@...el.com>
Subject: [PATCH v2] rcu/segcblist: Use WRITE_ONCE() for rclp->len decrement

Use WRITE_ONCE() for rclp->len decrement in rcu_cblist_dequeue() to
maintain consistency with rcu_cblist_enqueue(), which already uses
WRITE_ONCE() for rclp->len increment. It maintains consistent access
patterns to the rclp->len field across both enqueue and dequeue operations.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
---
Changes in v2:
- Revised justification to focus on code consistency rather than
  concurrent access claims.
- Revised commit message to use imperative mood throughout per kernel
  documentation guidelines (suggested by Markus Elfring).

 kernel/rcu/rcu_segcblist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c
index 1693ea22ef1b..e10b36e9de54 100644
--- a/kernel/rcu/rcu_segcblist.c
+++ b/kernel/rcu/rcu_segcblist.c
@@ -71,7 +71,7 @@ struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp)
 	rhp = rclp->head;
 	if (!rhp)
 		return NULL;
-	rclp->len--;
+	WRITE_ONCE(rclp->len, rclp->len - 1);
 	rclp->head = rhp->next;
 	if (!rclp->head)
 		rclp->tail = &rclp->head;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ