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: <CA+fCnZeUvsvGy02k4zQwkGUkL7KbuLzah5XC7kp1m5uwp4bPVg@mail.gmail.com>
Date: Sat, 6 Sep 2025 19:17:36 +0200
From: Andrey Konovalov <andreyknvl@...il.com>
To: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
Cc: sohil.mehta@...el.com, baohua@...nel.org, david@...hat.com, 
	kbingham@...nel.org, weixugc@...gle.com, Liam.Howlett@...cle.com, 
	alexandre.chartre@...cle.com, kas@...nel.org, mark.rutland@....com, 
	trintaeoitogc@...il.com, axelrasmussen@...gle.com, yuanchu@...gle.com, 
	joey.gouly@....com, samitolvanen@...gle.com, joel.granados@...nel.org, 
	graf@...zon.com, vincenzo.frascino@....com, kees@...nel.org, ardb@...nel.org, 
	thiago.bauermann@...aro.org, glider@...gle.com, thuth@...hat.com, 
	kuan-ying.lee@...onical.com, pasha.tatashin@...een.com, 
	nick.desaulniers+lkml@...il.com, vbabka@...e.cz, kaleshsingh@...gle.com, 
	justinstitt@...gle.com, catalin.marinas@....com, 
	alexander.shishkin@...ux.intel.com, samuel.holland@...ive.com, 
	dave.hansen@...ux.intel.com, corbet@....net, xin@...or.com, 
	dvyukov@...gle.com, tglx@...utronix.de, scott@...amperecomputing.com, 
	jason.andryuk@....com, morbo@...gle.com, nathan@...nel.org, 
	lorenzo.stoakes@...cle.com, mingo@...hat.com, brgerst@...il.com, 
	kristina.martsenko@....com, bigeasy@...utronix.de, luto@...nel.org, 
	jgross@...e.com, jpoimboe@...nel.org, urezki@...il.com, mhocko@...e.com, 
	ada.coupriediaz@....com, hpa@...or.com, leitao@...ian.org, 
	peterz@...radead.org, wangkefeng.wang@...wei.com, surenb@...gle.com, 
	ziy@...dia.com, smostafa@...gle.com, ryabinin.a.a@...il.com, 
	ubizjak@...il.com, jbohac@...e.cz, broonie@...nel.org, 
	akpm@...ux-foundation.org, guoweikang.kernel@...il.com, rppt@...nel.org, 
	pcc@...gle.com, jan.kiszka@...mens.com, nicolas.schier@...ux.dev, 
	will@...nel.org, jhubbard@...dia.com, bp@...en8.de, x86@...nel.org, 
	linux-doc@...r.kernel.org, linux-mm@...ck.org, llvm@...ts.linux.dev, 
	linux-kbuild@...r.kernel.org, kasan-dev@...glegroups.com, 
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v5 03/19] kasan: Fix inline mode for x86 tag-based mode

On Mon, Aug 25, 2025 at 10:26 PM Maciej Wieczor-Retman
<maciej.wieczor-retman@...el.com> wrote:
>
> The LLVM compiler uses hwasan-instrument-with-calls parameter to setup
> inline or outline mode in tag-based KASAN. If zeroed, it means the
> instrumentation implementation will be pasted into each relevant
> location along with KASAN related constants during compilation. If set
> to one all function instrumentation will be done with function calls
> instead.
>
> The default hwasan-instrument-with-calls value for the x86 architecture
> in the compiler is "1", which is not true for other architectures.
> Because of this, enabling inline mode in software tag-based KASAN
> doesn't work on x86 as the kernel script doesn't zero out the parameter
> and always sets up the outline mode.
>
> Explicitly zero out hwasan-instrument-with-calls when enabling inline
> mode in tag-based KASAN.
>
> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
> ---
> Changelog v3:
> - Add this patch to the series.
>
>  scripts/Makefile.kasan | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
> index 693dbbebebba..2c7be96727ac 100644
> --- a/scripts/Makefile.kasan
> +++ b/scripts/Makefile.kasan
> @@ -76,8 +76,11 @@ CFLAGS_KASAN := -fsanitize=kernel-hwaddress
>  RUSTFLAGS_KASAN := -Zsanitizer=kernel-hwaddress \
>                    -Zsanitizer-recover=kernel-hwaddress
>
> +# LLVM sets hwasan-instrument-with-calls to 1 on x86 by default. Set it to 0
> +# when inline mode is enabled.
>  ifdef CONFIG_KASAN_INLINE
>         kasan_params += hwasan-mapping-offset=$(KASAN_SHADOW_OFFSET)
> +       kasan_params += hwasan-instrument-with-calls=0
>  else
>         kasan_params += hwasan-instrument-with-calls=1
>  endif
> --
> 2.50.1
>

Reviewed-by: Andrey Konovalov <andreyknvl@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ