Patch "Bluetooth: L2CAP: Fix possible multiple reject send" has been added to the 5.15-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: L2CAP: Fix possible multiple reject send

to the 5.15-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-l2cap-fix-possible-multiple-reject-send.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 275f309a9a04efaf5902c0e323e0db8b4b9c500b
Author: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
Date:   Tue Dec 19 09:10:22 2023 +0100

    Bluetooth: L2CAP: Fix possible multiple reject send
    
    [ Upstream commit 96a3398b467ab8aada3df2f3a79f4b7835d068b8 ]
    
    In case of an incomplete command or a command with a null identifier 2
    reject packets will be sent, one with the identifier and one with 0.
    Consuming the data of the command will prevent it.
    This allows to send a reject packet for each corrupted command in a
    multi-command packet.
    
    Signed-off-by: Frédéric Danis <frederic.danis@xxxxxxxxxxxxx>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 9f3596de90a7..850b6aab7377 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6527,7 +6527,8 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn,
 		if (len > skb->len || !cmd->ident) {
 			BT_DBG("corrupted command");
 			l2cap_sig_send_rej(conn, cmd->ident);
-			break;
+			skb_pull(skb, len > skb->len ? skb->len : len);
+			continue;
 		}
 
 		err = l2cap_bredr_sig_cmd(conn, cmd, len, skb->data);




[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