]> git.hungrycats.org Git - linux/commit
ARM: 9431/1: mm: Pair atomic_set_release() with _read_acquire()
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 23 Oct 2024 12:05:34 +0000 (13:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:33:06 +0000 (10:33 +0100)
commit2c932d5c7aac987b2c74e47fff94a9fd10ce2fc5
treebf07ee9b47fa1ec8cf3c4cc3c18a42530774d805
parentef21187c0672a2b2cbec44f33bab9ec47d5c277c
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>
arch/arm/mm/ioremap.c