From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: erdaitianjiao <erdaitianjiao@gmail.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: xhci: validate CAPLENGTH in xhci_gen_setup()
Date: Sat, 22 Aug 2026 12:34:46 +0200 [thread overview]
Message-ID: <2026082252-segment-haste-2eb7@gregkh> (raw)
In-Reply-To: <20260822102357.4634-1-erdaitianjiao@gmail.com>
On Sat, Aug 22, 2026 at 06:23:57PM +0800, erdaitianjiao wrote:
> xhci_hcd can be bound to arbitrary PCI devices via the
> driver_override sysfs knob. When this happens to a device whose
> MMIO registers are not xHCI capability registers,
> xhci_gen_setup() reads CAPLENGTH from the foreign register
> layout and uses it as a byte offset to compute op_regs.
>
> A non-xHCI device can return a CAPLENGTH value that is
> - not large enough to fit the capability register block, or
> - not 4-byte aligned (e.g. the NVMe CAP register's low byte is
> 0xff, which becomes CAPLENGTH = 0xff).
That's crazy, and I'm getting tired of rejecting patches like this.
Again, if you use 'bind' to attach a device to a driver you HAVE to know
what you are doing. Attempting to fix up each and every driver to
handle this is not ok, and will not happen.
sorry, syzbot is broken and needs to be fixed,
greg k-h
next prev parent reply other threads:[~2026-08-22 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 10:23 erdaitianjiao
2026-08-22 10:33 ` Greg Kroah-Hartman
2026-08-22 10:34 ` Greg Kroah-Hartman [this message]
2026-08-22 11:06 ` Tianjiao Erdai
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=2026082252-segment-haste-2eb7@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=erdaitianjiao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.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
all inboxes | Powered by JetHome®