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 99D8F233D85 for ; Wed, 12 Mar 2025 09:43: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=1741772599; cv=none; b=n5r/9Z/8WQfgWQfRrLOSFJrTX/s/rwI5G2o27DCADCgIDn+Vl3yiN6jSMbml8YOp6bWowQSpP4ZedW5z79QnFhVdeNm5JXx91aKtmosJ4uvBCaZwBM/BYzIyiczEQahXTB1vGBHMJOWbyKONGv4HCPXVEQSxm7aPJ2KiUax4KKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741772599; c=relaxed/simple; bh=606HgK3L+c0gHr2JnuAeqFfzXDtlz6TSNbBctV47cSc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sgWbVuiGWRST7XIZRpmae3CP6XHIUUV2ITnRgOdRJi40BxnRlBqWKAYuW0iB1aPyMs9ORyLT6Ro/JLbAOYa9UJoNEol0Q+U9aCYFJ/Ew3kSa22QfaTvgXwaCJ0eYdXH33QwvXp78u4QW4BNXpQF+GfwDjdeAfhBXZmZngE3kUTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XrpE3Wmf; 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="XrpE3Wmf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 226E6C4CEEF; Wed, 12 Mar 2025 09:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741772599; bh=606HgK3L+c0gHr2JnuAeqFfzXDtlz6TSNbBctV47cSc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XrpE3Wmf+XJSf4stiD//RGXEtc8cmvN9BNzpgXeGAQCujSTgYc1NJ1UDtv/pdPCHy oZiKIFCz9cT2mD3yuUNDT/9vC3faTZz/7wZFtAfHAQgVyAnFIS3K1As34QF85vRQW6 hMelI/26F84AFPDe2Vekd9eCWWlskBdtWo2pKpxI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21845: mtd: spi-nor: sst: Fix SST write failure Date: Wed, 12 Mar 2025 10:42:11 +0100 Message-ID: <2025031211-CVE-2025-21845-66d5@gregkh> X-Mailer: git-send-email 2.48.1 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=4592; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=606HgK3L+c0gHr2JnuAeqFfzXDtlz6TSNbBctV47cSc=; b=owGbwMvMwCRo6H6F97bub03G02pJDOkXwz4v7VycF/nqjGjlFrOQKLYE+5mdQY6nr65hnyA02 eSL7QLljlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjI0fMMc7jNt79s7ZZYH3qY 49iPoIe3HosaCzLMU+B/fmCVy4ymq/MO2lddbbo/5fvtXgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: mtd: spi-nor: sst: Fix SST write failure 'commit 18bcb4aa54ea ("mtd: spi-nor: sst: Factor out common write operation to `sst_nor_write_data()`")' introduced a bug where only one byte of data is written, regardless of the number of bytes passed to sst_nor_write_data(), causing a kernel crash during the write operation. Ensure the correct number of bytes are written as passed to sst_nor_write_data(). Call trace: [ 57.400180] ------------[ cut here ]------------ [ 57.404842] While writing 2 byte written 1 bytes [ 57.409493] WARNING: CPU: 0 PID: 737 at drivers/mtd/spi-nor/sst.c:187 sst_nor_write_data+0x6c/0x74 [ 57.418464] Modules linked in: [ 57.421517] CPU: 0 UID: 0 PID: 737 Comm: mtd_debug Not tainted 6.12.0-g5ad04afd91f9 #30 [ 57.429517] Hardware name: Xilinx Versal A2197 Processor board revA - x-prc-02 revA (DT) [ 57.437600] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 57.444557] pc : sst_nor_write_data+0x6c/0x74 [ 57.448911] lr : sst_nor_write_data+0x6c/0x74 [ 57.453264] sp : ffff80008232bb40 [ 57.456570] x29: ffff80008232bb40 x28: 0000000000010000 x27: 0000000000000001 [ 57.463708] x26: 000000000000ffff x25: 0000000000000000 x24: 0000000000000000 [ 57.470843] x23: 0000000000010000 x22: ffff80008232bbf0 x21: ffff000816230000 [ 57.477978] x20: ffff0008056c0080 x19: 0000000000000002 x18: 0000000000000006 [ 57.485112] x17: 0000000000000000 x16: 0000000000000000 x15: ffff80008232b580 [ 57.492246] x14: 0000000000000000 x13: ffff8000816d1530 x12: 00000000000004a4 [ 57.499380] x11: 000000000000018c x10: ffff8000816fd530 x9 : ffff8000816d1530 [ 57.506515] x8 : 00000000fffff7ff x7 : ffff8000816fd530 x6 : 0000000000000001 [ 57.513649] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000 [ 57.520782] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0008049b0000 [ 57.527916] Call trace: [ 57.530354] sst_nor_write_data+0x6c/0x74 [ 57.534361] sst_nor_write+0xb4/0x18c [ 57.538019] mtd_write_oob_std+0x7c/0x88 [ 57.541941] mtd_write_oob+0x70/0xbc [ 57.545511] mtd_write+0x68/0xa8 [ 57.548733] mtdchar_write+0x10c/0x290 [ 57.552477] vfs_write+0xb4/0x3a8 [ 57.555791] ksys_write+0x74/0x10c [ 57.559189] __arm64_sys_write+0x1c/0x28 [ 57.563109] invoke_syscall+0x54/0x11c [ 57.566856] el0_svc_common.constprop.0+0xc0/0xe0 [ 57.571557] do_el0_svc+0x1c/0x28 [ 57.574868] el0_svc+0x30/0xcc [ 57.577921] el0t_64_sync_handler+0x120/0x12c [ 57.582276] el0t_64_sync+0x190/0x194 [ 57.585933] ---[ end trace 0000000000000000 ]--- [pratyush@kernel.org: add Cc stable tag] The Linux kernel CVE team has assigned CVE-2025-21845 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit 18bcb4aa54eab75dce41e5c176a1c2bff94f0f79 and fixed in 6.12.17 with commit bb1accc7e0f688886f0c634f2e878b8ac4ee6a58 Issue introduced in 6.12 with commit 18bcb4aa54eab75dce41e5c176a1c2bff94f0f79 and fixed in 6.13.5 with commit 9553391f32f8c43e12fc7c04e1035160b5ea20bf Issue introduced in 6.12 with commit 18bcb4aa54eab75dce41e5c176a1c2bff94f0f79 and fixed in 6.14-rc4 with commit 539bd20352832b9244238a055eb169ccf1c41ff6 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-21845 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: drivers/mtd/spi-nor/sst.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/bb1accc7e0f688886f0c634f2e878b8ac4ee6a58 https://git.kernel.org/stable/c/9553391f32f8c43e12fc7c04e1035160b5ea20bf https://git.kernel.org/stable/c/539bd20352832b9244238a055eb169ccf1c41ff6