[PATCH v7 02/15] kasan: arm64: x86: Make special tags arch specific

Will Deacon will at kernel.org
Fri Jan 9 05:43:25 PST 2026


On Fri, Jan 09, 2026 at 01:37:49PM +0000, Maciej Wieczor-Retman wrote:
> Hi, and thanks for looking at the patches!
> 
> On 2026-01-08 at 17:56:39 +0000, Will Deacon wrote:
> >On Wed, Dec 10, 2025 at 05:28:43PM +0000, Maciej Wieczor-Retman wrote:
> >> From: Samuel Holland <samuel.holland at sifive.com>
> ...
> >> +#ifdef CONFIG_KASAN_HW_TAGS
> >> +#define KASAN_TAG_MIN		0xF0 /* minimum value for random tags */
> >> +#define KASAN_TAG_WIDTH		4
> >> +#else
> >> +#define KASAN_TAG_WIDTH		8
> >> +#endif
> >
> >Shouldn't this be 0 when KASAN is not in use at all?
> >
> >Will
> 
> This file (as well as the x86 version) gets included in
> include/linux/kasan-tags.h:
> 
> 	#if defined(CONFIG_KASAN_SW_TAGS) || defined(CONFIG_KASAN_HW_TAGS)
> 	#include <asm/kasan-tags.h>
> 	#endif
> 
> 	#ifndef KASAN_TAG_WIDTH
> 	#define KASAN_TAG_WIDTH		0
> 	#endif
> 
> So the 8 or 4 value is only assigned if SW_TAGS or HW_TAGS are enabled.
> Otherwise it's set to zero.

Thanks for the explanation, I'd missed the conditional inclusion of the
arch header.

In which case, the arm64 side looks fine to me:

Acked-by: Will Deacon <will at kernel.org>

Cheers,

Will



More information about the linux-arm-kernel mailing list