Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7822500rdb; Thu, 4 Jan 2024 08:42:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFqpmYjPECzu2/+T0N4kk6m09rSyqcBovn0rAGNaRxHxQ+JkJwwyF7fGSNwd7gD43ajNbXr X-Received: by 2002:ac8:5851:0:b0:425:4043:50ea with SMTP id h17-20020ac85851000000b00425404350eamr917942qth.121.1704386558594; Thu, 04 Jan 2024 08:42:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704386558; cv=none; d=google.com; s=arc-20160816; b=VqsCGKPxCSbJp6l6jv8dhxkU62JRhLB5J44qMgWry+Gx9hOSHuwsorquGXS8DwNnJu vZaUSZIz3UKR8seh9brmVQ5nm7QaKnqYzB9M1I8jX3VI8mU/9UArQxVM3u8OoPaRtEbx 6fwUWRMe8Q3iQMf//odZKt8L+qJTZnqD4EgxZVvBjl8mQafXgfvWGTQpgmojtXXraSmL TSGXTv7haESaJooEmQm9qmjxCANXIvRsCu9Nrs1zN4nT33+6/E58f3CLbuHwIWtW2cfz fZA5XtQv5/RQY8tAwki2z0MBPuD3h90tteVTwE8WpauoBHcsc4VQFRF/ZNvJ3t9IW0jT Wd4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/kpsBUj1jMHfF4dkxITHf07nL0wARPb1OVlx+1g+Npw=; fh=G0s78m2136S3M0lzgj7GQ7HjG7p4GRPGyMLSWH2RZQU=; b=n89NFg/I8bl8JOBVncCm/2h+MG1foglpvewQP7jI72L4DWw6I090jKZSeS8RCd/XOP WdpSiRKpDjPSryVa/69zhvWyc7NKDbUMd//k4kbU5kdJ37fqUI6hIldLnvup993etXk4 lbHGHBdADHbNb0rTVgkwp6NdT9n0NhiWajhCjvKyQbhsUvz/fbHsAPtAfkF9WwRYJike QcRUk5cVB1qCF/mXelVWXQC21GHmD6dVTNMmXbDs0RTFcEyQH9WSyZ8F6B9a5zUYBMDZ 0Ghsyz0o1zwvc+ChIyY9lo+CmXDDEiUrQ0R8FPyRHh21CL3W7PWkL+Tn5eZ7mOuW/HxF yQIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="w7IZU/gW"; spf=pass (google.com: domain of linux-kernel+bounces-16956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 13-20020ac8590d000000b00423dcceb29esi30505375qty.400.2024.01.04.08.42.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 08:42:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="w7IZU/gW"; spf=pass (google.com: domain of linux-kernel+bounces-16956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16956-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 59ECE1C224B5 for ; Thu, 4 Jan 2024 16:42:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F4892555F; Thu, 4 Jan 2024 16:41:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="w7IZU/gW" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 727AF250F1; Thu, 4 Jan 2024 16:41:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 957CBC433C8; Thu, 4 Jan 2024 16:41:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704386517; bh=Ym8uX/Uf+LH1aEhgFAE+qkHEAf38+34oIYKfCtWPA9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=w7IZU/gWh/MLLjezsKW7nPjT0isyn5eAFWzRNmGuvmGTcA6OzIMypnYgqTSmbBo3i tEU794K1697ZfgI6sUgzXRXgz4lQ2yzakBxISzXGkip/pzXLRjOcEJlZaLr2b/Qre+ T5myvZbcwRTAsvfr8YHu7yy90X7U6bxJaXOG5Keg= Date: Thu, 4 Jan 2024 17:41:55 +0100 From: Greg KH To: niko.mauno@vaisala.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: core: Make default authorization mode configurable Message-ID: <2024010413-portable-lingo-3c11@gregkh> References: <20240104163203.7381-1-niko.mauno@vaisala.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240104163203.7381-1-niko.mauno@vaisala.com> On Thu, Jan 04, 2024 at 06:32:03PM +0200, niko.mauno@vaisala.com wrote: > From: Niko Mauno > > 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 > --- > drivers/usb/core/Kconfig | 15 +++++++++++++++ > drivers/usb/core/hcd.c | 2 +- > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig > index 351ede4b5de2..10ad320cc2f3 100644 > --- a/drivers/usb/core/Kconfig > +++ b/drivers/usb/core/Kconfig > @@ -116,3 +116,18 @@ 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 -1 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. > + > + The available values have the following meanings: > + -1 is authorized for all devices (leftover from wireless USB) > + 0 is unauthorized for all devices > + 1 is authorized for all devices What's the difference now between -1 and 1? We don't have wireless USB anymore as that never turned into an actual product, so we shouldn't reference it anymore, right? We should get rid of the -1 option entirely, but keep the module option and properly map it to '1'. > + 2 is authorized for internal devices Needs a "if you don't know what to select, please choose X" text here. thanks, greg k-h