Skip to content

Commit 96a3398

Browse files
fdanis-ossVudentz
authored andcommitted
Bluetooth: L2CAP: Fix possible multiple reject send
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 <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent d4b70ba commit 96a3398

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/bluetooth/l2cap_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6526,7 +6526,8 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn,
65266526
if (len > skb->len || !cmd->ident) {
65276527
BT_DBG("corrupted command");
65286528
l2cap_sig_send_rej(conn, cmd->ident);
6529-
break;
6529+
skb_pull(skb, len > skb->len ? skb->len : len);
6530+
continue;
65306531
}
65316532

65326533
err = l2cap_bredr_sig_cmd(conn, cmd, len, skb->data);

0 commit comments

Comments
 (0)