Linux USB
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: tjdqudcks0424@naver.com,
	Valentina Manea <valentina.manea.m@gmail.com>,
	Shuah Khan <shuah@kernel.org>
Cc: linux-usb@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2] usbip: vudc: reject submits after endpoint state changes
Date: Tue, 20 Oct 2026 17:27:14 -0600	[thread overview]
Message-ID: <572df927-cb52-4504-a663-e73c68592c97@linuxfoundation.org> (raw)
In-Reply-To: <20261020181832.461892-1-tjdqudcks0424@naver.com>

On 10/20/26 12:18, tjdqudcks0424@naver.com wrote:
> From: Sung Byeongchan <tjdqudcks0424@naver.com>
> 
> v_recv_cmd_submit() looks up an endpoint under udc->lock, but drops the
> lock while it allocates the URB and receives the payload.  A gadget
> configuration change can disable or disable and re-enable that endpoint
> before the URB is queued.
> 
> In a timing-controlled KASAN test, one of six unmodified baseline runs
> faulted in the inlined receive path while reading endpoint descriptor
> state after the descriptor had been cleared.  The other baseline runs
> also showed that a submit could cross the endpoint state transition.
> 
> Give each VUDC endpoint a generation that changes on enable and disable.
> Snapshot the generation and immutable parsing fields during lookup, then
> recheck descriptor presence and generation under udc->lock immediately
> before adding the URB to urb_queue.  Reject a stale request with
> -ESHUTDOWN.
> 
> The parsing snapshots avoid unlocked reads of mutable descriptor state.
> The generation check also distinguishes a newly enabled endpoint from the
> old endpoint state even though both use the same struct vep.
> 
> On a KASAN build at ff47652a4b66c067c765a7ad464d930b5a9367cc,
> normal enabled-endpoint, serialized-disable, and disable/re-enable
> stale-submit cases each passed three independent fresh-boot runs after the
> fix.  The stale case returned -ESHUTDOWN without a sanitizer report, and a
> following EP0 request succeeded after bounded reconnection.  The touched
> source is unchanged at 0c2669a9f4a1d607e7591ae50ccf3c432a0aff08, where
> the patch also applies and builds cleanly.
> 
> The demonstrated impact is kernel/service denial of service.  No
> controlled write, information disclosure, RCE, or LPE was demonstrated.

How did you reproduce it? If you didn't how are you sure this is the
right fix?

thanks,
-- Shuah

      parent reply	other threads:[~2026-10-20 23:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 18:18 [PATCH v2] usbip: vudc: reject submits after endpoint state changes tjdqudcks0424
2026-10-20 18:29 ` sashiko-bot
2026-10-20 23:27 ` Shuah Khan [this message]

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=572df927-cb52-4504-a663-e73c68592c97@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=tjdqudcks0424@naver.com \
    --cc=valentina.manea.m@gmail.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