In the Linux kernel, the following vulnerability has been resolved:
spi: Fix null dereference on suspend
A race condition exists where a synchronous (noqueue) transfer can be active during a system suspend. This can cause a null pointer dereference exception to occur when the system resumes.
Example order of events leading to the exception: 1. spisync() calls _spitransfermessagenoqueue() which sets ctlr->curmsg 2. Spi transfer begins via spitransferonemessage() 3. System is suspended interrupting the transfer context 4. System is resumed 6. spicontrollerresume() calls spistartqueue() which resets curmsg to NULL 7. Spi transfer context resumes and spifinalizecurrentmessage() is called which dereferences curmsg (which is now NULL)
Wait for synchronous transfers to complete before suspending by acquiring the bus mutex and setting/checking a suspend flag.