mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinchao Wang <wangjinchao600@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	bigeasy@linutronix.de, eeodqql09@gmail.com, kees@kernel.org,
	surban@surban.net, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com, stable@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: dummy_hcd: prevent fifo_req reuse during giveback
Date: Thu, 16 Jul 2026 22:47:59 -0400	[thread overview]
Message-ID: <d7834d9a-c1a6-4376-84eb-2a9cfbbed0d5@gmail.com> (raw)
In-Reply-To: <a1953c08-7050-4288-b92e-ba4f76ccff39@rowland.harvard.edu>

On 7/16/2026 10:40 PM, Alan Stern wrote:
> On Wed, Jul 15, 2026 at 01:34:13AM -0400, Jinchao Wang wrote:
>>> Wow!  I'm impressed.  How did you figure this out?
>>
>> With a hardware watchpoint: I armed one on the victim field
>> (req->complete, at arg2+56 of usb_gadget_giveback_request) only while
>> usb_gadget_giveback_request() was running, and it caught the writing
>> memcpy with a full stack - usb_ep_queue <- raw_process_ep_io <-
>> raw_ioctl - on the same request that crashed an instant later.
>>
>> The watchpoint setup came from a small tool I am working on; I posted
>> it as an RFC in case it is useful to others:
>>
>> https://lore.kernel.org/all/20260714182243.10687-1-wangjinchao600@gmail.com/
> 
> That tool looks really nice.  I'm glad to see hardware breakpoints 
> becoming easier to use, because I wrote a large part of the initial 
> implementation -- see for example commit 0067f1297241 ("hw-breakpoints: 
> x86 architecture implementation of Hardware Breakpoint interfaces").
> 
> Alan Stern

Thank you! KWatch builds directly on that work - the perf hw_breakpoint
layer does all the heavy lifting, and KWatch only adds a small
"reinstall" operation on top, plus the windowing logic around it.

I am preparing a v2 of the RFC based on the review so far; if you don't
mind, I will Cc you on it.

Thanks,
Jinchao

  reply	other threads:[~2026-07-17  2:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  6:48 Jinchao Wang
2026-07-14 21:13 ` Alan Stern
2026-07-15  5:34   ` Jinchao Wang
2026-07-17  2:40     ` Alan Stern
2026-07-17  2:47       ` Jinchao Wang [this message]
2026-07-16 10:42 ` [PATCH v2] " Jinchao Wang
2026-07-16 13:50   ` Alan Stern

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=d7834d9a-c1a6-4376-84eb-2a9cfbbed0d5@gmail.com \
    --to=wangjinchao600@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=eeodqql09@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=surban@surban.net \
    --cc=syzkaller-bugs@googlegroups.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

Powered by JetHome