public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Nathan Rebello <nathan.c.rebello@gmail.com>
Cc: linux-usb@vger.kernel.org, heikki.krogerus@linux.intel.com
Subject: Re: [PATCH 1/2] usb: typec: ucsi: validate connector number in ucsi_connector_change()
Date: Fri, 20 Feb 2026 07:53:19 +0100	[thread overview]
Message-ID: <2026022028-viable-audacious-411c@gregkh> (raw)
In-Reply-To: <20260220063405.3623-1-nathan.c.rebello@gmail.com>

On Fri, Feb 20, 2026 at 01:34:04AM -0500, Nathan Rebello wrote:
> After.

I'm sorry, but I have no context here.  Remember, some of us get 1000+
emails a day, context matters :)

/me goes and digs...

> ucsi_connector_change() is only called via ucsi_notify_common(),
> which processes CCI interrupts from a bound device. The connector number
> comes from the CCI register (UCSI_CCI_CONNECTOR), a 7-bit field that
> can return 1-127, while the connector array is allocated based on
> num_connectors (typically 2-4). The same register is already validated
> for other fields in ucsi_init() (line 1840: "This is out of spec but
> happens in buggy FW").

Why not fix the buggy fw?  :)

Remember, Linux trusts hardware.  If people wish to change that model,
great, I'm all for that, and wack-a-mole fixes like this for after a
driver is bound to a device are nice to attempt, and clean up, but are
not really the solution.

That's why we have USBGuard, which prevents the driver from binding to
the device.  Make that policy decision in userspace, and then if you
trust the device, great, we trust the device to send us correct data.

And again, fix the hardware to not send invalid data.

thanks,

greg k-h

  reply	other threads:[~2026-02-20  6:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 16:49 [PATCH 0/2] usb: typec: ucsi: fix input validation in UCSI core Nathan Rebello
2026-02-19 16:49 ` [PATCH 1/2] usb: typec: ucsi: validate connector number in ucsi_connector_change() Nathan Rebello
2026-02-20  6:09   ` Greg KH
2026-02-20  6:34   ` Nathan Rebello
2026-02-20  6:53     ` Greg KH [this message]
2026-03-11 13:10   ` Greg KH
2026-03-11 21:49     ` Nathan Rebello
2026-03-12  5:03       ` Greg KH
2026-03-12  5:44         ` Nathan Rebello
2026-02-19 16:49 ` [PATCH 2/2] usb: typec: ucsi: clamp returned length in ucsi_run_command() Nathan Rebello

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=2026022028-viable-audacious-411c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=nathan.c.rebello@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