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: <20240814145256.1683498-1-mjguzik@gmail.com>
Date: Wed, 14 Aug 2024 16:52:56 +0200
From: Mateusz Guzik <mjguzik@...il.com>
To: akpm@...ux-foundation.org,
	npiggin@...il.com
Cc: david@...hat.com,
	willy@...radead.org,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	Mateusz Guzik <mjguzik@...il.com>
Subject: [PATCH] mm: whack now bogus comment in pmd_install() concerning a fence

Commit 362a61ad6119 ("fix SMP data race in pagetable setup vs walking")
added the following:

+       smp_wmb(); /* Could be smp_wmb__xxx(before|after)_spin_lock */
+
        spin_lock(&mm->page_table_lock);

However, over the years the fence along with the comment got moved
around the file, eventually landing in a spot where it is *NOT* followed
by a lock acquire (or any other operation which might happen to provide
any fence on a given arch), rendering the comment stale.

Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
---

./scripts/get_maintainer.pl only showed akpm@ and the lists, adding the
--git switch showed more names, but I only picked some of them. I don't
know who makes the most sense to add here.

I fully concede I could not be arsed to check if the fence is still
needed to begin with, I ran into this while looking at something else.
The comment puzzled me for a minute suggesting pmd_populate has an
immediate lock acquire inside.

 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index 34f8402d2046..0a6893833fac 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -436,7 +436,7 @@ void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte)
 		 * seen in-order. See the alpha page table accessors for the
 		 * smp_rmb() barriers in page table walking code.
 		 */
-		smp_wmb(); /* Could be smp_wmb__xxx(before|after)_spin_lock */
+		smp_wmb();
 		pmd_populate(mm, pmd, *pte);
 		*pte = NULL;
 	}
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ