]> git.baikalelectronics.ru Git - kernel.git/commit
can: j1939: j1939_session_destroy(): fix memory leak of skbs
authorFedor Pchelkin <pchelkin@ispras.ru>
Fri, 5 Aug 2022 15:02:16 +0000 (18:02 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 9 Aug 2022 07:05:06 +0000 (09:05 +0200)
commit2d2227cd708c0b9014484b10f43cec5dc550a50e
tree2e7f11461b9d62a1e6798b71c4aa9f789569e532
parentdbd1aca7394a8fa2b279caca162ff261a9f1ede4
can: j1939: j1939_session_destroy(): fix memory leak of skbs

We need to drop skb references taken in j1939_session_skb_queue() when
destroying a session in j1939_session_destroy(). Otherwise those skbs
would be lost.

Link to Syzkaller info and repro: https://forge.ispras.ru/issues/11743.

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

V1: https://lore.kernel.org/all/20220708175949.539064-1-pchelkin@ispras.ru

Fixes: 877b9bba3266 ("can: add support of SAE J1939 protocol")
Suggested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/all/20220805150216.66313-1-pchelkin@ispras.ru
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/j1939/transport.c