All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bluetooth: Add check for mgmt_alloc_skb()
@ 2025-02-18 13:26 Haoxiang Li
  2025-02-18 13:59 ` bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Haoxiang Li @ 2025-02-18 13:26 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz
  Cc: linux-bluetooth, linux-kernel, Haoxiang Li, stable

Add check for the return value of mgmt_alloc_skb() in
mgmt_device_connected() to prevent null pointer dereference.

Fixes: e96741437ef0 ("Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CONNECTED")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
 net/bluetooth/mgmt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index f53304cb09db..1f028c5105ca 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -9660,6 +9660,8 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
 				     sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0) +
 				     eir_precalc_len(sizeof(conn->dev_class)));
 
+	if (!skb)
+		return;
 	ev = skb_put(skb, sizeof(*ev));
 	bacpy(&ev->addr.bdaddr, &conn->dst);
 	ev->addr.type = link_to_bdaddr(conn->type, conn->dst_type);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: bluetooth: Add check for mgmt_alloc_skb()
  2025-02-18 13:26 [PATCH] bluetooth: Add check for mgmt_alloc_skb() Haoxiang Li
@ 2025-02-18 13:59 ` bluez.test.bot
  0 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-02-18 13:59 UTC (permalink / raw)
  To: linux-bluetooth, haoxiang_li2024

[-- Attachment #1: Type: text/plain, Size: 3503 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=935106

---Test result---

Test Summary:
CheckPatch                    PENDING   0.60 seconds
GitLint                       PENDING   0.19 seconds
SubjectPrefix                 FAIL      0.33 seconds
BuildKernel                   PASS      24.29 seconds
CheckAllWarning               PASS      29.46 seconds
CheckSparse                   PASS      30.19 seconds
BuildKernel32                 PASS      23.65 seconds
TestRunnerSetup               PASS      430.69 seconds
TestRunner_l2cap-tester       PASS      20.96 seconds
TestRunner_iso-tester         FAIL      141.39 seconds
TestRunner_bnep-tester        PASS      4.98 seconds
TestRunner_mgmt-tester        FAIL      137.52 seconds
TestRunner_rfcomm-tester      PASS      7.91 seconds
TestRunner_sco-tester         PASS      9.95 seconds
TestRunner_ioctl-tester       PASS      8.24 seconds
TestRunner_mesh-tester        PASS      5.93 seconds
TestRunner_smp-tester         PASS      7.26 seconds
TestRunner_userchan-tester    PASS      4.99 seconds
IncrementalBuild              PENDING   0.42 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 125, Passed: 109 (87.2%), Failed: 12, Not Run: 4

Failed Test Cases
ISO Defer Connect2 CIG 0x01 - Success                Timed out    2.338 seconds
ISO Connected2 Suspend - Success                     Timed out    2.741 seconds
ISO AC 6(ii) - Success                               Timed out    1.918 seconds
ISO AC 7(ii) - Success                               Timed out    2.512 seconds
ISO AC 8(ii) - Success                               Timed out    2.511 seconds
ISO AC 9(ii) - Success                               Timed out    2.540 seconds
ISO AC 11(ii) - Success                              Timed out    2.506 seconds
ISO AC 1 + 2 - Success                               Timed out    1.968 seconds
ISO AC 1 + 2 CIG 0x01/0x02 - Success                 Timed out    2.001 seconds
ISO Reconnect AC 6(i) - Success                      Timed out    2.024 seconds
ISO Reconnect AC 6(ii) - Success                     Timed out    2.000 seconds
ISO AC 6(ii) CIS 0xEF/auto - Success                 Timed out    2.000 seconds
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 482 (98.4%), Failed: 4, Not Run: 4

Failed Test Cases
LL Privacy - Set Flags 3 (2 Devices to RL)           Failed       0.170 seconds
LL Privacy - Unpair 1                                Timed out    2.131 seconds
LL Privacy - Unpair 2 (Remove from AL)               Failed       2.548 seconds
LL Privacy - Set Device Flag 1 (Device Privacy)      Failed       0.147 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: bluetooth: Add check for mgmt_alloc_skb()
  2025-02-18 13:35 [PATCH] " Haoxiang Li
@ 2025-02-18 14:34 ` bluez.test.bot
  0 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-02-18 14:34 UTC (permalink / raw)
  To: linux-bluetooth, haoxiang_li2024

[-- Attachment #1: Type: text/plain, Size: 3503 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=935110

---Test result---

Test Summary:
CheckPatch                    PENDING   0.30 seconds
GitLint                       PENDING   0.20 seconds
SubjectPrefix                 FAIL      0.40 seconds
BuildKernel                   PASS      24.88 seconds
CheckAllWarning               PASS      27.93 seconds
CheckSparse                   PASS      31.65 seconds
BuildKernel32                 PASS      24.58 seconds
TestRunnerSetup               PASS      438.79 seconds
TestRunner_l2cap-tester       PASS      21.28 seconds
TestRunner_iso-tester         FAIL      144.87 seconds
TestRunner_bnep-tester        PASS      4.93 seconds
TestRunner_mgmt-tester        FAIL      130.25 seconds
TestRunner_rfcomm-tester      PASS      8.06 seconds
TestRunner_sco-tester         PASS      9.69 seconds
TestRunner_ioctl-tester       PASS      8.59 seconds
TestRunner_mesh-tester        PASS      6.24 seconds
TestRunner_smp-tester         PASS      7.57 seconds
TestRunner_userchan-tester    PASS      5.32 seconds
IncrementalBuild              PENDING   0.56 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 125, Passed: 109 (87.2%), Failed: 12, Not Run: 4

Failed Test Cases
ISO Defer Connect2 CIG 0x01 - Success                Timed out    2.274 seconds
ISO Connected2 Suspend - Success                     Timed out    2.748 seconds
ISO AC 6(ii) - Success                               Timed out    1.911 seconds
ISO AC 7(ii) - Success                               Timed out    2.514 seconds
ISO AC 8(ii) - Success                               Timed out    2.521 seconds
ISO AC 9(ii) - Success                               Timed out    2.514 seconds
ISO AC 11(ii) - Success                              Timed out    2.517 seconds
ISO AC 1 + 2 - Success                               Timed out    1.973 seconds
ISO AC 1 + 2 CIG 0x01/0x02 - Success                 Timed out    2.003 seconds
ISO Reconnect AC 6(i) - Success                      Timed out    2.014 seconds
ISO Reconnect AC 6(ii) - Success                     Timed out    2.001 seconds
ISO AC 6(ii) CIS 0xEF/auto - Success                 Timed out    2.007 seconds
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 482 (98.4%), Failed: 4, Not Run: 4

Failed Test Cases
LL Privacy - Add Device 3 (AL is full)               Failed       0.197 seconds
LL Privacy - Set Flags 3 (2 Devices to RL)           Failed       0.187 seconds
LL Privacy - Unpair 1                                Timed out    2.004 seconds
LL Privacy - Unpair 2 (Remove from AL)               Failed       2.557 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-18 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18 13:26 [PATCH] bluetooth: Add check for mgmt_alloc_skb() Haoxiang Li
2025-02-18 13:59 ` bluez.test.bot
  -- strict thread matches above, loose matches on Subject: below --
2025-02-18 13:35 [PATCH] " Haoxiang Li
2025-02-18 14:34 ` bluez.test.bot

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.