linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yi Cong <cong.yi@linux.dev>
To: marcel@holtmann.org, luiz.dentz@gmail.com
Cc: linux-bluetooth@vger.kernel.org, stable@vger.kernel.org,
	Yi Cong <yicong@kylinos.cn>
Subject: [PATCH 0/2] Bluetooth: virtio_bt: harden probe error paths
Date: Tue, 11 Aug 2026 11:27:00 +0800	[thread overview]
Message-ID: <20260811032702.67908-1-cong.yi@linux.dev> (raw)

From: Yi Cong <yicong@kylinos.cn>

This small series hardens the two error paths in virtbt_probe() that
currently leak or leave dangling state behind:

  1/2 - if virtio_find_vqs() fails, the allocated 'vbt' and the
        'vdev->priv' pointer that already references it are leaked.
  2/2 - if virtbt_open_vdev() fails after hci_register_dev() has
        succeeded, the hdev is freed without unregistering, leaving a
        dangling entry in the global HCI device list (UAF).

  Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver")

Yi Cong (2):
  Bluetooth: virtio_bt: fix leak of vbt on virtio_find_vqs failure
  Bluetooth: virtio_bt: unregister hdev before freeing on open failure

 drivers/bluetooth/virtio_bt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.25.1


             reply	other threads:[~2026-08-11  3:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  3:27 Yi Cong [this message]
2026-08-11  3:27 ` [PATCH 1/2] Bluetooth: virtio_bt: fix leak of vbt on virtio_find_vqs failure Yi Cong
2026-08-11  4:45   ` Bluetooth: virtio_bt: harden probe error paths bluez.test.bot
2026-08-11  3:27 ` [PATCH 2/2] Bluetooth: virtio_bt: unregister hdev before freeing on open failure Yi Cong

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=20260811032702.67908-1-cong.yi@linux.dev \
    --to=cong.yi@linux.dev \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=stable@vger.kernel.org \
    --cc=yicong@kylinos.cn \
    /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;
as well as URLs for NNTP newsgroup(s).