From nobody Mon Feb 9 19:37:19 2026 Received: from mail-24417.protonmail.ch (mail-24417.protonmail.ch [109.224.244.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CE6C44A73D for ; Tue, 20 Jan 2026 14:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.224.244.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768920095; cv=none; b=HBtIQD+hYyXvk2C8xyFaalW4uWMO7NwcWwtTlHKOdXnOFMyS6v41p93CVx/PGLSLGqRZ/GSUwWSS/lEbOyIkRY3+oPSiFu8bQRoDp2guUxcALzXr/43KFnOISRH4Hu4tcUeNuloWD7Qv7emqKP+EN1Zub3L/pN8BaY2ogpuEXfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768920095; c=relaxed/simple; bh=mpaAioP9xru6B/CFoG7LGoQcykHVJkLIzdsXpgUjdj8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PSVrMbsMPu6UkI4ZA3ZPEfEH3aCRsBYtIegunTqWKXJSfSUVeEjKfx9wW2C4ApR/czi303fwQJjphNgGqgAgl+BbeWNMtzXC81TIPurMeeiO5FjZONesV5XMGorYoyROEGHfppsl55q1deq4audjCAErcJ7Da/PohPcSUR5lbuE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=PmYwNYnj; arc=none smtp.client-ip=109.224.244.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="PmYwNYnj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1768920090; x=1769179290; bh=/QCjh1bIysDd4v5OZ14LNkObiBtwfe/ruaYSf4e0H0s=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=PmYwNYnjHnsEre5V0Q+WWJChYF2avoL+3kqOftMwwckzsmujMaXvqHZFV8Wy5wYUP mhtKCYS9nkhG3lZLKDxITWaJjl9TNA0fZFlD52WHxuUGkzdfth5H2GiPdUFNIYo1+6 fTFX4oxnh5gtQCcSyf6OSnWQiA8kA8X9B/PeydnyXtB7QczE3435d2KhzMMATCWudh dWv8Gc6g2PLzaXEaMerEHuUaj2nGiN/ziE4b1SxNDcu+zk3VpKqI4a8sTQyVtnExHD jLVudsAXXBiu4fGPAx8oOj37AcI1MjyWQEsTBdNq+PR/VqNiq+HztXJBCPIQMbEnpx mbFW/BVWDxAOg== Date: Tue, 20 Jan 2026 14:41:25 +0000 To: Nathan Chancellor , Nicolas Schier , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Nick Desaulniers , Bill Wendling , Justin Stitt From: Maciej Wieczor-Retman Cc: m.wieczorretman@pm.me, Maciej Wieczor-Retman , linux-kbuild@vger.kernel.org, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v9 03/13] kasan: Fix inline mode for x86 tag-based mode Message-ID: In-Reply-To: References: Feedback-ID: 164464600:user:proton X-Pm-Message-ID: a28f2f4e8684592b68d763d58d259d63cccf2fce Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Maciej Wieczor-Retman 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 Reviewed-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Reviewed-by: Andrey Ryabinin --- Changelog v9: - Add Andrey Ryabinin's Reviewed-by tag. Changelog v7: - Add Alexander's Reviewed-by tag. Changelog v6: - Add Andrey's Reviewed-by tag. 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 0ba2aac3b8dc..e485814df3e9 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -76,8 +76,11 @@ CFLAGS_KASAN :=3D -fsanitize=3Dkernel-hwaddress RUSTFLAGS_KASAN :=3D -Zsanitizer=3Dkernel-hwaddress \ -Zsanitizer-recover=3Dkernel-hwaddress =20 +# 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 +=3D hwasan-mapping-offset=3D$(KASAN_SHADOW_OFFSET) + kasan_params +=3D hwasan-instrument-with-calls=3D0 else kasan_params +=3D hwasan-instrument-with-calls=3D1 endif --=20 2.52.0