CVE-2026-143406: spi: jcore: fix divide-by-zero when speed_hz is zero
In the Linux kernel, the following vulnerability has been resolved:
spi: jcore: fix divide-by-zero when speedhz is zero
jcorespibaudrate() computes hw->clockfreq / 2 / speed without validating speed. The SPI core fills transfer.speedhz from spi->maxspeedhz when it is zero, and jcorespiprobe() never sets host->maxspeedhz, so the clamp in spisetup() is skipped. A spidevice created via the sysfs newdevice interface (or a DT node without spi-max-frequency) therefore has maxspeedhz == 0, and any SPIIOCMESSAGE transfer reaches jcorespibaudrate() 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 spisetup() clamp and spivalidate()'s speedhz handling; the division-by-zero path requires the J-Core controller, which was not available.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In jcore_spi_baudrate(), clamp speed to a minimum of 1 Hz before dividing.
Event History
Frequently Asked Questions
Which systems are exposed to this kernel panic?
Systems using the J-Core SPI controller are exposed when an SPI device has max_speed_hz set to zero. This can occur for devices created through the sysfs new_device interface or Device Tree nodes that omit spi-max-frequency.
What is required to trigger the issue?
An SPI_IOC_MESSAGE transfer must be issued for an affected SPI device so that the transfer reaches the J-Core driver's baud-rate calculation with a zero speed. The result is a division by zero and kernel panic.
What happens if a zero transfer speed is used after the fix?
The driver clamps the speed to at least 1 Hz before division. The resulting divider is limited by the register field width, and the transfer runs at the slowest supported rate rather than panicking.