can: vxcan: vxcan_xmit: fix use after free bug
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Wed, 20 Jan 2021 11:41:36 +0000 (20:41 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 20 Jan 2021 12:33:12 +0000 (13:33 +0100)
commit75854cad5d80976f6ea0f0431f8cedd3bcc475cb
tree04e4b19da43954395aca5a3ae98db7bf8fee86c3
parent03f16c5075b22c8902d2af739969e878b0879c94
can: vxcan: vxcan_xmit: fix use after free bug

After calling netif_rx_ni(skb), dereferencing skb is unsafe.
Especially, the canfd_frame cfd which aliases skb memory is accessed
after the netif_rx_ni().

Fixes: a8f820a380a2 ("can: add Virtual CAN Tunnel driver (vxcan)")
Link: https://lore.kernel.org/r/20210120114137.200019-3-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/vxcan.c