Re: [PATCH v6 06/18] x86/kasan: Add arch specific kasan functions
From: Maciej Wieczór-Retman
Date: Tue Nov 18 2025 - 10:55:14 EST
On 2025-11-17 at 18:41:35 +0000, Maciej Wieczór-Retman wrote:
>On 2025-11-11 at 10:31:13 +0100, Alexander Potapenko wrote:
>>> +#ifdef CONFIG_64BIT
>>> +static inline void *__tag_set(const void *__addr, u8 tag)
>>> +{
>>> + u64 addr = (u64)__addr;
>>> +
>>> + addr &= ~__tag_shifted(KASAN_TAG_MASK);
>>
>>KASAN_TAG_MASK is only defined in Patch 07, does this patch compile?
>
>Seems I forgot to remove it from patch 7. It's originally defined
>in the mmzone.h file and looked cleaner there according to Andrey.
>
>Thanks for noticing it's still in patch 7, I'll get rid of it.
You were right before, after removing that define in patch 7 it doesn't
compile. I think I'll just open code this definition here:
>>> + addr &= ~__tag_shifted((1UL << KASAN_TAG_WIDTH) - 1);
I don't see a nicer solution here if taking things from mmzone.h is out
of the question. I suppose a #ifndef KASAN_TAG_MASK placed here that
would just shadow the one in mmzone.h could work too?