2023-12-19 08:11:45

by Frédéric Danis

[permalink] [raw]
Subject: [PATCH] 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]>
---
net/bluetooth/l2cap_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index baeebee41cd9..60298975d5c4 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6526,7 +6526,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);
--
2.34.1



2023-12-19 08:37:48

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: L2CAP: Fix possible multiple reject send

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=811317

---Test result---

Test Summary:
CheckPatch PASS 0.65 seconds
GitLint PASS 0.36 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 28.24 seconds
CheckAllWarning PASS 30.86 seconds
CheckSparse PASS 36.64 seconds
CheckSmatch PASS 100.01 seconds
BuildKernel32 PASS 29.65 seconds
TestRunnerSetup PASS 437.46 seconds
TestRunner_l2cap-tester PASS 23.32 seconds
TestRunner_iso-tester PASS 44.93 seconds
TestRunner_bnep-tester PASS 6.83 seconds
TestRunner_mgmt-tester PASS 160.83 seconds
TestRunner_rfcomm-tester PASS 10.86 seconds
TestRunner_sco-tester PASS 17.82 seconds
TestRunner_ioctl-tester PASS 12.13 seconds
TestRunner_mesh-tester PASS 8.80 seconds
TestRunner_smp-tester PASS 10.14 seconds
TestRunner_userchan-tester PASS 7.81 seconds
IncrementalBuild PASS 26.58 seconds



---
Regards,
Linux Bluetooth

2023-12-19 18:29:13

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: L2CAP: Fix possible multiple reject send

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Tue, 19 Dec 2023 09:10:22 +0100 you wrote:
> 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]>
>
> [...]

Here is the summary with links:
- Bluetooth: L2CAP: Fix possible multiple reject send
https://git.kernel.org/bluetooth/bluetooth-next/c/ff1bb03a94dc

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html