Patch "can: j1939: j1939_session_new(): fix skb reference counting" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    can: j1939: j1939_session_new(): fix skb reference counting

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     can-j1939-j1939_session_new-fix-skb-reference-counti.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f85e1d482acd2a9ef9f36929b2553cd8e9e4793d
Author: Dmitry Antipov <dmantipov@xxxxxxxxx>
Date:   Tue Nov 5 12:48:23 2024 +0300

    can: j1939: j1939_session_new(): fix skb reference counting
    
    [ Upstream commit a8c695005bfe6569acd73d777ca298ddddd66105 ]
    
    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@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://syzkaller.appspot.com/bug?extid=d4e8dc385d9258220c31
    Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
    Signed-off-by: Dmitry Antipov <dmantipov@xxxxxxxxx>
    Tested-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
    Acked-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
    Link: https://patch.msgid.link/20241105094823.2403806-1-dmantipov@xxxxxxxxx
    [mkl: clean up commit message]
    Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index a86256ab14022..84d63fb29ca1f 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -1489,7 +1489,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));




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux