From nobody Wed Feb 11 05:07:49 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CF66B8827 for ; Wed, 1 Jan 2025 11:51:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735732303; cv=none; b=m5FmzaqN43i+3t6jiXKoGibWA2artDdpnlxUpn6jsQep8Znbsc+yEix+W0qugfpL0ibApPQbWlx/73fGAgIa0kn0lGztcDPRi/9El25NMy3DXPUSpUCtu0EqoEv8r3E2WgAKC9004yTSjxWv1ijr5BqT7l0N49xfpVD1OaR6Qew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735732303; c=relaxed/simple; bh=75N5cIMMNOuClgyYSb/oeX5emhM2vBd6Ck/Qtz4Xlo8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sLyk/1eOtTORMQpJBpOBCx/f+WwLvhC2mlf9aXWtZ1tZon8mgN5L4d0WtBh8KsKLLPABAlxC2VZgZVgDGsts8Fi6ky3xYWpVIpmgLkCRN7cB2QxzdsLRehLLrSuDVeykbW2SSlfzXYYGfbg6q5/cYx/mFP62BEMQ+AYNdRTvppg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SdoWKPIl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SdoWKPIl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12827C4CED1; Wed, 1 Jan 2025 11:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735732303; bh=75N5cIMMNOuClgyYSb/oeX5emhM2vBd6Ck/Qtz4Xlo8=; h=From:To:Cc:Subject:Date:From; b=SdoWKPIlpHmSbMWHJcmKW5gQMglS7nqkmEM0EAba8nCB/yssphFUdonrrF9drkIvC 7+oypB4HVT2gD4fKBCoidNDicyotQ1oaJWzhy+BgnV26rMfEgrKSvU+iQZ/C0Miutb TJDM6kE0qnp29IepmWGPR/ETIuSy2PmAHSkdaTFhbitXR2adfKC5UCJoB6PfFDQ7zL p6KbZg3ax2p+XSnjnSw4MMK09p0JknLhDY5QpyY/buuoDGss74yrcLCKP5PsUeDbJV BhyQwYj9sr0vCqb3Ai8J0f5pROPuwQlNAQMFnqYpKUt3At+EQRHhtLZFBffaxxIJ5g gZmDD7tUeeKKA== From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Ard Biesheuvel , Borislav Petkov , Nathan Chancellor Subject: [PATCH] x86/sev: Disable UBSAN on SEV code that may execute very early Date: Wed, 1 Jan 2025 12:51:20 +0100 Message-ID: <20250101115119.114584-2-ardb@kernel.org> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1244; i=ardb@kernel.org; h=from:subject; bh=75N5cIMMNOuClgyYSb/oeX5emhM2vBd6Ck/Qtz4Xlo8=; b=kA0DAAgWMG4JVi59LVwByyZiAGd1LDei7JPrHPyMC+78GxuNONTyr0XZEoNlULRsTXJanyyhy Yh1BAAWCAAdFiEEEJv97rnLkRp9Q5odMG4JVi59LVwFAmd1LDcACgkQMG4JVi59LVyY+AD/cj9r h4rAjbSNcxkPkq9m2UtJX8KlB+GZGN6v1ll+Lz8A/RrFY9KkghY1KVweRqHcUhMIHjZeh5glNZp iES69ElgG X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Clang 14 and older may emit UBSAN instrumentation into code that is inlined into functions marked with __no_sanitize_undefined. This may result in faults when the code is executed very early, which may be the case for functions annotated as __head. Now that this requirement is strictly enforced, the build will fail in this case with the following message Absolute reference to symbol '.data' not permitted in .head.text Work around this by disabling UBSAN instrumentation on all SEV core code. Cc: Borislav Petkov Cc: Nathan Chancellor Signed-off-by: Ard Biesheuvel Reviewed-by: Nathan Chancellor --- arch/x86/coco/sev/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/coco/sev/Makefile b/arch/x86/coco/sev/Makefile index 4e375e7305ac..08de37559307 100644 --- a/arch/x86/coco/sev/Makefile +++ b/arch/x86/coco/sev/Makefile @@ -13,3 +13,6 @@ KCOV_INSTRUMENT_core.o :=3D n # With some compiler versions the generated code results in boot hangs, ca= used # by several compilation units. To be safe, disable all instrumentation. KCSAN_SANITIZE :=3D n + +# Clang 14 and older may fail to respect __no_sanitize_undefined when inli= ning +UBSAN_SANITIZE :=3D n --=20 2.45.2