Linux USB
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Andreas Noever <andreas.noever@gmail.com>,
	Mika Westerberg <westeri@kernel.org>,
	Yehezkel Bernat <YehezkelShB@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, lvc-project@linuxtesting.org,
	syzbot+901ca72278dfd89daf58@syzkaller.appspotmail.com
Subject: Re: [PATCH] thunderbolt: verify PCI resource type and size in nhi_probe()
Date: Fri, 7 Aug 2026 15:05:15 +0200	[thread overview]
Message-ID: <20260807130515.GR235112@black.igk.intel.com> (raw)
In-Reply-To: <6f6a7bc6-a686-484f-b654-17e0ceb874d8@yandex.ru>

On Fri, Aug 07, 2026 at 03:36:09PM +0300, Dmitry Antipov wrote:
> On 8/7/26 3:01 PM, Mika Westerberg wrote:
> 
> > Okay through driver_override, thanks. It also says:
> > 
> >    Buses opt into this mechanism by setting the driver_override flag in their
> >    struct bus_type.
> > 
> > But that's not done in struct tb_bus_type.
> > 
> > So there should be no such attribute available even.
> 
> Hm. Syzbot's reproducer definitely uses /sys/bus/pci/devices/0000:00:02.0/driver_override
> and /sys/bus/pci/drivers/thunderbolt/bind to make a trick. IIUC the kernel starts to probe
> NHI just like any regular PCI device (so driver_override is expected to work), and
> tb_bus_type enters the game during the probe itself during nhi_probe() -> nhi_select_cm()
> -> tb_probe() -> tb_domain_alloc().

Well say if it finds a random device that has BAR that is of correct type
and size then we are in the same situation again (and I think this applies
to many drivers -- that's why we have the ID/class or similar matching
there to make sure these bind to expected hardware).

  reply	other threads:[~2026-08-07 13:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  8:37 [PATCH] thunderbolt: verify PCI resource type and size in nhi_probe() Dmitry Antipov
2026-08-07  9:58 ` Mika Westerberg
2026-08-07 11:13   ` Dmitry Antipov
2026-08-07 11:31     ` Mika Westerberg
2026-08-07 11:47       ` Dmitry Antipov
2026-08-07 12:01         ` Mika Westerberg
2026-08-07 12:36           ` Dmitry Antipov
2026-08-07 13:05             ` Mika Westerberg [this message]
2026-08-07 13:11         ` Greg Kroah-Hartman
2026-08-07 13:27           ` Dmitry Antipov
2026-08-07 13:59             ` Greg Kroah-Hartman

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=20260807130515.GR235112@black.igk.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=dmantipov@yandex.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=syzbot+901ca72278dfd89daf58@syzkaller.appspotmail.com \
    --cc=westeri@kernel.org \
    /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