* [PATCH v2 0/2] Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak
@ 2026-09-15 5:40 Zijun Hu
2026-09-15 5:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Zijun Hu
2026-09-15 5:40 ` [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump() Zijun Hu
0 siblings, 2 replies; 8+ messages in thread
From: Zijun Hu @ 2026-09-15 5:40 UTC (permalink / raw)
To: Amitkumar Karwar, Neeraj Kale, Marcel Holtmann,
Luiz Augusto von Dentz
Cc: Zijun Hu, linux-bluetooth, linux-kernel, Luiz Augusto von Dentz,
Zijun Hu
This series simplifies ACL handle extraction in btnxpuart and fixes
an skb leak when devcoredump support is disabled, — all simple.
---
Changes in v2:
- Add a minor ACL handle-extraction simplification in btnxpuart.
- Fix the skb leak in btnxpuart when devcoredump support is disabled.
- Link to v1: https://patch.msgid.link/20260913-misc_fix-v1-0-558c1e4028b9@oss.qualcomm.com
---
Zijun Hu (2):
Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle()
Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump()
drivers/bluetooth/btnxpuart.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 0186e4e1e5c26a21058a263cccd878fbf894677e
change-id: 20260913-misc_fix-6f6f518fe6b5
Best regards,
--
Zijun Hu <zijun.hu@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle()
2026-09-15 5:40 [PATCH v2 0/2] Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak Zijun Hu
@ 2026-09-15 5:40 ` Zijun Hu
2026-09-15 7:25 ` Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak bluez.test.bot
2026-09-15 7:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Neeraj Kale
2026-09-15 5:40 ` [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump() Zijun Hu
1 sibling, 2 replies; 8+ messages in thread
From: Zijun Hu @ 2026-09-15 5:40 UTC (permalink / raw)
To: Amitkumar Karwar, Neeraj Kale, Marcel Holtmann,
Luiz Augusto von Dentz
Cc: Zijun Hu, linux-bluetooth, linux-kernel, Luiz Augusto von Dentz,
Zijun Hu
Simplify nxp_recv_acl_pkt() by using hci_acl_handle() instead of:
__u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
... (handle & 0x0FFF) ...
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
drivers/bluetooth/btnxpuart.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index f2bbe6e462aa..69e897444112 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1400,20 +1400,18 @@ static int nxp_process_fw_dump(struct hci_dev *hdev, struct sk_buff *skb)
free_skb:
kfree_skb(skb);
return 0;
}
static int nxp_recv_acl_pkt(struct hci_dev *hdev, struct sk_buff *skb)
{
- __u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
-
/* FW dump chunks are ACL packets with conn handle 0xfff */
- if ((handle & 0x0FFF) == 0xFFF)
+ if (hci_acl_handle(skb) == 0xFFF)
return nxp_process_fw_dump(hdev, skb);
else
return hci_recv_frame(hdev, skb);
}
static int nxp_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
{
union nxp_set_bd_addr_payload pcmd;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* RE: Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak
2026-09-15 5:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Zijun Hu
@ 2026-09-15 7:25 ` bluez.test.bot
2026-09-15 7:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Neeraj Kale
1 sibling, 0 replies; 8+ messages in thread
From: bluez.test.bot @ 2026-09-15 7:25 UTC (permalink / raw)
To: linux-bluetooth, zijun.hu
[-- Attachment #1: Type: text/plain, Size: 1019 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/series/1165096/
---Test result---
Test Summary:
CheckPatch PASS 0.97 seconds
VerifyFixes PASS 0.07 seconds
VerifySignedoff PASS 0.07 seconds
GitLint PASS 0.58 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 22.43 seconds
CheckAllWarning PASS 25.40 seconds
CheckSparse PASS 28.19 seconds
BuildKernel32 PASS 22.29 seconds
CheckKernelLLVM PASS 23.99 seconds
TestRunnerSetup PASS 568.19 seconds
IncrementalBuild PASS 24.19 seconds
https://github.com/bluez/bluetooth-next/pull/770
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle()
2026-09-15 5:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Zijun Hu
2026-09-15 7:25 ` Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak bluez.test.bot
@ 2026-09-15 7:40 ` Neeraj Kale
1 sibling, 0 replies; 8+ messages in thread
From: Neeraj Kale @ 2026-09-15 7:40 UTC (permalink / raw)
To: Zijun Hu, Amitkumar Karwar, Marcel Holtmann,
Luiz Augusto von Dentz
Cc: Zijun Hu, linux-bluetooth@vger.kernel.org,
linux-kernel@vger.kernel.org, Luiz Augusto von Dentz, Song Xue,
Alex Zhou
Hi Zijun,
Thank you for the patch. The fix looks good to me.
Reviewed-by: Neeraj Sanjay Kale neeraj.sanjaykale@nxp.com
Thanks,
Neeraj
> Simplify nxp_recv_acl_pkt() by using hci_acl_handle() instead of:
>
> __u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
> ... (handle & 0x0FFF) ...
>
> Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
> ---
> drivers/bluetooth/btnxpuart.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
> index f2bbe6e462aa..69e897444112 100644
> --- a/drivers/bluetooth/btnxpuart.c
> +++ b/drivers/bluetooth/btnxpuart.c
> @@ -1400,20 +1400,18 @@ static int nxp_process_fw_dump(struct hci_dev
> *hdev, struct sk_buff *skb)
>
> free_skb:
> kfree_skb(skb);
> return 0;
> }
>
> static int nxp_recv_acl_pkt(struct hci_dev *hdev, struct sk_buff *skb) {
> - __u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
> -
> /* FW dump chunks are ACL packets with conn handle 0xfff */
> - if ((handle & 0x0FFF) == 0xFFF)
> + if (hci_acl_handle(skb) == 0xFFF)
> return nxp_process_fw_dump(hdev, skb);
> else
> return hci_recv_frame(hdev, skb); }
>
> static int nxp_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) {
> union nxp_set_bd_addr_payload pcmd;
>
> --
> 2.34.1
NXP Confidential
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump()
2026-09-15 5:40 [PATCH v2 0/2] Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak Zijun Hu
2026-09-15 5:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Zijun Hu
@ 2026-09-15 5:40 ` Zijun Hu
2026-09-15 7:41 ` Neeraj Kale
2026-09-15 14:12 ` Luiz Augusto von Dentz
1 sibling, 2 replies; 8+ messages in thread
From: Zijun Hu @ 2026-09-15 5:40 UTC (permalink / raw)
To: Amitkumar Karwar, Neeraj Kale, Marcel Holtmann,
Luiz Augusto von Dentz
Cc: Zijun Hu, linux-bluetooth, linux-kernel, Luiz Augusto von Dentz,
Zijun Hu
When CONFIG_DEV_COREDUMP=n, hci_devcd_append() returns -EOPNOTSUPP
without freeing its skb argument. This leaks the cloned skb and also
prevents nxp_set_ind_reset() from being called to perform recovery.
Fix by guarding hci_devcd_append(hdev, skb_clone(skb, GFP_ATOMIC)) with
CONFIG_DEV_COREDUMP.
Fixes: 998e447f443f ("Bluetooth: btnxpuart: Add support for HCI coredump feature")
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
drivers/bluetooth/btnxpuart.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 69e897444112..a0b64fdcbcc1 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1383,19 +1383,21 @@ static int nxp_process_fw_dump(struct hci_dev *hdev, struct sk_buff *skb)
err = hci_devcd_init(hdev, NXP_FW_DUMP_SIZE);
if (err < 0)
goto free_skb;
schedule_delayed_work(&hdev->dump.dump_timeout,
msecs_to_jiffies(20000));
}
+#ifdef CONFIG_DEV_COREDUMP
err = hci_devcd_append(hdev, skb_clone(skb, GFP_ATOMIC));
if (err < 0)
goto free_skb;
+#endif
if (buf_len == 0) {
bt_dev_warn(hdev, "==== FW dump complete ===");
hci_devcd_complete(hdev);
nxp_set_ind_reset(hdev, NULL);
}
free_skb:
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump()
2026-09-15 5:40 ` [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump() Zijun Hu
@ 2026-09-15 7:41 ` Neeraj Kale
2026-09-15 14:12 ` Luiz Augusto von Dentz
1 sibling, 0 replies; 8+ messages in thread
From: Neeraj Kale @ 2026-09-15 7:41 UTC (permalink / raw)
To: Zijun Hu, Amitkumar Karwar, Marcel Holtmann,
Luiz Augusto von Dentz
Cc: Zijun Hu, linux-bluetooth@vger.kernel.org,
linux-kernel@vger.kernel.org, Luiz Augusto von Dentz
Hi Zijun,
Thank you for the patch. The fix looks good to me.
Reviewed-by: Neeraj Sanjay Kale neeraj.sanjaykale@nxp.com
Thanks,
Neeraj
> When CONFIG_DEV_COREDUMP=n, hci_devcd_append() returns -
> EOPNOTSUPP without freeing its skb argument. This leaks the cloned skb and
> also prevents nxp_set_ind_reset() from being called to perform recovery.
>
> Fix by guarding hci_devcd_append(hdev, skb_clone(skb, GFP_ATOMIC)) with
> CONFIG_DEV_COREDUMP.
>
> Fixes: 998e447f443f ("Bluetooth: btnxpuart: Add support for HCI coredump
> feature")
> Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
> ---
> drivers/bluetooth/btnxpuart.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
> index 69e897444112..a0b64fdcbcc1 100644
> --- a/drivers/bluetooth/btnxpuart.c
> +++ b/drivers/bluetooth/btnxpuart.c
> @@ -1383,19 +1383,21 @@ static int nxp_process_fw_dump(struct hci_dev
> *hdev, struct sk_buff *skb)
> err = hci_devcd_init(hdev, NXP_FW_DUMP_SIZE);
> if (err < 0)
> goto free_skb;
>
> schedule_delayed_work(&hdev->dump.dump_timeout,
> msecs_to_jiffies(20000));
> }
>
> +#ifdef CONFIG_DEV_COREDUMP
> err = hci_devcd_append(hdev, skb_clone(skb, GFP_ATOMIC));
> if (err < 0)
> goto free_skb;
> +#endif
>
> if (buf_len == 0) {
> bt_dev_warn(hdev, "==== FW dump complete ===");
> hci_devcd_complete(hdev);
> nxp_set_ind_reset(hdev, NULL);
> }
>
> free_skb:
>
> --
> 2.34.1
NXP Confidential
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump()
2026-09-15 5:40 ` [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump() Zijun Hu
2026-09-15 7:41 ` Neeraj Kale
@ 2026-09-15 14:12 ` Luiz Augusto von Dentz
1 sibling, 0 replies; 8+ messages in thread
From: Luiz Augusto von Dentz @ 2026-09-15 14:12 UTC (permalink / raw)
To: Zijun Hu
Cc: Amitkumar Karwar, Neeraj Kale, Marcel Holtmann, Zijun Hu,
linux-bluetooth, linux-kernel, Luiz Augusto von Dentz
Hi Zijun,
On Tue, Sep 15, 2026 at 1:41 AM Zijun Hu <zijun.hu@oss.qualcomm.com> wrote:
>
> When CONFIG_DEV_COREDUMP=n, hci_devcd_append() returns -EOPNOTSUPP
> without freeing its skb argument. This leaks the cloned skb and also
> prevents nxp_set_ind_reset() from being called to perform recovery.
>
> Fix by guarding hci_devcd_append(hdev, skb_clone(skb, GFP_ATOMIC)) with
> CONFIG_DEV_COREDUMP.
>
> Fixes: 998e447f443f ("Bluetooth: btnxpuart: Add support for HCI coredump feature")
> Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
> ---
> drivers/bluetooth/btnxpuart.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
> index 69e897444112..a0b64fdcbcc1 100644
> --- a/drivers/bluetooth/btnxpuart.c
> +++ b/drivers/bluetooth/btnxpuart.c
> @@ -1383,19 +1383,21 @@ static int nxp_process_fw_dump(struct hci_dev *hdev, struct sk_buff *skb)
> err = hci_devcd_init(hdev, NXP_FW_DUMP_SIZE);
> if (err < 0)
> goto free_skb;
>
> schedule_delayed_work(&hdev->dump.dump_timeout,
> msecs_to_jiffies(20000));
> }
>
> +#ifdef CONFIG_DEV_COREDUMP
> err = hci_devcd_append(hdev, skb_clone(skb, GFP_ATOMIC));
> if (err < 0)
> goto free_skb;
> +#endif
I guess IS_ENABLED is preferable here so the code is still compiled in
leaving it up to the compiler to remove it in case it is considered
dead code.
>
> if (buf_len == 0) {
> bt_dev_warn(hdev, "==== FW dump complete ===");
> hci_devcd_complete(hdev);
> nxp_set_ind_reset(hdev, NULL);
> }
>
> free_skb:
>
> --
> 2.34.1
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle()
@ 2026-09-16 2:17 Zijun Hu
2026-09-16 6:06 ` Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak bluez.test.bot
0 siblings, 1 reply; 8+ messages in thread
From: Zijun Hu @ 2026-09-16 2:17 UTC (permalink / raw)
To: Amitkumar Karwar, Neeraj Kale, Marcel Holtmann,
Luiz Augusto von Dentz
Cc: Zijun Hu, linux-bluetooth, linux-kernel, Luiz Augusto von Dentz,
Zijun Hu
Simplify nxp_recv_acl_pkt() by using hci_acl_handle() instead of:
__u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
... (handle & 0x0FFF) ...
Reviewed-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
drivers/bluetooth/btnxpuart.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 25e7b41b349f..b975a00eb6f8 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1400,20 +1400,18 @@ static int nxp_process_fw_dump(struct hci_dev *hdev, struct sk_buff *skb)
free_skb:
kfree_skb(skb);
return 0;
}
static int nxp_recv_acl_pkt(struct hci_dev *hdev, struct sk_buff *skb)
{
- __u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
-
/* FW dump chunks are ACL packets with conn handle 0xfff */
- if ((handle & 0x0FFF) == 0xFFF)
+ if (hci_acl_handle(skb) == 0xFFF)
return nxp_process_fw_dump(hdev, skb);
else
return hci_recv_frame(hdev, skb);
}
static int nxp_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
{
union nxp_set_bd_addr_payload pcmd;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-09-16 6:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 5:40 [PATCH v2 0/2] Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak Zijun Hu
2026-09-15 5:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Zijun Hu
2026-09-15 7:25 ` Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak bluez.test.bot
2026-09-15 7:40 ` [PATCH v2 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Neeraj Kale
2026-09-15 5:40 ` [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump() Zijun Hu
2026-09-15 7:41 ` Neeraj Kale
2026-09-15 14:12 ` Luiz Augusto von Dentz
-- strict thread matches above, loose matches on Subject: below --
2026-09-16 2:17 [PATCH v3 1/2] Bluetooth: btnxpuart: Simplify nxp_recv_acl_pkt() by hci_acl_handle() Zijun Hu
2026-09-16 6:06 ` Bluetooth: btnxpuart: Simplify ACL handling and fix skb leak 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.