linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
@ 2024-12-31  6:57 max.chou
  2024-12-31  7:31 ` bluez.test.bot
  2025-01-09 16:17 ` [PATCH] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: max.chou @ 2024-12-31  6:57 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth,
	linux-kernel
  Cc: Hilda Wu, alex_lu, Max Chou

From: Max Chou <max.chou@realtek.com>

If insert an USB dongle which chip is not maintained in ic_id_table, it
will hit the NULL point accessed. Add a null point check to avoid the
Kernel Oops.

Fixes: b39910bb54d9 ("Bluetooth: Populate hci_set_hw_info for Intel and Realtek")
Reviewed-by: Alex Lu <alex_lu@realsil.com.cn>
Signed-off-by: Max Chou <max.chou@realtek.com>
---
 drivers/bluetooth/btrtl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 83025f457ca0..d3eba0d4a57d 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -1351,12 +1351,14 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
 
 	btrtl_set_quirks(hdev, btrtl_dev);
 
-	hci_set_hw_info(hdev,
+	if (btrtl_dev->ic_info) {
+		hci_set_hw_info(hdev,
 			"RTL lmp_subver=%u hci_rev=%u hci_ver=%u hci_bus=%u",
 			btrtl_dev->ic_info->lmp_subver,
 			btrtl_dev->ic_info->hci_rev,
 			btrtl_dev->ic_info->hci_ver,
 			btrtl_dev->ic_info->hci_bus);
+	}
 
 	btrtl_free(btrtl_dev);
 	return ret;
-- 
2.43.0


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

* RE: Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
  2024-12-31  6:57 [PATCH] Bluetooth: btrtl: check for NULL in btrtl_setup_realtek() max.chou
@ 2024-12-31  7:31 ` bluez.test.bot
  2025-01-09 16:17 ` [PATCH] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-12-31  7:31 UTC (permalink / raw)
  To: linux-bluetooth, max.chou

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

---Test result---

Test Summary:
CheckPatch                    PENDING   0.38 seconds
GitLint                       PENDING   0.43 seconds
SubjectPrefix                 PASS      0.07 seconds
BuildKernel                   PASS      25.78 seconds
CheckAllWarning               PASS      27.93 seconds
CheckSparse                   PASS      31.26 seconds
BuildKernel32                 PASS      25.25 seconds
TestRunnerSetup               PASS      445.05 seconds
TestRunner_l2cap-tester       PASS      20.67 seconds
TestRunner_iso-tester         PASS      36.51 seconds
TestRunner_bnep-tester        PASS      4.89 seconds
TestRunner_mgmt-tester        FAIL      126.21 seconds
TestRunner_rfcomm-tester      PASS      7.63 seconds
TestRunner_sco-tester         PASS      9.47 seconds
TestRunner_ioctl-tester       PASS      9.00 seconds
TestRunner_mesh-tester        FAIL      6.30 seconds
TestRunner_smp-tester         PASS      7.10 seconds
TestRunner_userchan-tester    PASS      5.09 seconds
IncrementalBuild              PENDING   1.01 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 - Add Device 2 (2 Devices to AL)          Failed       0.168 seconds
LL Privacy - Set Flags 3 (2 Devices to RL)           Failed       0.165 seconds
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
BUG: KASAN: slab-use-after-free in run_timer_softirq+0x76c/0x7d0
WARNING: CPU: 0 PID: 65 at kernel/workqueue.c:2257 __queue_work+0x687/0xb40
Total: 10, Passed: 9 (90.0%), Failed: 1, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Failed       0.116 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] Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
  2024-12-31  6:57 [PATCH] Bluetooth: btrtl: check for NULL in btrtl_setup_realtek() max.chou
  2024-12-31  7:31 ` bluez.test.bot
@ 2025-01-09 16:17 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-01-09 16:17 UTC (permalink / raw)
  To: Max Chou
  Cc: marcel, luiz.dentz, linux-bluetooth, linux-kernel, hildawu,
	alex_lu

Hello:

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

On Tue, 31 Dec 2024 14:57:19 +0800 you wrote:
> From: Max Chou <max.chou@realtek.com>
> 
> If insert an USB dongle which chip is not maintained in ic_id_table, it
> will hit the NULL point accessed. Add a null point check to avoid the
> Kernel Oops.
> 
> Fixes: b39910bb54d9 ("Bluetooth: Populate hci_set_hw_info for Intel and Realtek")
> Reviewed-by: Alex Lu <alex_lu@realsil.com.cn>
> Signed-off-by: Max Chou <max.chou@realtek.com>
> 
> [...]

Here is the summary with links:
  - Bluetooth: btrtl: check for NULL in btrtl_setup_realtek()
    https://git.kernel.org/bluetooth/bluetooth-next/c/402e07c75d07

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-01-09 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-31  6:57 [PATCH] Bluetooth: btrtl: check for NULL in btrtl_setup_realtek() max.chou
2024-12-31  7:31 ` bluez.test.bot
2025-01-09 16:17 ` [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;
as well as URLs for NNTP newsgroup(s).