]> git.baikalelectronics.ru Git - kernel.git/commit
can: peak_usb: fix use after free bugs
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Wed, 20 Jan 2021 11:41:37 +0000 (20:41 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 20 Jan 2021 12:33:28 +0000 (13:33 +0100)
commit0d8c625546f47ca7f32a5f1ffcb8946f6503b640
treed589e8c849157ba2f152b1610ec99510c91c61ac
parent5719fdb018f5f0d4676b7c23db371845b7ade0f3
can: peak_usb: fix use after free bugs

After calling peak_usb_netif_rx_ni(skb), dereferencing skb is unsafe.
Especially, the can_frame cf which aliases skb memory is accessed
after the peak_usb_netif_rx_ni().

Reordering the lines solves the issue.

Fixes: ed9c60b42979 ("can: peak_usb: add support for PEAK new CANFD USB adapters")
Link: https://lore.kernel.org/r/20210120114137.200019-4-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb_fd.c