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

From: Maciej Wieczor-Retman
Date: Fri Jan 09 2026 - 08:44:17 EST


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@xxxxxxxxxx>
...
>> +#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.

--
Kind regards
Maciej Wieczór-Retman