mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: haoxiang_li2024  <haoxiang_li2024@163.com>
To: "Paul Menzel" <pmenzel@molgen.mpg.de>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: marcel@holtmann.org, luiz.dentz@gmail.com,
	yangyingliang@huawei.com, mst@redhat.com, error27@gmail.com,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re:Re: [PATCH] Bluetooth: virtio_bt: unregister HCI device on open failure
Date: Thu, 25 Jun 2026 10:09:10 +0800 (CST)	[thread overview]
Message-ID: <7d587d87.1fca.19efc89d056.Coremail.haoxiang_li2024@163.com> (raw)
In-Reply-To: <17c94df1-3659-4d21-b327-ad52d498ba9c@molgen.mpg.de>


Hi Paul,

At 2026-06-24 17:10:55, "Paul Menzel" <pmenzel@molgen.mpg.de> wrote:
>
>Should you resend, please re-flow for 72/75 characters, so only three 
>lines are used.
>

Thank you for the review!

Following Dan's suggestions, I reworked the patch in v2. I also made the
commit message more compact based on your suggestion. 

>
>PS: gemini/gemini-3.1-pro-preview found an unrelated issue to the patch 
>during review of this patch [1].
>
>> This is a pre-existing issue, but does this error path safely clean up the
>> active virtqueues? 
>> Earlier in virtbt_probe(), virtio_device_ready(vdev) marks the device as
>> active. If virtbt_open_vdev() subsequently fails, the code jumps to the
>> open_failed label and eventually reaches here to call del_vqs(vdev).
>> Deleting virtqueues without calling virtio_reset_device(vdev) first violates
>> the VirtIO API contract for active devices. It could allow the host or
>> hypervisor to access guest memory that has already been freed by del_vqs(),
>> potentially leading to a use-after-free.
>> Should virtio_reset_device(vdev) be called before tearing down the
>> virtqueues in this error path?
>
>No idea, how to best track these things.
>

The issue noted in your PS is now handled by resetting the virtio device
before tearing down the virtqueues in the virtbt_open_vdev() failure path.

Since v2 changes more than the original one-line fix, I did not carry your
Reviewed-by tag. Thanks again!

Thanks,
Haoxiang

  reply	other threads:[~2026-06-25  2:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24  8:43 Haoxiang Li
2026-06-24  9:10 ` Paul Menzel
2026-06-25  2:09   ` haoxiang_li2024 [this message]
2026-06-24 10:56 ` Dan Carpenter

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=7d587d87.1fca.19efc89d056.Coremail.haoxiang_li2024@163.com \
    --to=haoxiang_li2024@163.com \
    --cc=error27@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=martin.petersen@oracle.com \
    --cc=mst@redhat.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=stable@vger.kernel.org \
    --cc=yangyingliang@huawei.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®