2024-05-02 16:28:14

by Sungwoo Kim

[permalink] [raw]
Subject: [PATCH v2] Bluetooth: HCI: Fix potential null-ptr-deref

Fix potential null-ptr-deref in hci_le_big_sync_established_evt().

Fixes: f777d8827817 (Bluetooth: ISO: Notify user space about failed bis connections)
Signed-off-by: Sungwoo Kim <[email protected]>
---
v1 -> v2:
- add a Fixes tag
- make the commit message concise

net/bluetooth/hci_event.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 4a27e4a17..d72d238c1 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -7037,6 +7037,8 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
u16 handle = le16_to_cpu(ev->bis[i]);

bis = hci_conn_hash_lookup_handle(hdev, handle);
+ if (!bis)
+ continue;

set_bit(HCI_CONN_BIG_SYNC_FAILED, &bis->flags);
hci_connect_cfm(bis, ev->status);
--
2.34.1



2024-05-02 17:19:25

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v2] Bluetooth: HCI: Fix potential null-ptr-deref

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=849964

---Test result---

Test Summary:
CheckPatch FAIL 1.14 seconds
GitLint PASS 0.31 seconds
SubjectPrefix PASS 0.19 seconds
BuildKernel PASS 29.68 seconds
CheckAllWarning PASS 32.60 seconds
CheckSparse WARNING 38.20 seconds
CheckSmatch FAIL 34.98 seconds
BuildKernel32 PASS 28.80 seconds
TestRunnerSetup PASS 515.43 seconds
TestRunner_l2cap-tester PASS 20.45 seconds
TestRunner_iso-tester PASS 31.36 seconds
TestRunner_bnep-tester PASS 4.68 seconds
TestRunner_mgmt-tester PASS 109.26 seconds
TestRunner_rfcomm-tester PASS 7.23 seconds
TestRunner_sco-tester PASS 15.07 seconds
TestRunner_ioctl-tester PASS 7.67 seconds
TestRunner_mesh-tester PASS 5.80 seconds
TestRunner_smp-tester PASS 6.77 seconds
TestRunner_userchan-tester PASS 4.88 seconds
IncrementalBuild PASS 27.83 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v2] Bluetooth: HCI: Fix potential null-ptr-deref
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: ("Bluetooth: ISO: Notify user space about failed bis connections")'
#81:
Fixes: f777d8827817 (Bluetooth: ISO: Notify user space about failed bis connections)

total: 0 errors, 1 warnings, 0 checks, 8 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/13651869.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.


Use of uninitialized value $cid in concatenation (.) or string at /github/workspace/src/src/scripts/checkpatch.pl line 3229.
##############################
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 - FAIL
Desc: Run smatch tool with source
Output:

Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/hci_core.o] Error 139
make[4]: *** Deleting file 'net/bluetooth/hci_core.o'
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bcm203x.o] Error 139
make[4]: *** Deleting file 'drivers/bluetooth/bcm203x.o'
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: drivers] Error 2
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2


---
Regards,
Linux Bluetooth