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 450F7216E32 for ; Wed, 1 Oct 2025 07:47:19 +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=1759304840; cv=none; b=CmHY8K02whU4IQnMzn1k7aKeAGSxJwgsc+T18x0zBnjgGiDLdClAMFvD9rDfFZn9J2BQpkzIkwAcknsh06q5/nzjnriDK25c+i6tHHQrR3iHUo9LX/SKhzeavgjPWDPDLgsWlznksBp3wrR3QCNwmQmhGKFrH19NrrErAo5JloQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759304840; c=relaxed/simple; bh=zbb77AVvPcb/HKtUshOYThckUbT+bX7IQYPsks7k0vg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JZXieW9TEcp+GhMLwTfF0WH10jIiINae+RhWQbLV4vVi9RnNY2hIRuCznGVZftrLThcT/gkwUg/z6F1WrcgEI3Ogu58f07Ty5DJ3ef/U8OL1ixAc5LBiTxPo5jcQPMzP8j9biyu0IvTd2a0nRm7tSAi9h2M+VoCv11OHQ51b3To= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=d6Koh3g3; 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="d6Koh3g3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53BA6C4CEF4; Wed, 1 Oct 2025 07:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759304839; bh=zbb77AVvPcb/HKtUshOYThckUbT+bX7IQYPsks7k0vg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=d6Koh3g371FRTGjoN8cEiKgauERh4R7zIN5GIbRrPwrdv0wrnUw5lMX7sf+RyWghM o17akoT3+OFasIhe8E2tm5fgcT4vmx5na+dvoqI8HmpbOarOrqznT+sn89GvxrVNkw +sPzPytpii5UmN5arbzAjG5XCoMZSGAoSueneRwY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39904: arm64: kexec: initialize kexec_buf struct in load_other_segments() Date: Wed, 1 Oct 2025 09:47:09 +0200 Message-ID: <2025100108-CVE-2025-39904-77a6@gregkh> X-Mailer: git-send-email 2.51.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=3412; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=r2SE9qfUGvtn1pZ2tfBQP0fZB5Efa7bdzbaJdw4FvWY=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl37tR8vD25nzFtb7memcrH4vPC0San9KQT5Ll4C0IvK TX0JSl2xLIwCDIxyIopsnzZxnN0f8UhRS9D29Mwc1iZQIYwcHEKwEQkExjmislsd7k4zXByjeEO w70nDU+/VDvrx7BgopO1bfiKvL237nsozvmjsr5XZf5uAA== 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: arm64: kexec: initialize kexec_buf struct in load_other_segments() Patch series "kexec: Fix invalid field access". The kexec_buf structure was previously declared without initialization. commit bf454ec31add ("kexec_file: allow to place kexec_buf randomly") added a field that is always read but not consistently populated by all architectures. This un-initialized field will contain garbage. This is also triggering a UBSAN warning when the uninitialized data was accessed: ------------[ cut here ]------------ UBSAN: invalid-load in ./include/linux/kexec.h:210:10 load of value 252 is not a valid value for type '_Bool' Zero-initializing kexec_buf at declaration ensures all fields are cleanly set, preventing future instances of uninitialized memory being used. An initial fix was already landed for arm64[0], and this patchset fixes the problem on the remaining arm64 code and on riscv, as raised by Mark. Discussions about this problem could be found at[1][2]. This patch (of 3): The kexec_buf structure was previously declared without initialization. commit bf454ec31add ("kexec_file: allow to place kexec_buf randomly") added a field that is always read but not consistently populated by all architectures. This un-initialized field will contain garbage. This is also triggering a UBSAN warning when the uninitialized data was accessed: ------------[ cut here ]------------ UBSAN: invalid-load in ./include/linux/kexec.h:210:10 load of value 252 is not a valid value for type '_Bool' Zero-initializing kexec_buf at declaration ensures all fields are cleanly set, preventing future instances of uninitialized memory being used. The Linux kernel CVE team has assigned CVE-2025-39904 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit bf454ec31add6790f6cdc88328e38901fcbbade6 and fixed in 6.16.8 with commit 340cc9a3bd30b25edaf6a9708d41b5f2c10a054a Issue introduced in 6.16 with commit bf454ec31add6790f6cdc88328e38901fcbbade6 and fixed in 6.17 with commit 04d3cd43700a2d0fe4bfb1012a8ec7f2e34a3507 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-39904 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/arm64/kernel/machine_kexec_file.c 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/340cc9a3bd30b25edaf6a9708d41b5f2c10a054a https://git.kernel.org/stable/c/04d3cd43700a2d0fe4bfb1012a8ec7f2e34a3507