[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9841bb2-b82a-4daf-99fa-17aec157e2c2@gmail.com>
Date: Fri, 16 Jan 2026 14:32:49 +0100
From: Andrey Ryabinin <ryabinin.a.a@...il.com>
To: Maciej Wieczor-Retman <m.wieczorretman@...me>,
Alexander Potapenko <glider@...gle.com>,
Andrey Konovalov <andreyknvl@...il.com>, Dmitry Vyukov <dvyukov@...gle.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
Thomas Gleixner <tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...nel.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Vlastimil Babka
<vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>
Cc: Samuel Holland <samuel.holland@...ive.com>,
Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>,
linux-kernel@...r.kernel.org, kasan-dev@...glegroups.com,
linux-arm-kernel@...ts.infradead.org, linux-mm@...ck.org
Subject: Re: [PATCH v8 02/14] kasan: arm64: x86: Make special tags arch
specific
On 1/12/26 6:27 PM, Maciej Wieczor-Retman wrote:
> From: Samuel Holland <samuel.holland@...ive.com>
>
> KASAN's tag-based mode defines multiple special tag values. They're
> reserved for:
> - Native kernel value. On arm64 it's 0xFF and it causes an early return
> in the tag checking function.
> - Invalid value. 0xFE marks an area as freed / unallocated. It's also
> the value that is used to initialize regions of shadow memory.
> - Min and max values. 0xFD is the highest value that can be randomly
> generated for a new tag. 0 is the minimal value with the exception of
> arm64's hardware mode where it is equal to 0xF0.
>
> Metadata macro is also defined:
> - Tag width equal to 8.
>
> Tag-based mode on x86 is going to use 4 bit wide tags so all the above
> values need to be changed accordingly.
>
> Make tag width and native kernel tag arch specific for x86 and arm64.
>
> Base the invalid tag value and the max value on the native kernel tag
> since they follow the same pattern on both mentioned architectures.
>
> Also generalize KASAN_SHADOW_INIT and 0xff used in various
> page_kasan_tag* helpers.
>
> Give KASAN_TAG_MIN the default value of zero, and move the special value
> for hw_tags arm64 to its arch specific kasan-tags.h.
>
> Signed-off-by: Samuel Holland <samuel.holland@...ive.com>
> Co-developed-by: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
> Acked-by: Will Deacon <will@...nel.org> (for the arm part)
> ---
Reviewed-by: Andrey Ryabinin <ryabinin.a.a@...il.com>
Powered by blists - more mailing lists