From: Alan Stern <stern@rowland.harvard.edu>
To: Nicolas Bouchinet <nicolas.bouchinet@oss.cyber.gouv.fr>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kannappan R <r.kannappan@intel.com>,
Sabyrzhan Tasbolatov <snovitoll@gmail.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Stefan Eichenberger <stefan.eichenberger@toradex.com>,
Thomas Gleixner <tglx@linutronix.de>,
Pawel Laszczak <pawell@cadence.com>, Ma Ke <make_ruc2021@163.com>,
Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
Luc Bonnafoux <luc.bonnafoux@ssi.gouv.fr>,
Luc Bonnafoux <luc.bonnafoux@oss.cyber.gouv.fr>,
Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [RFC PATCH 3/4] usb: core: Plug the usb authentication capability
Date: Mon, 30 Jun 2025 14:04:45 -0400 [thread overview]
Message-ID: <892491bb-e7f4-4096-b502-f1bf2fd0fdec@rowland.harvard.edu> (raw)
In-Reply-To: <8cc10112-23a7-41af-b81f-7fc0c097d34d@oss.cyber.gouv.fr>
On Mon, Jun 30, 2025 at 01:20:27PM +0200, Nicolas Bouchinet wrote:
> We moved the `usb_authenticate_dev()` call in `usb_new_device()` in order to
> perform the authentication only once the device configuration is complete.
usb_new_device() does device initialization, not device configuration.
The default configuration is selected by usb_choose_configuration(), but
the config can be changed at any time by the user (via sysfs or usbfs).
> Also
> we think we need to split the problem of handling the authentication vs
> authorization in two parts.
>
> - which component has authority to set the two fields ?
> - where/how is it enforced ?
>
> To answer the first question :
>
> - We think that the authenticated field can only be set by the
> `usb_authenticate_dev()` function.
>
> - it is less clear for the authorized status which is already manipulated by
> the sysfs (usbguard) and the default hcd policy.
>
> The reconciliation between the two fields could be done at the enforcement
> point. In `usb_probe_interface()` instead of simply checking the authorized
> flag
> it could check a more complex policy. For example:
>
> +-------------------+----------------------------------------+----------------+
>
> | | authorized | not
> authorized |
> +-------------------+----------------------------------------+----------------+
>
> | authenticated | OK | NOK
> |
> +-------------------+----------------------------------------+----------------+
>
> | not authenticated | Depends on tolerance in local security
> | |
> | | policy (set by cmdline or sysctl) | NOK
> |
> +-------------------+----------------------------------------+----------------+
>
>
> This way it would also help to handle internal devices. When
> `hcd->dev_policy` is
> set to USB_DEVICE_AUTHORIZE_INTERNAL, only internal devices are authorized
> by
> default on connection. So external devices will have to be authenticated and
> then authorized via the sysfs. Internal devices will be authorized and not
> authenticated.
Okay, that seems like a reasonable approach.
Alan Stern
next prev parent reply other threads:[~2025-06-30 18:04 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 14:27 [RFC PATCH 0/4] Support for usb authentication nicolas.bouchinet
2025-06-20 14:27 ` [RFC PATCH 1/4] usb: core: Introduce netlink usb authentication policy engine nicolas.bouchinet
2025-06-21 9:37 ` Sabyrzhan Tasbolatov
2025-06-30 11:42 ` Nicolas Bouchinet
2025-06-20 14:27 ` [RFC PATCH 2/4] usb: core: Introduce usb authentication feature nicolas.bouchinet
2025-06-20 14:54 ` Greg Kroah-Hartman
2025-06-30 11:07 ` Nicolas Bouchinet
2025-06-30 11:43 ` Greg Kroah-Hartman
2025-06-21 10:21 ` Sabyrzhan Tasbolatov
2025-06-30 11:56 ` Nicolas Bouchinet
2025-06-25 9:59 ` Oliver Neukum
2025-06-30 12:38 ` Nicolas Bouchinet
2025-06-20 14:27 ` [RFC PATCH 3/4] usb: core: Plug the usb authentication capability nicolas.bouchinet
2025-06-20 19:11 ` Alan Stern
2025-06-30 11:20 ` Nicolas Bouchinet
2025-06-30 18:04 ` Alan Stern [this message]
2025-06-21 11:09 ` Sabyrzhan Tasbolatov
2025-06-30 12:25 ` Nicolas Bouchinet
2025-06-23 18:15 ` Oliver Neukum
2025-06-30 12:34 ` Nicolas Bouchinet
2025-06-30 13:07 ` Oliver Neukum
2025-06-20 14:27 ` [RFC PATCH 4/4] usb: core: Add Kconfig option to compile usb authorization nicolas.bouchinet
2025-06-21 7:22 ` Greg Kroah-Hartman
2025-06-30 11:22 ` Nicolas Bouchinet
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=892491bb-e7f4-4096-b502-f1bf2fd0fdec@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=gregkh@linuxfoundation.org \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=luc.bonnafoux@oss.cyber.gouv.fr \
--cc=luc.bonnafoux@ssi.gouv.fr \
--cc=make_ruc2021@163.com \
--cc=nicolas.bouchinet@oss.cyber.gouv.fr \
--cc=nicolas.bouchinet@ssi.gouv.fr \
--cc=pawell@cadence.com \
--cc=r.kannappan@intel.com \
--cc=snovitoll@gmail.com \
--cc=stefan.eichenberger@toradex.com \
--cc=tglx@linutronix.de \
/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®