mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
can: j1939: j1939_session_new(): fix skb reference counting
Since j1939_session_skb_queue() does an extra skb_get() for each new skb, do the same for the initial one in j1939_session_new() to avoid refcount underflow. Reported-by: syzbot+d4e8dc385d9258220c31@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=d4e8dc385d9258220c31 Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://patch.msgid.link/20241105094823.2403806-1-dmantipov@yandex.ru [mkl: clean up commit message] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
30447a1bc0
commit
a8c695005b
@ -1505,7 +1505,7 @@ static struct j1939_session *j1939_session_new(struct j1939_priv *priv,
|
||||
session->state = J1939_SESSION_NEW;
|
||||
|
||||
skb_queue_head_init(&session->skb_queue);
|
||||
skb_queue_tail(&session->skb_queue, skb);
|
||||
skb_queue_tail(&session->skb_queue, skb_get(skb));
|
||||
|
||||
skcb = j1939_skb_to_cb(skb);
|
||||
memcpy(&session->skcb, skcb, sizeof(session->skcb));
|
||||
|
Loading…
x
Reference in New Issue
Block a user