mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neeraj Kale <neeraj.sanjaykale@nxp.com>
To: Zijun Hu <zijun.hu@oss.qualcomm.com>,
	Amitkumar Karwar <amitkumar.karwar@nxp.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Zijun Hu <zijun_hu@icloud.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Subject: [PATCH v2 2/2] Bluetooth: btnxpuart: Fix skb leak in nxp_process_fw_dump()
Date: Tue, 15 Sep 2026 07:41:09 +0000	[thread overview]
Message-ID: <AS4PR04MB96927952663AF7812B385EBBE7BA2@AS4PR04MB9692.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20260914-misc_fix-v2-2-6178d838c946@oss.qualcomm.com>

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

  reply	other threads:[~2026-09-15  7:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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:40   ` 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 [this message]
2026-09-15 14:12   ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS4PR04MB96927952663AF7812B385EBBE7BA2@AS4PR04MB9692.eurprd04.prod.outlook.com \
    --to=neeraj.sanjaykale@nxp.com \
    --cc=amitkumar.karwar@nxp.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=zijun.hu@oss.qualcomm.com \
    --cc=zijun_hu@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®