In the Linux kernel, the following vulnerability has been resolved:
can: isotp: isotpsendmsg(): add result check for waitevent_interruptible()
Using waiteventinterruptible() to wait for complete transmission, but do not check the result of waiteventinterruptible() which can be interrupted. It will result in TX buffer has multiple accessors and the later process interferes with the previous process.
Following is one of the problems reported by syzbot.
============================================================= WARNING: CPU: 0 PID: 0 at net/can/isotp.c:840 isotptxtimerhandler+0x2e0/0x4c0 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc7+ #68 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1 04/01/2014 RIP: 0010:isotptxtimerhandler+0x2e0/0x4c0 Call Trace: <IRQ> ? isotpsetsockopt+0x390/0x390 _hrtimerrunqueues+0xb8/0x610 hrtimerrunsoftirq+0x91/0xd0 ? rcureadlockschedheld+0x4d/0x80 _dosoftirq+0xe8/0x553 irqexitrcu+0xf8/0x100 sysvecapictimerinterrupt+0x9e/0xc0 </IRQ> asmsysvecapictimer_interrupt+0x12/0x20
Add result check for waiteventinterruptible() in isotp_sendmsg() to avoid multiple accessers for tx buffer.