spi: jcore: fix divide-by-zero when speed_hz is zero
- CVE-2026-143406
- EUVD-2026-145003
Summary
A divide-by-zero flaw in the Linux kernel's J-Core SPI controller driver occurs in jcore_spi_baudrate() when the transfer speed is zero. The SPI core fills in the speed from the device's max speed, but the J-Core probe never sets that maximum, so devices created through sysfs new_device or without a spi-max-frequency property end up with zero speed. Any SPI_IOC_MESSAGE transfer on such a device then triggers the division and a kernel panic. The fix clamps the speed to a minimum of 1 Hz before dividing, so the divider stays nonzero and transfers run at the slowest supported rate. The fix was verified only by code inspection because the J-Core hardware was unavailable for testing.
AI summary · verify against the vendor advisory
Description
In the Linux kernel, the following vulnerability has been resolved: spi: jcore: fix divide-by-zero when speed_hz is zero jcore_spi_baudrate() computes hw->clock_freq / 2 / speed without validating speed. The SPI core fills transfer.speed_hz from spi->max_speed_hz when it is zero, and jcore_spi_probe() never sets host->max_speed_hz, so the clamp in __spi_setup() is skipped. A spi_device created via the sysfs new_device interface (or a DT node without spi-max-frequency) therefore has max_speed_hz == 0, and any SPI_IOC_MESSAGE transfer reaches jcore_spi_baudrate() with speed == 0, causing a division by zero and a kernel panic. Clamp speed to a minimum of 1 Hz before the division so the divisor is never zero. The computed divider then truncates to the register field width and the transfer simply runs at the slowest supported rate. Verified by inspection of the __spi_setup() clamp and __spi_validate()'s speed_hz handling; the division-by-zero path requires the J-Core controller, which was not available.
Text from the CVE.org record.
Recommendation
No source states a fixed version. Check the vendor advisory.
Affected
Linux
Affected versions Fixed in 4.9 none stated before 4.9: not affected none stated from 5.10.275 up to 5.10.*: not affected none stated from 5.15.226 up to 5.15.*: not affected none stated from 6.1.193 up to 6.1.*: not affected none stated from 6.6.163 up to 6.6.*: not affected none stated from 6.12.117 up to 6.12.*: not affected none stated from 6.18.63 up to 6.18.*: not affected none stated and 2 more
Product versions from the CVE.org record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.