All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junjie Cao <junjie.cao@linux.dev>
To: qemu-devel@nongnu.org
Cc: thuth@redhat.com, kraxel@redhat.com, philmd@oss.qualcomm.com,
	marcandre.lureau@redhat.com, junjie.cao@linux.dev
Subject: [PATCH v2 0/2] usb-host: validate and release configuration descriptors
Date: Mon,  5 Oct 2026 00:46:24 -0500	[thread overview]
Message-ID: <20261005054626.131577-1-junjie.cao@linux.dev> (raw)

The libusb host backend reads interface numbers from the active
configuration descriptor while opening a device. An out-of-range number
can index past USBDevice.altsetting. The backend also leaves an allocated
descriptor behind on endpoint parse and interface claim failures.

Changes in v2:
- Use g_autoptr for configuration descriptors in usb_host_ep_update() and
  usb_host_claim_interfaces() (Marc-André).
- Collected tags from Marc-André.

v1: https://lore.kernel.org/qemu-devel/20261004042722.6937-1-junjie.cao@linux.dev/

Junjie Cao (2):
  usb-host: validate interface number before indexing altsetting
  usb-host: free configuration descriptors on error paths

 hw/usb/host-libusb.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)


base-commit: d7a65d1793d691d356a56833620f7d1e6f5d653b
-- 
2.43.0



             reply	other threads:[~2026-10-05  5:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05  5:46 Junjie Cao [this message]
2026-10-05  5:46 ` [PATCH v2 1/2] usb-host: validate interface number before indexing altsetting Junjie Cao
2026-10-05  5:46 ` [PATCH v2 2/2] usb-host: free configuration descriptors on error paths Junjie Cao

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=20261005054626.131577-1-junjie.cao@linux.dev \
    --to=junjie.cao@linux.dev \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.