From: Niko Mauno <[email protected]>
Since the wireless USB implementation has been removed and since the
behavior with authorized_default values -1 and 1 is now effectively
same, change the initial value to latter in order to stop using the
leftover value. The former value can still be passed as a module
parameter to retain backwards compatibility.
Signed-off-by: Niko Mauno <[email protected]>
---
drivers/usb/core/hcd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 12b6dfeaf658..9aa5e6bf9b9d 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -357,12 +357,10 @@ static const u8 ss_rh_config_descriptor[] = {
#define USB_AUTHORIZE_ALL 1
#define USB_AUTHORIZE_INTERNAL 2
-static int authorized_default = USB_AUTHORIZE_WIRED;
+static int authorized_default = USB_AUTHORIZE_ALL;
module_param(authorized_default, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(authorized_default,
- "Default USB device authorization: 0 is not authorized, 1 is "
- "authorized, 2 is authorized for internal devices, -1 is "
- "authorized (default, same as 1)");
+ "Default USB device authorization: 0 is not authorized, 1 is authorized (default), 2 is authorized for internal devices, -1 is authorized (same as 1)");
/*-------------------------------------------------------------------------*/
/**
--
2.39.2
From: Niko Mauno <[email protected]>
Make the default USB device authorization mode configurable at build
time. This is useful for systems that require a mode that is stricter
than the standard setting, as it avoids relying on the kernel command
line being properly set.
Signed-off-by: Niko Mauno <[email protected]>
---
drivers/usb/core/Kconfig | 28 ++++++++++++++++++++++++++++
drivers/usb/core/hcd.c | 2 +-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 351ede4b5de2..0bf425889c10 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -116,3 +116,31 @@ config USB_AUTOSUSPEND_DELAY
The default value Linux has always had is 2 seconds. Change
this value if you want a different delay and cannot modify
the command line or module parameter.
+
+config USB_DEFAULT_AUTHORIZATION_MODE
+ int "Default authorization mode for USB devices"
+ range 0 2
+ default 1
+ depends on USB
+ help
+ Select the default USB device authorization mode. Can be overridden
+ with usbcore.authorized_default command line or module parameter.
+
+ This option allows you to choose whether USB devices that are
+ connected to the system can be used by default, or if they are
+ locked down.
+
+ With value 0 all connected USB devices with the exception of root
+ hub require user space authorization before they can be used.
+
+ With value 1 (default) no user space authorization is required to
+ use connected USB devices.
+
+ With value 2 all connected USB devices with exception of internal
+ USB devices require user space authorization before they can be
+ used. Note that in this mode the differentiation between internal
+ and external USB devices relies on ACPI, and on systems without
+ ACPI selecting value 2 is analogous to selecting value 0.
+
+ If the default value is too permissive but you are unsure which
+ mode to use, say 2.
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 9aa5e6bf9b9d..d56597dc7d42 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -357,7 +357,7 @@ static const u8 ss_rh_config_descriptor[] = {
#define USB_AUTHORIZE_ALL 1
#define USB_AUTHORIZE_INTERNAL 2
-static int authorized_default = USB_AUTHORIZE_ALL;
+static int authorized_default = CONFIG_USB_DEFAULT_AUTHORIZATION_MODE;
module_param(authorized_default, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(authorized_default,
"Default USB device authorization: 0 is not authorized, 1 is authorized (default), 2 is authorized for internal devices, -1 is authorized (same as 1)");
--
2.39.2
On Fri, Feb 09, 2024 at 11:46:50AM +0200, [email protected] wrote:
> From: Niko Mauno <[email protected]>
>
> Since the wireless USB implementation has been removed and since the
> behavior with authorized_default values -1 and 1 is now effectively
> same, change the initial value to latter in order to stop using the
> leftover value. The former value can still be passed as a module
> parameter to retain backwards compatibility.
>
> Signed-off-by: Niko Mauno <[email protected]>
> ---
> drivers/usb/core/hcd.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
On Fri, Feb 09, 2024 at 11:46:50AM +0200, [email protected] wrote:
> From: Niko Mauno <[email protected]>
>
> Since the wireless USB implementation has been removed and since the
> behavior with authorized_default values -1 and 1 is now effectively
> same, change the initial value to latter in order to stop using the
> leftover value. The former value can still be passed as a module
> parameter to retain backwards compatibility.
>
> Signed-off-by: Niko Mauno <[email protected]>
> ---
> drivers/usb/core/hcd.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Isn't this series already in my tree?
confused,
greg k-h
On 9.2.2024 12.47, Greg KH wrote:
> On Fri, Feb 09, 2024 at 11:46:50AM +0200, [email protected] wrote:
>> From: Niko Mauno <[email protected]>
>>
>> Since the wireless USB implementation has been removed and since the
>> behavior with authorized_default values -1 and 1 is now effectively
>> same, change the initial value to latter in order to stop using the
>> leftover value. The former value can still be passed as a module
>> parameter to retain backwards compatibility.
>>
>> Signed-off-by: Niko Mauno <[email protected]>
>> ---
>> drivers/usb/core/hcd.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> Isn't this series already in my tree?
>
> confused,
>
> greg k-h
Hi Greg, apologies for any confusion I may have caused,
Geert requested some further clarification in the new Kconfig help
section, please see:
https://marc.info/?l=linux-usb&m=170747246528305&w=2
(There shouldn't be any functional change introduced between v2 and v3)
Kind regards,
-Niko
On Fri, Feb 09, 2024 at 02:39:01PM +0200, Niko Mauno wrote:
> On 9.2.2024 12.47, Greg KH wrote:
> > On Fri, Feb 09, 2024 at 11:46:50AM +0200, [email protected] wrote:
> > > From: Niko Mauno <[email protected]>
> > >
> > > Since the wireless USB implementation has been removed and since the
> > > behavior with authorized_default values -1 and 1 is now effectively
> > > same, change the initial value to latter in order to stop using the
> > > leftover value. The former value can still be passed as a module
> > > parameter to retain backwards compatibility.
> > >
> > > Signed-off-by: Niko Mauno <[email protected]>
> > > ---
> > > drivers/usb/core/hcd.c | 6 ++----
> > > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > Isn't this series already in my tree?
> >
> > confused,
> >
> > greg k-h
>
> Hi Greg, apologies for any confusion I may have caused,
>
> Geert requested some further clarification in the new Kconfig help section,
> please see:
> https://marc.info/?l=linux-usb&m=170747246528305&w=2
Great, but I can't take patches that are already in my tree, right?
Please submit a new one on top of what I currently have.
> (There shouldn't be any functional change introduced between v2 and v3)
That always needs to be listed, as my bot says, otherwise we have no
idea what is going on here. Remember, some of us get 1000+ emails a day
to do something with (review, apply, delete, ignore...)
thanks,
greg k-h
On 9.2.2024 15.34, Greg KH wrote:
> On Fri, Feb 09, 2024 at 02:39:01PM +0200, Niko Mauno wrote:
>> On 9.2.2024 12.47, Greg KH wrote:
>>> On Fri, Feb 09, 2024 at 11:46:50AM +0200, [email protected] wrote:
>>>> From: Niko Mauno <[email protected]>
>>>>
>>>> Since the wireless USB implementation has been removed and since the
>>>> behavior with authorized_default values -1 and 1 is now effectively
>>>> same, change the initial value to latter in order to stop using the
>>>> leftover value. The former value can still be passed as a module
>>>> parameter to retain backwards compatibility.
>>>>
>>>> Signed-off-by: Niko Mauno <[email protected]>
>>>> ---
>>>> drivers/usb/core/hcd.c | 6 ++----
>>>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>>
>>> Isn't this series already in my tree?
>>>
>>> confused,
>>>
>>> greg k-h
>>
>> Hi Greg, apologies for any confusion I may have caused,
>>
>> Geert requested some further clarification in the new Kconfig help section,
>> please see:
>> https://marc.info/?l=linux-usb&m=170747246528305&w=2
>
> Great, but I can't take patches that are already in my tree, right?
>
> Please submit a new one on top of what I currently have.
>
>> (There shouldn't be any functional change introduced between v2 and v3)
>
> That always needs to be listed, as my bot says, otherwise we have no
> idea what is going on here. Remember, some of us get 1000+ emails a day
> to do something with (review, apply, delete, ignore...)
>
> thanks,
>
> greg k-h
Thanks, submitted as new patch against usb-next.
-Niko