CVE-2025-37896

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-37896
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-37896.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-37896
Downstream
Published
2025-05-20T15:21:32Z
Modified
2025-10-10T10:03:54.968884Z
Summary
spi: spi-mem: Add fix to avoid divide error
Details

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 spimemcalcopduration().

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 ...

? dotrap+0xdb/0x100 ? doerrortrap+0x75/0xb0 ? spimemcalcopduration+0x56/0xb0 ? excdivideerror+0x3b/0x70 ? spimemcalcopduration+0x56/0xb0 ? asmexcdivideerror+0x1b/0x20 ? spimemcalcopduration+0x56/0xb0 ? spinandselectopvariant+0xee/0x190 [spinand] spinandmatchandinit+0x13e/0x1a0 [spinand] spinandmanufacturermatch+0x6e/0xa0 [spinand] spinandprobe+0x357/0x7f0 [spinand] ? kernfsactivate+0x87/0xd0 spimemprobe+0x7a/0xb0 spi_probe+0x7d/0x130

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
226d6cb3cb799aae46d0dd19a521133997d9db11
Fixed
1915dbd67dadc0bb35670c8e28229baa29368d17
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
226d6cb3cb799aae46d0dd19a521133997d9db11
Fixed
8e4d3d8a5e51e07bd0d6cdd81b5e4af79f796927

Affected versions

v6.*

v6.13
v6.13-rc7
v6.14
v6.14-rc1
v6.14-rc2
v6.14-rc3
v6.14-rc4
v6.14-rc5
v6.14-rc6
v6.14-rc7
v6.14.1
v6.14.2
v6.14.3
v6.14.4
v6.14.5
v6.15-rc1
v6.15-rc2

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.14.0
Fixed
6.14.6