Re: [PATCH v5 04/19] x86: Add arch specific kasan functions
From: Maciej Wieczor-Retman
Date: Fri Sep 19 2025 - 07:05:23 EST
On 2025-09-18 at 17:52:39 +0200, Andrey Ryabinin wrote:
>
>On 8/25/25 10:24 PM, Maciej Wieczor-Retman wrote:
>
>> +static inline void *__tag_set(const void *__addr, u8 tag)
>> +{
>> + u64 addr = (u64)__addr;
>> +
>> + addr &= ~__tag_shifted(KASAN_TAG_MASK);
>> + addr |= __tag_shifted(tag);
>> +
>> + return (void *)addr;
>> +}
>> +
>
>
>This requires some ifdef magic to avoid getting this into vdso32 image build process,
>otherwise we'll get this warning:
>
>CC arch/x86/entry/vdso/vdso32/vclock_gettime.o
>In file included from ../arch/x86/include/asm/page.h:10,
> from ../arch/x86/include/asm/processor.h:20,
> from ../arch/x86/include/asm/timex.h:5,
> from ../include/linux/timex.h:67,
> from ../include/linux/time32.h:13,
> from ../include/linux/time.h:60,
> from ../arch/x86/entry/vdso/vdso32/../vclock_gettime.c:11,
> from ../arch/x86/entry/vdso/vdso32/vclock_gettime.c:4:
>../arch/x86/include/asm/kasan.h: In function ‘__tag_set’:
>../arch/x86/include/asm/kasan.h:81:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> 81 | u64 addr = (u64)__addr;
> | ^
>../arch/x86/include/asm/kasan.h:86:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 86 | return (void *)addr;
> | ^
>
Thanks for noticing that, I'll fix it :)
--
Kind regards
Maciej Wieczór-Retman