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 477B825D8E1 for ; Tue, 20 May 2025 15:23:04 +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=1747754585; cv=none; b=kOEOEOFjWYDOFu0gBuQ+n+FJKYhG2bPLxQqBPXbBrsQgD9GnG8OsDmDUm67evyLR80fIMD+cHvuTWVp/9NX3opSMuz+MvEHD2DwZmkPXjD5b3ZmH2DOaFPbikk7iiUu8cODCSkJD7/RfUD3OJN/kepoDguplJMRreQDsZdkf1hg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747754585; c=relaxed/simple; bh=uRUcqwRFB803GKBqhm7NOi6BscbkIcuHbl27CHo5f/c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=K+2+YIwXfcfxDKx9vlwnBwmkvu4dfmuv9+BCagx22W9jCe2W+8oGdzaQJcDeQvD2Xv5kkXvHFcWKGcel4vueuOxY+fIMGAgyx+rbq8hlCTI8XhSg9Rre4BedM5st0r8cGZNtXaBZu9gy/CGlwTq+j7MGDH1CJVptPLMy2BdEMe0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gAFPPj1u; 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="gAFPPj1u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 505AEC4CEE9; Tue, 20 May 2025 15:23:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747754584; bh=uRUcqwRFB803GKBqhm7NOi6BscbkIcuHbl27CHo5f/c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=gAFPPj1u89MDXoJvQuvRy5fNXGkjsuMiMVlcYZIwhFgdxeD3zZERArXl9OgZTaJES dTXYOtFYtBS6/9ciJwBIvchwAgLHsVkyiFKdOwE6S9k3/nbfZQK3NiFLqEq8Zn8qX9 39FYoNmJj1q06SaA+wWPEdh1z8Y/41U0BGmf5YiU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-37896: spi: spi-mem: Add fix to avoid divide error Date: Tue, 20 May 2025 17:21:53 +0200 Message-ID: <2025052053-CVE-2025-37896-d623@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=2811; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pNhT8yBNjF3PSZylEE6hXXZBWiNHNdcBFM6btv7fovg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBk684Tm6IcqmYl3+P3y/etWr5yrncwyPWbm+bTFTUv4d R6ce32wI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbSx82woJWJ21XUXWOB36kv FY4rI9LD+j3EGeaK7J5vfLPY4OOVGXkxs+fdfye1d/pNAA== 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: spi: spi-mem: Add fix to avoid divide error For some SPI flash memory operations, dummy bytes are not mandatory. For example, in Winbond SPINAND flash memory devices, the `write_cache` and `update_cache` operation variants have zero dummy bytes. Calculating the duration for SPI memory operations with zero dummy bytes causes a divide error when `ncycles` is calculated in the spi_mem_calc_op_duration(). Add changes to skip the 'ncylcles' calculation for zero dummy bytes. Following divide error is fixed by this change: Oops: divide error: 0000 [#1] PREEMPT SMP NOPTI ... ? do_trap+0xdb/0x100 ? do_error_trap+0x75/0xb0 ? spi_mem_calc_op_duration+0x56/0xb0 ? exc_divide_error+0x3b/0x70 ? spi_mem_calc_op_duration+0x56/0xb0 ? asm_exc_divide_error+0x1b/0x20 ? spi_mem_calc_op_duration+0x56/0xb0 ? spinand_select_op_variant+0xee/0x190 [spinand] spinand_match_and_init+0x13e/0x1a0 [spinand] spinand_manufacturer_match+0x6e/0xa0 [spinand] spinand_probe+0x357/0x7f0 [spinand] ? kernfs_activate+0x87/0xd0 spi_mem_probe+0x7a/0xb0 spi_probe+0x7d/0x130 The Linux kernel CVE team has assigned CVE-2025-37896 to this issue. Affected and fixed versions =========================== Issue introduced in 6.14 with commit 226d6cb3cb799aae46d0dd19a521133997d9db11 and fixed in 6.14.6 with commit 1915dbd67dadc0bb35670c8e28229baa29368d17 Issue introduced in 6.14 with commit 226d6cb3cb799aae46d0dd19a521133997d9db11 and fixed in 6.15-rc5 with commit 8e4d3d8a5e51e07bd0d6cdd81b5e4af79f796927 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-37896 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/spi/spi-mem.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/1915dbd67dadc0bb35670c8e28229baa29368d17 https://git.kernel.org/stable/c/8e4d3d8a5e51e07bd0d6cdd81b5e4af79f796927