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

Yi Cong <[email protected]>
Newsgroups org.kernel.vger.linux-bluetooth,org.kernel.vger.stable
Message-ID <[email protected]>
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(-)

-- 
2.25.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.