Patch "Bluetooth: initialize skb_queue_head at l2cap_chan_create()" has been added to the 5.12-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

    Bluetooth: initialize skb_queue_head at l2cap_chan_create()

to the 5.12-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:
     bluetooth-initialize-skb_queue_head-at-l2cap_chan_cr.patch
and it can be found in the queue-5.12 subdirectory.

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



commit 00070554cee5b024e4f582b5d0c465f8b0df0af8
Author: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Date:   Mon Mar 22 07:52:07 2021 +0900

    Bluetooth: initialize skb_queue_head at l2cap_chan_create()
    
    [ Upstream commit be8597239379f0f53c9710dd6ab551bbf535bec6 ]
    
    syzbot is hitting "INFO: trying to register non-static key." message [1],
    for "struct l2cap_chan"->tx_q.lock spinlock is not yet initialized when
    l2cap_chan_del() is called due to e.g. timeout.
    
    Since "struct l2cap_chan"->lock mutex is initialized at l2cap_chan_create()
    immediately after "struct l2cap_chan" is allocated using kzalloc(), let's
    as well initialize "struct l2cap_chan"->{tx_q,srej_q}.lock spinlocks there.
    
    [1] https://syzkaller.appspot.com/bug?extid=fadfba6a911f6bf71842
    
    Reported-and-tested-by: syzbot <syzbot+fadfba6a911f6bf71842@xxxxxxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Marcel Holtmann <marcel@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index db6a4b2d0d77..53ddbee459b9 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -451,6 +451,8 @@ struct l2cap_chan *l2cap_chan_create(void)
 	if (!chan)
 		return NULL;
 
+	skb_queue_head_init(&chan->tx_q);
+	skb_queue_head_init(&chan->srej_q);
 	mutex_init(&chan->lock);
 
 	/* Set default lock nesting level */



[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