[merged mm-nonmm-stable] lib-plistc-enforce-memory-ordering-in-plist_check_list.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: lib/plist.c: enforce memory ordering in plist_check_list
has been removed from the -mm tree.  Its filename was
     lib-plistc-enforce-memory-ordering-in-plist_check_list.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: I Hsin Cheng <richard120310@xxxxxxxxx>
Subject: lib/plist.c: enforce memory ordering in plist_check_list
Date: Sun, 26 May 2024 22:01:39 +0800

There exists an iteration over a plist in plist_check_list(), and memory
dependency exists between variables "prev", "next" and "prev->next".  As
plist is used in the scheduling subsystem, we should guarantee the memory
ordering between multiple processors.

Using macro "WRITE_ONCE()" can help us to ensure the memory ordering as
it was stated in "Documentation/memory-barriers.txt".

Link: https://lkml.kernel.org/r/20240526140139.17220-1-richard120310@xxxxxxxxx
Signed-off-by: I Hsin Cheng <richard120310@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/plist.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/lib/plist.c~lib-plistc-enforce-memory-ordering-in-plist_check_list
+++ a/lib/plist.c
@@ -47,8 +47,8 @@ static void plist_check_list(struct list
 
 	plist_check_prev_next(top, prev, next);
 	while (next != top) {
-		prev = next;
-		next = prev->next;
+		WRITE_ONCE(prev, next);
+		WRITE_ONCE(next, prev->next);
 		plist_check_prev_next(top, prev, next);
 	}
 }
_

Patches currently in -mm which might be from richard120310@xxxxxxxxx are






[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux