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 1B3A5281531 for ; Wed, 18 Jun 2025 09:34:52 +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=1750239293; cv=none; b=FEbrK22yRS8hOsGTLnTL1LuguQryJqXPZmKnwX57QEPPztsWaUtwrzTTQZWCAjLaq3/1C5beSRgivwXGLMb3xkU/6EbIaCFvFIKiw3SwXmAU3crw90U9mBUG5i1NFtRKmS5FhCKD6KVTJGZg1HMCVqRmD3ZEIf6J5So0IDt5ao8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750239293; c=relaxed/simple; bh=ps+XyKpODz96ZJFIb33t7gWg9JBmTLkmmol38aF6a1g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LIyrgNwCcWqDHSFR0aGF1Cpy6sc+ZJZDZzHbQwXRB2dKt8+304nX5uGUugiqbPGfE5G5Z8WWquXW7rdDHf5OwQgq3o+OVfm3goZvmAOuRoJjFo9kxpXEFr8QkdX2CyaeRDwRIVotNDs3nPiQbQZy85VT2fqlJVB3wmTut8+VO/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ebRLSMON; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ebRLSMON" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23398C4CEE7; Wed, 18 Jun 2025 09:34:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750239292; bh=ps+XyKpODz96ZJFIb33t7gWg9JBmTLkmmol38aF6a1g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ebRLSMONbrx/WEboK/2S5JSIsqLeJT4uuiuHKk4uOHHpzlsTrf2g/tA1m4H/fRi25 w2ZpO/02+BZl9PKNjXSnNZVu+WsegmM2JJxiV6Fv2QamoK8HBFQvT2quwsMVhqht8Q WZptvgErMc6FJMrKghKpE+n4utEUFltq3MqPt7g4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38033: x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST or Rust >= 1.88 Date: Wed, 18 Jun 2025 11:33:29 +0200 Message-ID: <2025061825-CVE-2025-38033-8da2@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4511; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=nEg1geyKi3ytFlRu5nyIKb9WUfTvPSg1U3AEdJURKgw=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlB7U/PTFqw8+saQcNFjDM6vybpWsVXT1/UG6TS+bGkZ sGTLyYKHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRSxcY5vDtFLzoE7YxNMzR sGXlLN/ZB25EhTMsWF6mF+2qbb5vWfUdOdGo2/M+rGbfCQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: x86/Kconfig: make CFI_AUTO_DEFAULT depend on !RUST or Rust >= 1.88 Calling core::fmt::write() from rust code while FineIBT is enabled results in a kernel panic: [ 4614.199779] kernel BUG at arch/x86/kernel/cet.c:132! [ 4614.205343] Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 4614.211781] CPU: 2 UID: 0 PID: 6057 Comm: dmabuf_dump Tainted: G U O 6.12.17-android16-0-g6ab38c534a43 #1 9da040f27673ec3945e23b998a0f8bd64c846599 [ 4614.227832] Tainted: [U]=USER, [O]=OOT_MODULE [ 4614.241247] RIP: 0010:do_kernel_cp_fault+0xea/0xf0 ... [ 4614.398144] RIP: 0010:_RNvXs5_NtNtNtCs3o2tGsuHyou_4core3fmt3num3impyNtB9_7Display3fmt+0x0/0x20 [ 4614.407792] Code: 48 f7 df 48 0f 48 f9 48 89 f2 89 c6 5d e9 18 fd ff ff 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 41 81 ea 14 61 af 2c 74 03 0f 0b 90 <66> 0f 1f 00 55 48 89 e5 48 89 f2 48 8b 3f be 01 00 00 00 5d e9 e7 [ 4614.428775] RSP: 0018:ffffb95acfa4ba68 EFLAGS: 00010246 [ 4614.434609] RAX: 0000000000000000 RBX: 0000000000000010 RCX: 0000000000000000 [ 4614.442587] RDX: 0000000000000007 RSI: ffffb95acfa4ba70 RDI: ffffb95acfa4bc88 [ 4614.450557] RBP: ffffb95acfa4bae0 R08: ffff0a00ffffff05 R09: 0000000000000070 [ 4614.458527] R10: 0000000000000000 R11: ffffffffab67eaf0 R12: ffffb95acfa4bcc8 [ 4614.466493] R13: ffffffffac5d50f0 R14: 0000000000000000 R15: 0000000000000000 [ 4614.474473] ? __cfi__RNvXs5_NtNtNtCs3o2tGsuHyou_4core3fmt3num3impyNtB9_7Display3fmt+0x10/0x10 [ 4614.484118] ? _RNvNtCs3o2tGsuHyou_4core3fmt5write+0x1d2/0x250 This happens because core::fmt::write() calls core::fmt::rt::Argument::fmt(), which currently has CFI disabled: library/core/src/fmt/rt.rs: 171 // FIXME: Transmuting formatter in new and indirectly branching to/calling 172 // it here is an explicit CFI violation. 173 #[allow(inline_no_sanitize)] 174 #[no_sanitize(cfi, kcfi)] 175 #[inline] 176 pub(super) unsafe fn fmt(&self, f: &mut Formatter<'_>) -> Result { This causes a Control Protection exception, because FineIBT has sealed off the original function's endbr64. This makes rust currently incompatible with FineIBT. Add a Kconfig dependency that prevents FineIBT from getting turned on by default if rust is enabled. [ Rust 1.88.0 (scheduled for 2025-06-26) should have this fixed [1], and thus we relaxed the condition with Rust >= 1.88. When `objtool` lands checking for this with e.g. [2], the plan is to ideally run that in upstream Rust's CI to prevent regressions early [3], since we do not control `core`'s source code. Alice tested the Rust PR backported to an older compiler. Peter would like that Rust provides a stable `core` which can be pulled into the kernel: "Relying on that much out of tree code is 'unfortunate'". - Miguel ] [ Reduced splat. - Miguel ] The Linux kernel CVE team has assigned CVE-2025-38033 to this issue. Affected and fixed versions =========================== Fixed in 6.12.31 with commit 5a8d073d87da4ad1496b35adaee5719e94665d81 Fixed in 6.14.9 with commit 6b9956d09382bcbd5fd260c4b60ec48680a4cffb Fixed in 6.15 with commit 5595c31c370957aabe739ac3996aedba8267603f Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-38033 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: arch/x86/Kconfig Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/5a8d073d87da4ad1496b35adaee5719e94665d81 https://git.kernel.org/stable/c/6b9956d09382bcbd5fd260c4b60ec48680a4cffb https://git.kernel.org/stable/c/5595c31c370957aabe739ac3996aedba8267603f