Re: [PATCH v2 3/3] mm: skip KASAN tagging for page-allocated page tables
From: David Hildenbrand (Arm)
Date: Thu Apr 16 2026 - 04:57:10 EST
On 3/24/26 14:26, Muhammad Usama Anjum wrote:
> Page tables are always accessed via the linear mapping with a match-all
> tag, so HW-tag KASAN never checks them. For page-allocated tables (PTEs
> and PGDs etc), avoid the tag setup and poisoning overhead by using
> __GFP_SKIP_KASAN. SLUB-backed page tables are unchanged for now. (They
> aren't widely used and require more SLUB related skip logic. Leave it
> later.)
>
> Reviewed-by: Ryan Roberts <ryan.roberts@xxxxxxx>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxx>
> ---
> Changes since v1:
> - Update description to mention SLUB-backed page tables are unchanged
> ---
> include/asm-generic/pgalloc.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/asm-generic/pgalloc.h b/include/asm-generic/pgalloc.h
> index 57137d3ac1592..051aa1331051c 100644
> --- a/include/asm-generic/pgalloc.h
> +++ b/include/asm-generic/pgalloc.h
> @@ -4,7 +4,7 @@
>
> #ifdef CONFIG_MMU
>
> -#define GFP_PGTABLE_KERNEL (GFP_KERNEL | __GFP_ZERO)
> +#define GFP_PGTABLE_KERNEL (GFP_KERNEL | __GFP_ZERO | __GFP_SKIP_KASAN)
> #define GFP_PGTABLE_USER (GFP_PGTABLE_KERNEL | __GFP_ACCOUNT)
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David