CVE-2026-143366: spi: pic32-sqi: fail transfer when the BD ring is exhausted
In the Linux kernel, the following vulnerability has been resolved:
spi: pic32-sqi: fail transfer when the BD ring is exhausted
pic32sqionetransfer() silently stopped programming buffer descriptors when ringdescget() returned NULL and still returned success. The caller then marked the last programmed descriptor as the end of the list and started the DMA engine, so the hardware transferred only a prefix of the requested data while the message completed with status 0.
The ring holds PESQIBDCOUNT (256) descriptors of at most PESQIBDBUFLENMAX (256) bytes each, so messages larger than 64 KiB (or with enough SG entries) can exhaust it. Since the driver sets no maxmessagesize/maxtransfersize, the SPI core does not prevent this.
Return -ENOMEM instead, and set msg->status so the failure reaches the caller rather than being silently truncated.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel spi: pic32-sqi driver, make pic32_sqi_one_transfer() fail when ring_desc_get() returns NULL: return -ENOMEM and set msg->status so the failure reaches the caller instead of silently truncating the transfer.
Event History
Frequently Asked Questions
Which deployments are exposed to silent data truncation?
Systems using the PIC32 SQI SPI controller driver are affected when a transfer requires more buffer descriptors than its 256-entry ring can hold. This can occur with messages larger than 64 KiB or with sufficiently fragmented scatter-gather input.
Does the SPI core prevent oversized requests by default?
No. The driver does not set maximum message or transfer sizes, so the SPI core does not reject requests that exceed the descriptor ring's capacity.
What can be done if the fix cannot be applied immediately?
Keep transfers within the descriptor-ring capacity by limiting message size to 64 KiB or less and avoiding scatter-gather layouts that require more than 256 descriptors. Callers should not treat a successful completion as proof that all requested data was transferred on affected systems.
How does the corrected behavior differ from the vulnerable behavior?
The corrected driver returns -ENOMEM and records the message failure when descriptors are exhausted. Previously, it could report success after transferring only a prefix of the requested data.