lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <rmj3ffo2cwt26jaiqglz6cahlrqqy76ye47wjdv4xn22nar6mp@7vg5okkq7kjj>
Date: Tue, 25 Feb 2025 16:39:15 +0100
From: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
To: Andrey Konovalov <andreyknvl@...il.com>
CC: <kees@...nel.org>, <julian.stecklina@...erus-technology.de>,
	<kevinloughlin@...gle.com>, <peterz@...radead.org>, <tglx@...utronix.de>,
	<justinstitt@...gle.com>, <catalin.marinas@....com>,
	<wangkefeng.wang@...wei.com>, <bhe@...hat.com>, <ryabinin.a.a@...il.com>,
	<kirill.shutemov@...ux.intel.com>, <will@...nel.org>, <ardb@...nel.org>,
	<jason.andryuk@....com>, <dave.hansen@...ux.intel.com>,
	<pasha.tatashin@...een.com>, <ndesaulniers@...gle.com>,
	<guoweikang.kernel@...il.com>, <dwmw@...zon.co.uk>, <mark.rutland@....com>,
	<broonie@...nel.org>, <apopple@...dia.com>, <bp@...en8.de>,
	<rppt@...nel.org>, <kaleshsingh@...gle.com>, <richard.weiyang@...il.com>,
	<luto@...nel.org>, <glider@...gle.com>, <pankaj.gupta@....com>,
	<pawan.kumar.gupta@...ux.intel.com>, <kuan-ying.lee@...onical.com>,
	<tony.luck@...el.com>, <tj@...nel.org>, <jgross@...e.com>,
	<dvyukov@...gle.com>, <baohua@...nel.org>, <samuel.holland@...ive.com>,
	<dennis@...nel.org>, <akpm@...ux-foundation.org>,
	<thomas.weissschuh@...utronix.de>, <surenb@...gle.com>,
	<kbingham@...nel.org>, <ankita@...dia.com>, <nathan@...nel.org>,
	<ziy@...dia.com>, <xin@...or.com>, <rafael.j.wysocki@...el.com>,
	<andriy.shevchenko@...ux.intel.com>, <cl@...ux.com>, <jhubbard@...dia.com>,
	<hpa@...or.com>, <scott@...amperecomputing.com>, <david@...hat.com>,
	<jan.kiszka@...mens.com>, <vincenzo.frascino@....com>, <corbet@....net>,
	<maz@...nel.org>, <mingo@...hat.com>, <arnd@...db.de>, <ytcoode@...il.com>,
	<xur@...gle.com>, <morbo@...gle.com>, <thiago.bauermann@...aro.org>,
	<linux-doc@...r.kernel.org>, <kasan-dev@...glegroups.com>,
	<linux-kernel@...r.kernel.org>, <llvm@...ts.linux.dev>, <linux-mm@...ck.org>,
	<linux-arm-kernel@...ts.infradead.org>, <x86@...nel.org>
Subject: Re: [PATCH v2 14/14] x86: Make software tag-based kasan available

On 2025-02-22 at 16:06:34 +0100, Andrey Konovalov wrote:
>On Fri, Feb 21, 2025 at 3:45 PM Maciej Wieczor-Retman
><maciej.wieczor-retman@...el.com> wrote:
>>
>> >What's the purpose of this config option? I think we can just change
>> >the value of the KASAN_SHADOW_SCALE_SHIFT define when KASAN_SW_TAGS is
>> >enabled.
>>
>> Well, I was aiming at later adding the "default 5 if KASAN_SW_TAGS_DENSE", and
>> this way it would look much cleaner than the:
>>
>> if KASAN_SW_TAGS
>>         if KASAN_SW_TAGS_DENSE
>>                 KASAN_SHADOW_SCALE_SHIFT = 5
>>         else
>>                 KASAN_SHADOW_SCALE_SHIFT = 4
>> else
>>         KASAN_SHADOW_SCALE_SHIFT = 3
>
>I think this is fine. It's still better than adding a non-configurable
>config option.
>
>> But now that I think of it, it should be possible to overwrite the
>> KASAN_SHADOW_SCALE_SHIFT from non-arch code if dense mode is enabled.
>
>This should also work. Especially since the dense mode will probably
>work for arm64 as well.
>
>But let's keep this series self-contained.

Yes, of course. Anyway I'll just do one preprocessor if else in the same place
that the old x86 KASAN_SHADOW_SCALE_SHIFT was.

>
>> That's a topic for the next series but I'd imagine all architectures would
>> normally use the 16 memory bytes / shadow byte and if they'd care for the dense
>> mode they'd go for 32 memory bytes / shadow byte. Or do you think that's a
>> faulty assumption?
>
>Probably, but for sure I don't know, not that many architectures that
>care about memory tagging yet :)

I'll keep this assumption for now then. If some arch will have a different idea
about granularity I suppose the relevant code can be moved to arch specific
directories.

-- 
Kind regards
Maciej Wieczór-Retman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ