[PATCH 0/2] kselftest: Make MTE memory access robust

Catalin Marinas catalin.marinas at arm.com
Tue Oct 6 15:56:08 PDT 2026


On Tue, 22 Sep 2026 11:59:57 +0100, Vladimir Murzin wrote:
> Currently MTE selftests assume that they can skip (expected) MTE
> faults by advancing the PC by 4 in mte_default_handler(), but this is
> not generally safe, as the faults are triggered from arbitrary library
> functions (e.g. memset() and memcpy()). For instance, memset() could
> be implemented as simple as:
> 
>       mov   x3, x0       // copy pointer
>       add   x4, x0, x2   // calculate end
>     loop:
>       strb  w1, [x3], #1 // faulting access
>       cmp   x3, x4
>       b.ne  loop
>       ret
> 
> [...]

Applied to arm64 (for-next/kselftest), thanks!

[1/2] kselftest/arm64/mte: Introduce MTE safe memory accessors
      https://git.kernel.org/arm64/c/1cd024f3f6ae
[2/2] kselftest/arm64/mte: Use MTE safe memory accessors
      https://git.kernel.org/arm64/c/9f7af3cf5cc7



More information about the linux-arm-kernel mailing list