* [syzbot] [bluetooth?] WARNING in hci_conn_del
@ 2024-02-28 4:53 syzbot
2024-06-13 21:15 ` [syzbot] " syzbot
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: syzbot @ 2024-02-28 4:53 UTC (permalink / raw)
To: davem, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzkaller-bugs, william.xuanziyang
Hello,
syzbot found the following issue on:
HEAD commit: 603c04e27c3e Merge tag 'parisc-for-6.8-rc6' of git://git.k..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=12d065aa180000
kernel config: https://syzkaller.appspot.com/x/.config?x=eff9f3183d0a20dd
dashboard link: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17960122180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d70222180000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ffe1f52b2e32/disk-603c04e2.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/76775e0b335d/vmlinux-603c04e2.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8cd3c1c87eef/bzImage-603c04e2.xz
The issue was bisected to:
commit 181a42edddf51d5d9697ecdf365d72ebeab5afb0
Author: Ziyang Xuan <william.xuanziyang@huawei.com>
Date: Wed Oct 11 09:57:31 2023 +0000
Bluetooth: Make handle of hci_conn be unique
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1357945c180000
final oops: https://syzkaller.appspot.com/x/report.txt?x=10d7945c180000
console output: https://syzkaller.appspot.com/x/log.txt?x=1757945c180000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
------------[ cut here ]------------
ida_free called for id=8192 which is not allocated.
WARNING: CPU: 1 PID: 5074 at lib/idr.c:525 ida_free+0x370/0x420 lib/idr.c:525
Modules linked in:
CPU: 1 PID: 5074 Comm: syz-executor104 Not tainted 6.8.0-rc5-syzkaller-00278-g603c04e27c3e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:ida_free+0x370/0x420 lib/idr.c:525
Code: 10 42 80 3c 28 00 74 05 e8 8d 4b 9b f6 48 8b 7c 24 40 4c 89 fe e8 a0 89 17 00 90 48 c7 c7 80 cd c5 8c 89 de e8 21 32 fd f5 90 <0f> 0b 90 90 eb 3d e8 45 27 39 f6 49 bd 00 00 00 00 00 fc ff df 4d
RSP: 0018:ffffc900039ef920 EFLAGS: 00010246
RAX: 59cbf4b1e8f11a00 RBX: 0000000000002000 RCX: ffff88802da20000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc900039efa18 R08: ffffffff81577ab2 R09: 1ffff110172a51a2
R10: dffffc0000000000 R11: ffffed10172a51a3 R12: ffffc900039ef960
R13: dffffc0000000000 R14: ffff88801e3ec0a0 R15: 0000000000000246
FS: 0000000000000000(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f78fc079f08 CR3: 000000002db8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
hci_conn_cleanup net/bluetooth/hci_conn.c:157 [inline]
hci_conn_del+0x7c0/0xcb0 net/bluetooth/hci_conn.c:1188
hci_conn_hash_flush+0x18e/0x240 net/bluetooth/hci_conn.c:2646
hci_dev_close_sync+0x9ab/0xff0 net/bluetooth/hci_sync.c:4954
hci_dev_do_close net/bluetooth/hci_core.c:554 [inline]
hci_unregister_dev+0x1e3/0x4e0 net/bluetooth/hci_core.c:2739
vhci_release+0x83/0xd0 drivers/bluetooth/hci_vhci.c:674
__fput+0x429/0x8a0 fs/file_table.c:376
task_work_run+0x24e/0x310 kernel/task_work.c:180
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0xa2c/0x2740 kernel/exit.c:871
do_group_exit+0x206/0x2c0 kernel/exit.c:1020
__do_sys_exit_group kernel/exit.c:1031 [inline]
__se_sys_exit_group kernel/exit.c:1029 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1029
do_syscall_64+0xf9/0x240
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7f78fc021449
Code: Unable to access opcode bytes at 0x7f78fc02141f.
RSP: 002b:00007ffd8ebe2238 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f78fc021449
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 00007f78fc0ad2b0 R08: ffffffffffffffb0 R09: 000000ff00ff4650
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f78fc0ad2b0
R13: 0000000000000000 R14: 00007f78fc0add00 R15: 00007f78fbfef4e0
</TASK>
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [syzbot] Re: WARNING in hci_conn_del
2024-02-28 4:53 [syzbot] [bluetooth?] WARNING in hci_conn_del syzbot
@ 2024-06-13 21:15 ` syzbot
2024-06-16 10:14 ` [syzbot] [bluetooth?] " Edward Adam Davis
2024-06-16 10:20 ` [PATCH] bluetooth: handle value within the ida range should not be handled in BIG Edward Adam Davis
2 siblings, 0 replies; 14+ messages in thread
From: syzbot @ 2024-06-13 21:15 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: WARNING in hci_conn_del
Author: paskripkin@gmail.com
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 603c04e27c3e Merge tag 'parisc-for-6.8-rc6' of git://git.k..
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=12d065aa180000
> kernel config: https://syzkaller.appspot.com/x/.config?x=eff9f3183d0a20dd
> dashboard link: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17960122180000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d70222180000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/ffe1f52b2e32/disk-603c04e2.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/76775e0b335d/vmlinux-603c04e2.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/8cd3c1c87eef/bzImage-603c04e2.xz
>
> The issue was bisected to:
>
> commit 181a42edddf51d5d9697ecdf365d72ebeab5afb0
> Author: Ziyang Xuan <william.x...@huawei.com>
> Date: Wed Oct 11 09:57:31 2023 +0000
>
> Bluetooth: Make handle of hci_conn be unique
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1357945c180000
> final oops: https://syzkaller.appspot.com/x/report.txt?x=10d7945c180000
> console output: https://syzkaller.appspot.com/x/log.txt?x=1757945c180000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+b2545b...@syzkaller.appspotmail.com
> Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
#syz test
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
--
With regards,
Pavel Skripkin
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [syzbot] [bluetooth?] WARNING in hci_conn_del
2024-02-28 4:53 [syzbot] [bluetooth?] WARNING in hci_conn_del syzbot
2024-06-13 21:15 ` [syzbot] " syzbot
@ 2024-06-16 10:14 ` Edward Adam Davis
2024-06-16 10:33 ` syzbot
2024-06-16 10:20 ` [PATCH] bluetooth: handle value within the ida range should not be handled in BIG Edward Adam Davis
2 siblings, 1 reply; 14+ messages in thread
From: Edward Adam Davis @ 2024-06-16 10:14 UTC (permalink / raw)
To: syzbot+b2545b087a01a7319474; +Cc: linux-kernel, syzkaller-bugs
please test wrn
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 603c04e27c3e
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a487f9df8145..4130d64d9a80 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6893,6 +6893,9 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
bis = hci_conn_hash_lookup_handle(hdev, handle);
if (!bis) {
+ if (handle > HCI_CONN_HANDLE_MAX)
+ continue;
+
bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
HCI_ROLE_SLAVE, handle);
if (IS_ERR(bis))
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH] bluetooth: handle value within the ida range should not be handled in BIG
2024-02-28 4:53 [syzbot] [bluetooth?] WARNING in hci_conn_del syzbot
2024-06-13 21:15 ` [syzbot] " syzbot
2024-06-16 10:14 ` [syzbot] [bluetooth?] " Edward Adam Davis
@ 2024-06-16 10:20 ` Edward Adam Davis
2024-06-16 10:37 ` Pavel Skripkin
2024-06-16 10:59 ` bluetooth: handle value within the ida range should not be handled in BIG bluez.test.bot
2 siblings, 2 replies; 14+ messages in thread
From: Edward Adam Davis @ 2024-06-16 10:20 UTC (permalink / raw)
To: syzbot+b2545b087a01a7319474
Cc: davem, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzkaller-bugs, william.xuanziyang
hci_le_big_sync_established_evt is necessary to filter out cases where the handle
value is belone to ida id range, otherwise ida will be erroneously released in
hci_conn_cleanup.
Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
net/bluetooth/hci_event.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a487f9df8145..4130d64d9a80 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6893,6 +6893,9 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
bis = hci_conn_hash_lookup_handle(hdev, handle);
if (!bis) {
+ if (handle > HCI_CONN_HANDLE_MAX)
+ continue;
+
bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
HCI_ROLE_SLAVE, handle);
if (IS_ERR(bis))
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [syzbot] [bluetooth?] WARNING in hci_conn_del
2024-06-16 10:14 ` [syzbot] [bluetooth?] " Edward Adam Davis
@ 2024-06-16 10:33 ` syzbot
0 siblings, 0 replies; 14+ messages in thread
From: syzbot @ 2024-06-16 10:33 UTC (permalink / raw)
To: eadavis, linux-kernel, syzkaller-bugs
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
SYZFAIL: NL802154_CMD_SET_SHORT_ADDR failed
2024/06/16 10:32:05 ignoring optional flag "sandboxArg"="0"
2024/06/16 10:32:05 parsed 1 programs
2024/06/16 10:32:05 [FATAL] failed to run ["./syz-executor" "setup" "fault" "binfmt_misc" "usb" "802154" "swap"]: exit status 67
mkdir(/syzcgroup) failed: 17
mount(binfmt_misc) failed: 16
SYZFAIL: NL802154_CMD_SET_SHORT_ADDR failed
(errno 16: Device or resource busy)
Tested on:
commit: 603c04e2 Merge tag 'parisc-for-6.8-rc6' of git://git.k..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=13254bca980000
kernel config: https://syzkaller.appspot.com/x/.config?x=686c39ecef854022
dashboard link: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=12b26851980000
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] bluetooth: handle value within the ida range should not be handled in BIG
2024-06-16 10:20 ` [PATCH] bluetooth: handle value within the ida range should not be handled in BIG Edward Adam Davis
@ 2024-06-16 10:37 ` Pavel Skripkin
2024-06-16 13:18 ` [syzbot] [bluetooth?] WARNING in hci_conn_del Edward Adam Davis
2024-06-16 10:59 ` bluetooth: handle value within the ida range should not be handled in BIG bluez.test.bot
1 sibling, 1 reply; 14+ messages in thread
From: Pavel Skripkin @ 2024-06-16 10:37 UTC (permalink / raw)
To: Edward Adam Davis, syzbot+b2545b087a01a7319474
Cc: davem, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzkaller-bugs, william.xuanziyang
On 6/16/24 1:20 PM, 'Edward Adam Davis' via syzkaller-bugs wrote:
> hci_le_big_sync_established_evt is necessary to filter out cases where the handle
> value is belone to ida id range, otherwise ida will be erroneously released in
> hci_conn_cleanup.
>
> Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
> Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
There is one more user of `hci_conn_add` which may pass too big handle
which is `hci_le_cis_req_evt`.
I think, it should be resolved on API level as I tried to test here [0],
but syzbot is feeling bad for some reason
[0]
https://lore.kernel.org/all/31ac448d-2a21-4e93-8a00-5c7090970452@gmail.com/
> net/bluetooth/hci_event.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index a487f9df8145..4130d64d9a80 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -6893,6 +6893,9 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
>
> bis = hci_conn_hash_lookup_handle(hdev, handle);
> if (!bis) {
> + if (handle > HCI_CONN_HANDLE_MAX)
> + continue;
> +
> bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
> HCI_ROLE_SLAVE, handle);
> if (IS_ERR(bis))
--
With regards,
Pavel Skripkin
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: bluetooth: handle value within the ida range should not be handled in BIG
2024-06-16 10:20 ` [PATCH] bluetooth: handle value within the ida range should not be handled in BIG Edward Adam Davis
2024-06-16 10:37 ` Pavel Skripkin
@ 2024-06-16 10:59 ` bluez.test.bot
2024-06-16 13:21 ` [PATCH] Bluetooth: handle value is too large should not be used " Edward Adam Davis
1 sibling, 1 reply; 14+ messages in thread
From: bluez.test.bot @ 2024-06-16 10:59 UTC (permalink / raw)
To: linux-bluetooth, eadavis
[-- Attachment #1: Type: text/plain, Size: 4976 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=862356
---Test result---
Test Summary:
CheckPatch FAIL 0.86 seconds
GitLint FAIL 0.47 seconds
SubjectPrefix FAIL 0.28 seconds
BuildKernel PASS 29.86 seconds
CheckAllWarning PASS 33.44 seconds
CheckSparse WARNING 38.13 seconds
CheckSmatch WARNING 102.54 seconds
BuildKernel32 PASS 29.65 seconds
TestRunnerSetup PASS 527.95 seconds
TestRunner_l2cap-tester PASS 18.19 seconds
TestRunner_iso-tester PASS 32.28 seconds
TestRunner_bnep-tester PASS 4.81 seconds
TestRunner_mgmt-tester FAIL 110.14 seconds
TestRunner_rfcomm-tester PASS 7.36 seconds
TestRunner_sco-tester PASS 15.04 seconds
TestRunner_ioctl-tester PASS 10.65 seconds
TestRunner_mesh-tester PASS 7.88 seconds
TestRunner_smp-tester PASS 6.80 seconds
TestRunner_userchan-tester PASS 4.96 seconds
IncrementalBuild PASS 27.95 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
bluetooth: handle value within the ida range should not be handled in BIG
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#89:
hci_le_big_sync_established_evt is necessary to filter out cases where the handle
WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report
#94:
Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
ERROR: code indent should use tabs where possible
#108: FILE: net/bluetooth/hci_event.c:6896:
+ if (handle > HCI_CONN_HANDLE_MAX)$
WARNING: please, no spaces at the start of a line
#108: FILE: net/bluetooth/hci_event.c:6896:
+ if (handle > HCI_CONN_HANDLE_MAX)$
WARNING: suspect code indent for conditional statements (24, 31)
#108: FILE: net/bluetooth/hci_event.c:6896:
+ if (handle > HCI_CONN_HANDLE_MAX)
+ continue;
ERROR: code indent should use tabs where possible
#109: FILE: net/bluetooth/hci_event.c:6897:
+ continue;$
WARNING: please, no spaces at the start of a line
#109: FILE: net/bluetooth/hci_event.c:6897:
+ continue;$
total: 2 errors, 5 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.
NOTE: Whitespace errors detected.
You may wish to use scripts/cleanpatch or scripts/cleanfile
/github/workspace/src/src/13699512.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: handle value within the ida range should not be handled in BIG
WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
3: B1 Line exceeds max length (81>80): "hci_le_big_sync_established_evt is necessary to filter out cases where the handle"
4: B2 Line has trailing whitespace: "value is belone to ida id range, otherwise ida will be erroneously released in "
5: B2 Line has trailing whitespace: "hci_conn_cleanup. "
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 492, Passed: 489 (99.4%), Failed: 1, Not Run: 2
Failed Test Cases
LL Privacy - Add Device 7 (AL is full) Failed 0.190 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [syzbot] [bluetooth?] WARNING in hci_conn_del
2024-06-16 10:37 ` Pavel Skripkin
@ 2024-06-16 13:18 ` Edward Adam Davis
0 siblings, 0 replies; 14+ messages in thread
From: Edward Adam Davis @ 2024-06-16 13:18 UTC (permalink / raw)
To: paskripkin
Cc: davem, eadavis, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzbot+b2545b087a01a7319474, syzkaller-bugs, william.xuanziyang
On Sun, 16 Jun 2024 13:37:17 +0300, Pavel Skripkin wrote:
> > hci_le_big_sync_established_evt is necessary to filter out cases where the handle
> > value is belone to ida id range, otherwise ida will be erroneously released in
> > hci_conn_cleanup.
> >
> > Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
> > Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
> > Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> > ---
>
> There is one more user of `hci_conn_add` which may pass too big handle
> which is `hci_le_cis_req_evt`.
This case only affect hci_le_big_sync_established_evt.
--
Edward
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] Bluetooth: handle value is too large should not be used in BIG
2024-06-16 10:59 ` bluetooth: handle value within the ida range should not be handled in BIG bluez.test.bot
@ 2024-06-16 13:21 ` Edward Adam Davis
2024-06-16 14:33 ` bluez.test.bot
2024-06-16 20:44 ` [PATCH] " Paul Menzel
0 siblings, 2 replies; 14+ messages in thread
From: Edward Adam Davis @ 2024-06-16 13:21 UTC (permalink / raw)
To: bluez.test.bot
Cc: davem, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzkaller-bugs, william.xuanziyang
hci_le_big_sync_established_evt is necessary to filter out cases where the
handle value is belone to ida id range, otherwise ida will be erroneously
released in hci_conn_cleanup.
Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
net/bluetooth/hci_event.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a487f9df8145..eb1d5a2c48ee 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6893,6 +6893,9 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
bis = hci_conn_hash_lookup_handle(hdev, handle);
if (!bis) {
+ if (handle > HCI_CONN_HANDLE_MAX)
+ continue;
+
bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
HCI_ROLE_SLAVE, handle);
if (IS_ERR(bis))
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* RE: Bluetooth: handle value is too large should not be used in BIG
2024-06-16 13:21 ` [PATCH] Bluetooth: handle value is too large should not be used " Edward Adam Davis
@ 2024-06-16 14:33 ` bluez.test.bot
2024-06-16 20:44 ` [PATCH] " Paul Menzel
1 sibling, 0 replies; 14+ messages in thread
From: bluez.test.bot @ 2024-06-16 14:33 UTC (permalink / raw)
To: linux-bluetooth, eadavis
[-- Attachment #1: Type: text/plain, Size: 2093 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=862371
---Test result---
Test Summary:
CheckPatch PASS 0.47 seconds
GitLint PASS 0.19 seconds
SubjectPrefix PASS 0.05 seconds
BuildKernel PASS 30.65 seconds
CheckAllWarning PASS 33.08 seconds
CheckSparse WARNING 38.43 seconds
CheckSmatch WARNING 103.85 seconds
BuildKernel32 PASS 29.56 seconds
TestRunnerSetup PASS 533.58 seconds
TestRunner_l2cap-tester PASS 18.51 seconds
TestRunner_iso-tester PASS 37.01 seconds
TestRunner_bnep-tester PASS 4.80 seconds
TestRunner_mgmt-tester FAIL 113.65 seconds
TestRunner_rfcomm-tester PASS 7.67 seconds
TestRunner_sco-tester PASS 17.04 seconds
TestRunner_ioctl-tester PASS 7.94 seconds
TestRunner_mesh-tester PASS 5.89 seconds
TestRunner_smp-tester PASS 6.91 seconds
TestRunner_userchan-tester PASS 5.06 seconds
IncrementalBuild PASS 28.50 seconds
Details
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 492, Passed: 489 (99.4%), Failed: 1, Not Run: 2
Failed Test Cases
LL Privacy - Add Device 5 (2 Devices to RL) Failed 0.174 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] Bluetooth: handle value is too large should not be used in BIG
2024-06-16 13:21 ` [PATCH] Bluetooth: handle value is too large should not be used " Edward Adam Davis
2024-06-16 14:33 ` bluez.test.bot
@ 2024-06-16 20:44 ` Paul Menzel
2024-06-17 11:09 ` [PATCH v2] Bluetooth: Ignore too large handle values " Edward Adam Davis
1 sibling, 1 reply; 14+ messages in thread
From: Paul Menzel @ 2024-06-16 20:44 UTC (permalink / raw)
To: Edward Adam Davis
Cc: davem, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzkaller-bugs, william.xuanziyang
Dear Edward,
Thank you for your patch. It’d be nice if you made the commit message
about the action, like:
Bluetooth: Ignore too large handle values in BIG
Am 16.06.24 um 15:21 schrieb Edward Adam Davis:
> hci_le_big_sync_established_evt is necessary to filter out cases where the
> handle value is belone to ida id range, otherwise ida will be erroneously
belone? Is it belonging?
> released in hci_conn_cleanup.
>
> Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
> Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
> net/bluetooth/hci_event.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index a487f9df8145..eb1d5a2c48ee 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -6893,6 +6893,9 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
>
> bis = hci_conn_hash_lookup_handle(hdev, handle);
> if (!bis) {
> + if (handle > HCI_CONN_HANDLE_MAX)
> + continue;
> +
Should some debug message be printed?
> bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
> HCI_ROLE_SLAVE, handle);
> if (IS_ERR(bis))
Kind regards,
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] Bluetooth: Ignore too large handle values in BIG
2024-06-16 20:44 ` [PATCH] " Paul Menzel
@ 2024-06-17 11:09 ` Edward Adam Davis
2024-06-17 11:57 ` [v2] " bluez.test.bot
2024-06-17 14:10 ` [PATCH v2] " patchwork-bot+bluetooth
0 siblings, 2 replies; 14+ messages in thread
From: Edward Adam Davis @ 2024-06-17 11:09 UTC (permalink / raw)
To: pmenzel
Cc: davem, eadavis, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzkaller-bugs, william.xuanziyang
hci_le_big_sync_established_evt is necessary to filter out cases where the
handle value is belonging to ida id range, otherwise ida will be erroneously
released in hci_conn_cleanup.
Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
net/bluetooth/hci_event.c | 4 +++
1 file changed, 4 insertions(+)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a487f9df8145..3966fbc38df9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6893,6 +6893,10 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
bis = hci_conn_hash_lookup_handle(hdev, handle);
if (!bis) {
+ if (handle > HCI_CONN_HANDLE_MAX) {
+ bt_dev_dbg(hdev, "ignore too large handle %u", handle);
+ continue;
+ }
bis = hci_conn_add(hdev, ISO_LINK, BDADDR_ANY,
HCI_ROLE_SLAVE, handle);
if (IS_ERR(bis))
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* RE: [v2] Bluetooth: Ignore too large handle values in BIG
2024-06-17 11:09 ` [PATCH v2] Bluetooth: Ignore too large handle values " Edward Adam Davis
@ 2024-06-17 11:57 ` bluez.test.bot
2024-06-17 14:10 ` [PATCH v2] " patchwork-bot+bluetooth
1 sibling, 0 replies; 14+ messages in thread
From: bluez.test.bot @ 2024-06-17 11:57 UTC (permalink / raw)
To: linux-bluetooth, eadavis
[-- Attachment #1: Type: text/plain, Size: 2594 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=862580
---Test result---
Test Summary:
CheckPatch FAIL 2.06 seconds
GitLint PASS 4.56 seconds
SubjectPrefix PASS 0.62 seconds
BuildKernel PASS 29.96 seconds
CheckAllWarning PASS 32.46 seconds
CheckSparse WARNING 40.13 seconds
CheckSmatch WARNING 102.67 seconds
BuildKernel32 PASS 28.72 seconds
TestRunnerSetup PASS 524.19 seconds
TestRunner_l2cap-tester PASS 18.30 seconds
TestRunner_iso-tester PASS 35.14 seconds
TestRunner_bnep-tester PASS 5.30 seconds
TestRunner_mgmt-tester PASS 111.24 seconds
TestRunner_rfcomm-tester PASS 7.65 seconds
TestRunner_sco-tester PASS 12.97 seconds
TestRunner_ioctl-tester PASS 7.84 seconds
TestRunner_mesh-tester PASS 5.98 seconds
TestRunner_smp-tester PASS 6.88 seconds
TestRunner_userchan-tester PASS 5.01 seconds
IncrementalBuild PASS 28.44 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v2] Bluetooth: Ignore too large handle values in BIG
WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#91:
handle value is belonging to ida id range, otherwise ida will be erroneously
total: 0 errors, 1 warnings, 0 checks, 10 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/13700520.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: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2] Bluetooth: Ignore too large handle values in BIG
2024-06-17 11:09 ` [PATCH v2] Bluetooth: Ignore too large handle values " Edward Adam Davis
2024-06-17 11:57 ` [v2] " bluez.test.bot
@ 2024-06-17 14:10 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 14+ messages in thread
From: patchwork-bot+bluetooth @ 2024-06-17 14:10 UTC (permalink / raw)
To: Edward Adam Davis
Cc: pmenzel, davem, edumazet, johan.hedberg, kuba, linux-bluetooth,
linux-kernel, luiz.dentz, luiz.von.dentz, marcel, netdev, pabeni,
syzkaller-bugs, william.xuanziyang
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 17 Jun 2024 19:09:37 +0800 you wrote:
> hci_le_big_sync_established_evt is necessary to filter out cases where the
> handle value is belonging to ida id range, otherwise ida will be erroneously
> released in hci_conn_cleanup.
>
> Fixes: 181a42edddf5 ("Bluetooth: Make handle of hci_conn be unique")
> Reported-by: syzbot+b2545b087a01a7319474@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=b2545b087a01a7319474
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
>
> [...]
Here is the summary with links:
- [v2] Bluetooth: Ignore too large handle values in BIG
https://git.kernel.org/bluetooth/bluetooth-next/c/401ad9b792e1
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] 14+ messages in thread
end of thread, other threads:[~2024-06-17 14:10 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28 4:53 [syzbot] [bluetooth?] WARNING in hci_conn_del syzbot
2024-06-13 21:15 ` [syzbot] " syzbot
2024-06-16 10:14 ` [syzbot] [bluetooth?] " Edward Adam Davis
2024-06-16 10:33 ` syzbot
2024-06-16 10:20 ` [PATCH] bluetooth: handle value within the ida range should not be handled in BIG Edward Adam Davis
2024-06-16 10:37 ` Pavel Skripkin
2024-06-16 13:18 ` [syzbot] [bluetooth?] WARNING in hci_conn_del Edward Adam Davis
2024-06-16 10:59 ` bluetooth: handle value within the ida range should not be handled in BIG bluez.test.bot
2024-06-16 13:21 ` [PATCH] Bluetooth: handle value is too large should not be used " Edward Adam Davis
2024-06-16 14:33 ` bluez.test.bot
2024-06-16 20:44 ` [PATCH] " Paul Menzel
2024-06-17 11:09 ` [PATCH v2] Bluetooth: Ignore too large handle values " Edward Adam Davis
2024-06-17 11:57 ` [v2] " bluez.test.bot
2024-06-17 14:10 ` [PATCH v2] " patchwork-bot+bluetooth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.