summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2024-10-23 13:05:34 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-14 19:54:14 +0100
commit213f22fb42530eed099b8acae9315e776bbcc791 (patch)
treef4c739fbebee6902ecb8b21b1b6732d7e4db89ff /arch
parent8fe148d39c127de3fb78dfa6da95a3608dfda454 (diff)
downloadlinux-213f22fb42530eed099b8acae9315e776bbcc791.tar.gz
linux-213f22fb42530eed099b8acae9315e776bbcc791.tar.bz2
linux-213f22fb42530eed099b8acae9315e776bbcc791.zip
ARM: 9431/1: mm: Pair atomic_set_release() with _read_acquire()
commit 93ee385254d53849c01dd8ab9bc9d02790ee7f0e upstream. The code for syncing vmalloc memory PGD pointers is using atomic_read() in pair with atomic_set_release() but the proper pairing is atomic_read_acquire() paired with atomic_set_release(). This is done to clearly instruct the compiler to not reorder the memcpy() or similar calls inside the section so that we do not observe changes to init_mm. memcpy() calls should be identified by the compiler as having unpredictable side effects, but let's try to be on the safe side. Cc: stable@vger.kernel.org Fixes: d31e23aff011 ("ARM: mm: make vmalloc_seq handling SMP safe") Suggested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mm/ioremap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index cd9ef5b6a70f..1c5aeba9bc27 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -141,7 +141,7 @@ void __check_vmalloc_seq(struct mm_struct *mm)
int seq;
do {
- seq = atomic_read(&init_mm.context.vmalloc_seq);
+ seq = atomic_read_acquire(&init_mm.context.vmalloc_seq);
memcpy_pgd(mm, VMALLOC_START, VMALLOC_END);
if (IS_ENABLED(CONFIG_KASAN_VMALLOC)) {
unsigned long start =