linux/arch
Karl Mehltretter a3049e49e6 ARM: 9474/1: io: avoid KASAN instrumentation of raw halfword I/O
commit d59ed80371 upstream.

For CPUs before ARMv6, __raw_readw() and __raw_writew() are implemented
as C volatile halfword accesses so the compiler can generate an access
sequence that is safe for those machines. With KASAN enabled, those C
accesses are instrumented as normal memory accesses.

That is not valid for MMIO. On ARM926/VersatilePB with KASAN enabled,
PL011 probing traps in __asan_store2() while registering the UART, because
the instrumented writew() tries to check KASAN shadow for an MMIO address.

Keep the existing volatile halfword access, but move the ARMv5 definitions
into __no_kasan_or_inline functions so raw MMIO halfword accesses are not
instrumented by KASAN. The ARMv6-and-newer inline assembly path is
unchanged.

Fixes: 421015713b ("ARM: 9017/2: Enable KASan for ARM")
Cc: stable@vger.kernel.org # v5.11+
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-06-19 13:33:37 +02:00
..
alpha alpha: don't reference obsolete termio struct for TC* constants 2026-01-19 13:10:15 +01:00
arc arc: Fix __fls() const-foldability via __builtin_clzl() 2025-12-07 06:09:16 +09:00
arm ARM: 9474/1: io: avoid KASAN instrumentation of raw halfword I/O 2026-06-19 13:33:37 +02:00
arm64 arm64: tlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI 2026-06-19 13:33:35 +02:00
csky csky: fix csky_cmpxchg_fixup not working 2026-01-19 13:10:15 +01:00
h8300 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
hexagon sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
ia64 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
m68k m68k: nommu: fix memmove() with differently aligned src and dest for 68000 2026-03-04 07:20:15 -05:00
microblaze sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
mips MIPS: mm: Rewrite TLB uniquification for the hidden bit feature 2026-06-01 17:35:04 +02:00
nds32 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
nios2 nios2: ensure that memblock.current_limit is set when setting pfn limits 2025-10-29 14:03:10 +01:00
openrisc openrisc: define arch-specific version of nop() 2026-03-04 07:20:09 -05:00
parisc parisc: _llseek syscall is only available for 32-bit userspace 2026-06-01 17:35:15 +02:00
powerpc powerpc/warp: Fix error handling in pika_dtm_thread 2026-06-01 17:35:45 +02:00
riscv riscv: kgdb: fix several debug register assignment bugs 2026-04-18 10:33:31 +02:00
s390 s390/debug: Reject zero-length input before trimming a newline 2026-06-01 17:35:45 +02:00
sh sh: platform_early: remove pdev->driver_override check 2026-04-18 10:33:22 +02:00
sparc sparc: don't reference obsolete termio struct for TC* constants 2026-03-04 07:20:00 -05:00
um um: virt-pci: Fix build failure 2026-06-01 17:35:19 +02:00
x86 KVM: x86: Acquire SRCU in KVM_GET_MP_STATE to protect guest memory accesses 2026-06-01 17:35:46 +02:00
xtensa sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:24:48 +02:00