All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name()
@ 2025-02-21  8:49 Haoxiang Li
  2025-02-21  9:32 ` [v2] " bluez.test.bot
  2025-02-24 21:10 ` [PATCH v2] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Haoxiang Li @ 2025-02-21  8:49 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz, mm, acz, rad
  Cc: linux-bluetooth, linux-kernel, Haoxiang Li, stable

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

Fixes: ba17bb62ce41 ("Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_device_connected()")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
Changes in v2:
- modify the title description.
---
 net/bluetooth/mgmt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index f53304cb09db..3e0f88cd975c 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -10413,6 +10413,8 @@ void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 
 	skb = mgmt_alloc_skb(hdev, MGMT_EV_DEVICE_FOUND,
 			     sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0));
+	if (!skb)
+		return;
 
 	ev = skb_put(skb, sizeof(*ev));
 	bacpy(&ev->addr.bdaddr, bdaddr);
-- 
2.25.1


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

* RE: [v2] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name()
  2025-02-21  8:49 [PATCH v2] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name() Haoxiang Li
@ 2025-02-21  9:32 ` bluez.test.bot
  2025-02-24 21:10 ` [PATCH v2] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-02-21  9:32 UTC (permalink / raw)
  To: linux-bluetooth, haoxiang_li2024

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

---Test result---

Test Summary:
CheckPatch                    PENDING   0.49 seconds
GitLint                       PENDING   0.28 seconds
SubjectPrefix                 PASS      0.06 seconds
BuildKernel                   PASS      24.62 seconds
CheckAllWarning               PASS      26.64 seconds
CheckSparse                   PASS      30.19 seconds
BuildKernel32                 PASS      24.38 seconds
TestRunnerSetup               PASS      428.26 seconds
TestRunner_l2cap-tester       PASS      20.95 seconds
TestRunner_iso-tester         PASS      32.39 seconds
TestRunner_bnep-tester        PASS      4.73 seconds
TestRunner_mgmt-tester        FAIL      123.01 seconds
TestRunner_rfcomm-tester      PASS      12.67 seconds
TestRunner_sco-tester         PASS      9.60 seconds
TestRunner_ioctl-tester       PASS      8.21 seconds
TestRunner_mesh-tester        PASS      6.04 seconds
TestRunner_smp-tester         PASS      7.16 seconds
TestRunner_userchan-tester    PASS      4.99 seconds
IncrementalBuild              PENDING   0.79 seconds

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

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

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 484 (98.8%), Failed: 2, Not Run: 4

Failed Test Cases
LL Privacy - Set Flags 3 (2 Devices to RL)           Failed       0.194 seconds
LL Privacy - Set Device Flag 1 (Device Privacy)      Failed       0.142 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: [PATCH v2] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name()
  2025-02-21  8:49 [PATCH v2] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name() Haoxiang Li
  2025-02-21  9:32 ` [v2] " bluez.test.bot
@ 2025-02-24 21:10 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-02-24 21:10 UTC (permalink / raw)
  To: Haoxiang Li
  Cc: marcel, johan.hedberg, luiz.dentz, mm, acz, rad, linux-bluetooth,
	linux-kernel, stable

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 21 Feb 2025 16:49:47 +0800 you wrote:
> Add check for the return value of mgmt_alloc_skb() in
> mgmt_remote_name() to prevent null pointer dereference.
> 
> Fixes: ba17bb62ce41 ("Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_device_connected()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
> 
> [...]

Here is the summary with links:
  - [v2] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name()
    https://git.kernel.org/bluetooth/bluetooth-next/c/62ee156d6b29

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] 3+ messages in thread

end of thread, other threads:[~2025-02-24 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21  8:49 [PATCH v2] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name() Haoxiang Li
2025-02-21  9:32 ` [v2] " bluez.test.bot
2025-02-24 21: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.