* [PATCH] Bluetooth: L2CAP: Fix u8 overflow
@ 2022-11-18 20:01 Sungwoo Kim
2022-11-19 3:07 ` bluez.test.bot
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Sungwoo Kim @ 2022-11-18 20:01 UTC (permalink / raw)
Cc: Sungwoo Kim, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-bluetooth, netdev,
linux-kernel
By keep sending L2CAP_CONF_REQ packets, chan->num_conf_rsp increases
multiple times and eventually it will wrap around the maximum number
(i.e., 255).
This patch prevents this by adding a boundary check with
L2CAP_MAX_CONF_RSP
Btmon log:
Bluetooth monitor ver 5.64
= Note: Linux version 6.1.0-rc2 (x86_64) 0.264594
= Note: Bluetooth subsystem version 2.22 0.264636
@ MGMT Open: btmon (privileged) version 1.22 {0x0001} 0.272191
= New Index: 00:00:00:00:00:00 (Primary,Virtual,hci0) [hci0] 13.877604
@ RAW Open: 9496 (privileged) version 2.22 {0x0002} 13.890741
= Open Index: 00:00:00:00:00:00 [hci0] 13.900426
(...)
> ACL Data RX: Handle 200 flags 0x00 dlen 1033 #32 [hci0] 14.273106
invalid packet size (12 != 1033)
08 00 01 00 02 01 04 00 01 10 ff ff ............
> ACL Data RX: Handle 200 flags 0x00 dlen 1547 #33 [hci0] 14.273561
invalid packet size (14 != 1547)
0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@.....
> ACL Data RX: Handle 200 flags 0x00 dlen 2061 #34 [hci0] 14.274390
invalid packet size (16 != 2061)
0c 00 01 00 04 01 08 00 40 00 00 00 00 00 00 04 ........@.......
> ACL Data RX: Handle 200 flags 0x00 dlen 2061 #35 [hci0] 14.274932
invalid packet size (16 != 2061)
0c 00 01 00 04 01 08 00 40 00 00 00 07 00 03 00 ........@.......
= bluetoothd: Bluetooth daemon 5.43 14.401828
> ACL Data RX: Handle 200 flags 0x00 dlen 1033 #36 [hci0] 14.275753
invalid packet size (12 != 1033)
08 00 01 00 04 01 04 00 40 00 00 00 ........@...
Signed-off-by: Sungwoo Kim <iam@sung-woo.kim>
---
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 9c24947aa..9fdede5fe 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4453,7 +4453,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn,
chan->ident = cmd->ident;
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, len, rsp);
- chan->num_conf_rsp++;
+ if (chan->num_conf_rsp < L2CAP_CONF_MAX_CONF_RSP)
+ chan->num_conf_rsp++;
/* Reset config buffer. */
chan->conf_len = 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: Bluetooth: L2CAP: Fix u8 overflow
2022-11-18 20:01 [PATCH] Bluetooth: L2CAP: Fix u8 overflow Sungwoo Kim
@ 2022-11-19 3:07 ` bluez.test.bot
2022-11-19 4:36 ` bluez.test.bot
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2022-11-19 3:07 UTC (permalink / raw)
To: linux-bluetooth, iam
[-- Attachment #1: Type: text/plain, Size: 2467 bytes --]
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=697073
---Test result---
Test Summary:
CheckPatch FAIL 0.87 seconds
GitLint FAIL 0.52 seconds
SubjectPrefix PASS 0.12 seconds
BuildKernel PASS 33.69 seconds
BuildKernel32 PASS 29.78 seconds
TestRunnerSetup PASS 417.83 seconds
TestRunner_l2cap-tester PASS 15.73 seconds
TestRunner_iso-tester PASS 15.03 seconds
TestRunner_bnep-tester PASS 5.37 seconds
TestRunner_mgmt-tester PASS 103.03 seconds
TestRunner_rfcomm-tester PASS 9.00 seconds
TestRunner_sco-tester PASS 8.51 seconds
TestRunner_ioctl-tester PASS 9.72 seconds
TestRunner_mesh-tester PASS 6.64 seconds
TestRunner_smp-tester PASS 8.41 seconds
TestRunner_userchan-tester PASS 5.48 seconds
IncrementalBuild PASS 30.85 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
Bluetooth: L2CAP: Fix u8 overflow
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#83:
= Note: Linux version 6.1.0-rc2 (x86_64) 0.264594
total: 0 errors, 1 warnings, 0 checks, 9 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13048756.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
Bluetooth: L2CAP: Fix u8 overflow
20: B2 Line has trailing whitespace: " 08 00 01 00 02 01 04 00 01 10 ff ff ............ "
23: B2 Line has trailing whitespace: " 0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@..... "
33: B2 Line has trailing whitespace: " 08 00 01 00 04 01 04 00 40 00 00 00 ........@... "
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Bluetooth: L2CAP: Fix u8 overflow
2022-11-18 20:01 [PATCH] Bluetooth: L2CAP: Fix u8 overflow Sungwoo Kim
2022-11-19 3:07 ` bluez.test.bot
@ 2022-11-19 4:36 ` bluez.test.bot
2022-11-19 5:29 ` bluez.test.bot
2022-11-22 0:50 ` [PATCH] " patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2022-11-19 4:36 UTC (permalink / raw)
To: linux-bluetooth, iam
[-- Attachment #1: Type: text/plain, Size: 2471 bytes --]
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=697073
---Test result---
Test Summary:
CheckPatch FAIL 0.96 seconds
GitLint FAIL 0.53 seconds
SubjectPrefix PASS 0.06 seconds
BuildKernel PASS 47.38 seconds
BuildKernel32 PASS 42.25 seconds
TestRunnerSetup PASS 575.10 seconds
TestRunner_l2cap-tester PASS 18.91 seconds
TestRunner_iso-tester PASS 20.00 seconds
TestRunner_bnep-tester PASS 6.97 seconds
TestRunner_mgmt-tester PASS 133.29 seconds
TestRunner_rfcomm-tester PASS 11.72 seconds
TestRunner_sco-tester PASS 10.98 seconds
TestRunner_ioctl-tester PASS 13.25 seconds
TestRunner_mesh-tester PASS 9.23 seconds
TestRunner_smp-tester PASS 10.85 seconds
TestRunner_userchan-tester PASS 7.47 seconds
IncrementalBuild PASS 42.58 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
Bluetooth: L2CAP: Fix u8 overflow
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#83:
= Note: Linux version 6.1.0-rc2 (x86_64) 0.264594
total: 0 errors, 1 warnings, 0 checks, 9 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13048756.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
Bluetooth: L2CAP: Fix u8 overflow
20: B2 Line has trailing whitespace: " 08 00 01 00 02 01 04 00 01 10 ff ff ............ "
23: B2 Line has trailing whitespace: " 0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@..... "
33: B2 Line has trailing whitespace: " 08 00 01 00 04 01 04 00 40 00 00 00 ........@... "
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Bluetooth: L2CAP: Fix u8 overflow
2022-11-18 20:01 [PATCH] Bluetooth: L2CAP: Fix u8 overflow Sungwoo Kim
2022-11-19 3:07 ` bluez.test.bot
2022-11-19 4:36 ` bluez.test.bot
@ 2022-11-19 5:29 ` bluez.test.bot
2022-11-22 0:50 ` [PATCH] " patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2022-11-19 5:29 UTC (permalink / raw)
To: linux-bluetooth, iam
[-- Attachment #1: Type: text/plain, Size: 2468 bytes --]
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=697073
---Test result---
Test Summary:
CheckPatch FAIL 1.01 seconds
GitLint FAIL 0.55 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 34.03 seconds
BuildKernel32 PASS 30.61 seconds
TestRunnerSetup PASS 430.95 seconds
TestRunner_l2cap-tester PASS 16.47 seconds
TestRunner_iso-tester PASS 15.65 seconds
TestRunner_bnep-tester PASS 5.60 seconds
TestRunner_mgmt-tester PASS 109.00 seconds
TestRunner_rfcomm-tester PASS 9.47 seconds
TestRunner_sco-tester PASS 9.09 seconds
TestRunner_ioctl-tester PASS 10.32 seconds
TestRunner_mesh-tester PASS 7.08 seconds
TestRunner_smp-tester PASS 8.73 seconds
TestRunner_userchan-tester PASS 5.91 seconds
IncrementalBuild PASS 31.92 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
Bluetooth: L2CAP: Fix u8 overflow
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#83:
= Note: Linux version 6.1.0-rc2 (x86_64) 0.264594
total: 0 errors, 1 warnings, 0 checks, 9 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13048756.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
Bluetooth: L2CAP: Fix u8 overflow
20: B2 Line has trailing whitespace: " 08 00 01 00 02 01 04 00 01 10 ff ff ............ "
23: B2 Line has trailing whitespace: " 0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@..... "
33: B2 Line has trailing whitespace: " 08 00 01 00 04 01 04 00 40 00 00 00 ........@... "
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Bluetooth: L2CAP: Fix u8 overflow
2022-11-18 20:01 [PATCH] Bluetooth: L2CAP: Fix u8 overflow Sungwoo Kim
` (2 preceding siblings ...)
2022-11-19 5:29 ` bluez.test.bot
@ 2022-11-22 0:50 ` patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2022-11-22 0:50 UTC (permalink / raw)
To: Sungwoo Kim
Cc: marcel, johan.hedberg, luiz.dentz, davem, edumazet, kuba, pabeni,
linux-bluetooth, netdev, linux-kernel
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 18 Nov 2022 15:01:47 -0500 you wrote:
> By keep sending L2CAP_CONF_REQ packets, chan->num_conf_rsp increases
> multiple times and eventually it will wrap around the maximum number
> (i.e., 255).
> This patch prevents this by adding a boundary check with
> L2CAP_MAX_CONF_RSP
>
> Btmon log:
> Bluetooth monitor ver 5.64
> = Note: Linux version 6.1.0-rc2 (x86_64) 0.264594
> = Note: Bluetooth subsystem version 2.22 0.264636
> @ MGMT Open: btmon (privileged) version 1.22 {0x0001} 0.272191
> = New Index: 00:00:00:00:00:00 (Primary,Virtual,hci0) [hci0] 13.877604
> @ RAW Open: 9496 (privileged) version 2.22 {0x0002} 13.890741
> = Open Index: 00:00:00:00:00:00 [hci0] 13.900426
> (...)
> > ACL Data RX: Handle 200 flags 0x00 dlen 1033 #32 [hci0] 14.273106
> invalid packet size (12 != 1033)
> 08 00 01 00 02 01 04 00 01 10 ff ff ............
> > ACL Data RX: Handle 200 flags 0x00 dlen 1547 #33 [hci0] 14.273561
> invalid packet size (14 != 1547)
> 0a 00 01 00 04 01 06 00 40 00 00 00 00 00 ........@.....
> > ACL Data RX: Handle 200 flags 0x00 dlen 2061 #34 [hci0] 14.274390
> invalid packet size (16 != 2061)
> 0c 00 01 00 04 01 08 00 40 00 00 00 00 00 00 04 ........@.......
> > ACL Data RX: Handle 200 flags 0x00 dlen 2061 #35 [hci0] 14.274932
> invalid packet size (16 != 2061)
> 0c 00 01 00 04 01 08 00 40 00 00 00 07 00 03 00 ........@.......
> = bluetoothd: Bluetooth daemon 5.43 14.401828
> > ACL Data RX: Handle 200 flags 0x00 dlen 1033 #36 [hci0] 14.275753
> invalid packet size (12 != 1033)
> 08 00 01 00 04 01 04 00 40 00 00 00 ........@...
>
> [...]
Here is the summary with links:
- Bluetooth: L2CAP: Fix u8 overflow
https://git.kernel.org/bluetooth/bluetooth-next/c/ae4569813a6e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-22 0:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-18 20:01 [PATCH] Bluetooth: L2CAP: Fix u8 overflow Sungwoo Kim
2022-11-19 3:07 ` bluez.test.bot
2022-11-19 4:36 ` bluez.test.bot
2022-11-19 5:29 ` bluez.test.bot
2022-11-22 0:50 ` [PATCH] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox