From nobody Mon Feb 9 16:53:02 2026 Received: from mail-43102.protonmail.ch (mail-43102.protonmail.ch [185.70.43.102]) (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 BEF6E37C0E7; Mon, 12 Jan 2026 17:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768238871; cv=none; b=ROuqnZcrIe7VOuSR/1/TgRn8FAYOuQU7vruV8QMpPpJBWHif7iZcOqKFVx4ITvxmI3/Qjdeu6nIZWK2Wr54jM49+n9TRWRbD0LDocqfsnrBq5lF/Uvy9JArchCaTuky6xBkdqTvY1dF5HJonWw0BkE20jJvQLSSpKxAgVKHffrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768238871; c=relaxed/simple; bh=MOW+FEXSkjqoA9gO0vl1FWTSXtEjOD+DXsStw9lDKJE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a1hFlCXw/8cr/nKoB22SmBfypo76nCPY+1XSieNII+ds7O6bTM3tvdzGQXHW9uCjK0ydUzCUoa8HFoGhKXQPplzPjHlP2IdCdevQvkMvC5xDRP7tP/NkfnDBrQZRmaNihHznjzNKI2PsOSsIw3VzIV1GYPcxWri/jhpeg8qFYm4= 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=rp7WD2hz; arc=none smtp.client-ip=185.70.43.102 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="rp7WD2hz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1768238858; x=1768498058; bh=i82hVLnXXbAVfgARSkNfTSungiQEgJywgSx/RsX/wSc=; 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=rp7WD2hzYG+/fEcnXAYWwaq16gfF91DR+4hlcwz8ePNMqLJeSviu3xQH6/dUjJIMC wkHKU+oTtl5PB8Tj6vu9LfKAfpWhuGldwh34+z9y6Qj4+000LRC6/50Ql4la2bIkqE moV4n0OMJbVFFztW4DV/NDkKTe2rhGZceMaYYCt0IgIRJ2y2eaMHDS9AvH+hQKG3fM hx+9cipW/u/ZlCnCIbDrzrOVhwWgs7OvfA8jTsRDKcrgWz26fF13DYVu4jeI+vFIWK pk/KfdqXsbXP3S0Nf9IgwlDxQjtOSPLXlMP8bj4gEzq1VF1IF4N9fQiSYWtOVpN4LD 1qbso/EPHZzHQ== Date: Mon, 12 Jan 2026 17:27:35 +0000 To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt From: Maciej Wieczor-Retman Cc: m.wieczorretman@pm.me, Maciej Wieczor-Retman , kasan-dev@googlegroups.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v8 03/14] kasan: Fix inline mode for x86 tag-based mode Message-ID: <1598e2bb7d45902fb0dc4d0d8e218f61b0c1a0f6.1768233085.git.m.wieczorretman@pm.me> In-Reply-To: References: Feedback-ID: 164464600:user:proton X-Pm-Message-ID: ca3467c5c544f1474f2a10b1278334b95255c44c 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 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