In the Linux kernel, the following vulnerability has been resolved:
can: peakusb: peakusb_start(): fix double free of transfer buffer on URB submit error
In peakusbstart(), each RX URB transfer buffer is allocated with kmalloc() and the URB is flagged URBFREEBUFFER so that the final usbfreeurb() also frees the transfer buffer.
If usbsubmiturb() fails, the error path frees the buffer explicitly with kfree(buf) and then calls usbfreeurb(urb). Because URBFREEBUFFER is set, usbfreeurb() -> urb_destroy() frees the same buffer a second time, a double free of the transfer buffer.
BUG: KASAN: double-free in usbfreeurb.part.0+0x91/0xb0 Free of addr ffff8881069ccb80 by task trigger.sh/285
Call Trace: kfree+0x113/0x3c0 usbfreeurb.part.0+0x91/0xb0
Drop the redundant kfree(buf); usbfreeurb() already releases the transfer buffer. This mirrors commit 03819abbeb11 ("net: usb: lan78xx: Fix double free issue with interrupt buffer allocation").