Skip to content

Bluetooth: virtio_bt: harden probe error paths

Yi Cong linux-bluetooth stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Bluetooth: virtio_bt: fix leak of vbt on virtio_find_vqs failuredrivers/bluetooth/virtio_bt.c+4 -11 reply
2/2Bluetooth: virtio_bt: unregister hdev before freeing on open failuredrivers/bluetooth/virtio_bt.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Bluetooth: virtio_bt: harden probe error paths

From: Yi Cong <[email protected]>

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(-)
Signature · 1 line
2.25.1