Re: [PATCH 0/3] KASAN: HW_TAGS: Disable tagging for stack and page-tables
From: Andrew Morton
Date: Thu Mar 19 2026 - 23:11:06 EST
On Thu, 19 Mar 2026 11:49:43 +0000 Muhammad Usama Anjum <usama.anjum@xxxxxxx> wrote:
> Stacks and page tables are always accessed with the match‑all tag,
> so assigning a new random tag every time at allocation and setting
> invalid tag at deallocation time, just adds overhead without improving
> the detection.
>
> With __GFP_SKIP_KASAN the page keeps its poison tag and KASAN_TAG_KERNEL
> (match-all tag) is stored in the page flags while keeping the poison tag
> in the hardware. The benefit of it is that 256 tag setting instruction
> per 4 kB page aren't needed at allocation and deallocation time.
>
> Thus match‑all pointers still work, while non‑match tags (other than
> poison tag) still fault.
>
> __GFP_SKIP_KASAN only skips for KASAN_HW_TAGS mode, so coverage is
> unchanged.
>
Some questions from Sashiko:
https://sashiko.dev/#/patchset/20260319114952.3241359-1-usama.anjum%40arm.com