Re: [PATCH v6 08/18] x86/mm: Reset tag for virtual to physical address conversions

From: Alexander Potapenko
Date: Tue Nov 11 2025 - 04:48:39 EST


On Wed, Oct 29, 2025 at 8:07 PM Maciej Wieczor-Retman
<m.wieczorretman@xxxxx> wrote:
>
> From: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
>
> Any place where pointer arithmetic is used to convert a virtual address
> into a physical one can raise errors if the virtual address is tagged.
>
> Reset the pointer's tag by sign extending the tag bits in macros that do
> pointer arithmetic in address conversions. There will be no change in
> compiled code with KASAN disabled since the compiler will optimize the
> __tag_reset() out.
>
> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
Acked-by: Alexander Potapenko <glider@xxxxxxxxxx>