]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rwonce: fix crash by removing READ_ONCE() for unaligned read
authorJann Horn <jannh@google.com>
Wed, 26 Mar 2025 21:04:36 +0000 (22:04 +0100)
committerArnd Bergmann <arnd@arndb.de>
Wed, 26 Mar 2025 21:16:50 +0000 (22:16 +0100)
commit47a60391ae0ed04ffbb9bd8dcd94ad9d08b41288
tree4ca8d7fa67a0c36b08931360d58569dfd0f53452
parentece69af2ede103e190ffdfccd9f9ec850606ab5e
rwonce: fix crash by removing READ_ONCE() for unaligned read

When arm64 is built with LTO, it upgrades READ_ONCE() to ldar / ldapr
(load-acquire) to avoid issues that can be caused by the compiler
optimizing away implicit address dependencies.

Unlike plain loads, these load-acquire instructions actually require an
aligned address.

For now, fix it by removing the READ_ONCE() that the buggy commit
introduced.

Fixes: ece69af2ede1 ("rwonce: handle KCSAN like KASAN in read_word_at_a_time()")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/r/20250326203926.GA10484@ax162
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
include/asm-generic/rwonce.h