From patchwork Fri Jan 5 11:49:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niko Mauno X-Patchwork-Id: 185372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6167734dyb; Fri, 5 Jan 2024 03:51:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYfCosqlca8yAYkdk6u35/Sr77D6Hkfu12+faq2SVagHaeF0InxaUdiprqkIn6ycMtXzxA X-Received: by 2002:a05:6a20:8415:b0:196:cb5b:b481 with SMTP id c21-20020a056a20841500b00196cb5bb481mr1724327pzd.100.1704455468163; Fri, 05 Jan 2024 03:51:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704455468; cv=pass; d=google.com; s=arc-20160816; b=BiclXezqLbVbvvJ6pJ1VChnf+rHcB+UM97HrVN4NEvaPQDHIRHiPBRdi07CiRMKZkA fxv5yxsdu4YRPPF7Tz9HEyey/0j59jqarjz091N+ucg+cglX7bI5GTKZfLUVmUwg315R ANQFZBJcWCs7wH4rDM0N4i/Uc4smxZitE9LMLDYqepfW9zQvZhDYwh7/FfXsvFRZH9P6 FGFX12DmSYCGiA9Zla5kUaArL/xOwRbu0t3+zwivzQJG5H4T8uxQ6WAcW4Nh07sh4vus 7cYCMsUB9rfO55DJtlElYf8ejNTEno77I+jxVsOkPmncA7PUoF+lXcjXuBoNeFOByOQC pw0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=AdMhVx5W4qmt1DoI9yagQDMLzbzAPKsTpLntPZZFH5I=; fh=Qaxyq4XWyvQXxjyl3VzlL20fnPQtPsOO3A2N+wWcYmQ=; b=yhmOfjoOLwb02HHetKxfgPWAy6WuFIf9MBgzILiztCZM9F4lcAECBigYgPEtILvACc Kh9rrIZSs7KCSP7Bbfz2LSGV/YuOfjhBr0wWPqsTNqvZ0j5iEXVnvL53gsDQG3kFNBmP vowNS1RxkKeuIpRl5Krc6eS/kPerDJ6Jn+gMgR0qzA8vdKHevOhH7sEzBNGI8t7k5AWz ppraxIWa7LBF6P8Fofybki5WQk8/nbulOD3XnIMguwn74Ph9eMwG9RtS8RO8YbEXGhCD xyZZxohBYy1Uf8OpGNyiUTdW4MnDF7HOwyV9es0BdiiNSKAWQ3r3OFiPfWKgyPnd1WFE Ewxw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vaisala.com header.s=selector1 header.b=gB0Ec0zO; arc=pass (i=1 spf=pass spfdomain=vaisala.com dkim=pass dkdomain=vaisala.com dmarc=pass fromdomain=vaisala.com); spf=pass (google.com: domain of linux-kernel+bounces-17816-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17816-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vaisala.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bw4-20020a17090af60400b0028cdf3bffbasi686876pjb.13.2024.01.05.03.51.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 03:51:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17816-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@vaisala.com header.s=selector1 header.b=gB0Ec0zO; arc=pass (i=1 spf=pass spfdomain=vaisala.com dkim=pass dkdomain=vaisala.com dmarc=pass fromdomain=vaisala.com); spf=pass (google.com: domain of linux-kernel+bounces-17816-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17816-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vaisala.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E1EF9B2259F for ; Fri, 5 Jan 2024 11:51:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16A412D05B; Fri, 5 Jan 2024 11:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vaisala.com header.i=@vaisala.com header.b="gB0Ec0zO" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2070.outbound.protection.outlook.com [40.107.6.70]) (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 7E75D2C848; Fri, 5 Jan 2024 11:50:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vaisala.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vaisala.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kufPvAV8BQhzKmJpsQk/zRVqdt7n1Dm4g9uDctGPK8VBKSCKiZVvL4dDDcTPWFnFYw1P9bE+WK40A599MLpToo4pD0aIm2yvnxg7LYYK4mjdmfuw3CsSlYey8t0SsCOyEZeLK96dXuheo7lGLIyqrAsz0XlNNNSlLuzLRLo83iMGTH1GgS/MKQ0KEdA9uijxrm6/ufTpznjfxAH1kIXYi7oFq8SWERM74XOyp1JtFjopbpoMDkjnngEBtvL0z9I5uhrH67ow/DPjivl6zszCFflIe/N/8FoMuNIRuCkHeA+viYoqZltgl79Y+XZYLkL/aXN5XjgeXV+7vsY047eLRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AdMhVx5W4qmt1DoI9yagQDMLzbzAPKsTpLntPZZFH5I=; b=bcWLEV0EWFboJu3735kaKDAnReHufkMYDsalgk+apjvBNHadhptXlBWORZRikFMZsK6gW3OMyjuRFMW6A7xKkQ0YUylhfY+Q4PEW3ikO32xedFaEY+gQABdH3wge44J4lEnGAfouEP5QFUiCt46gUU9rfKjUbQoTR4LMZlxWwq/mTh60nzTVP2pMFersoU83N8+F7P37WqjYVSo9iGWb1iEuxEHI5sKIpUsM4wQ4oSofrat6yYVQfdBJxDwgqVJyo60+ckh5NGiOJFxuDO3T96kJlpt9GnOmhJI8OLfYUXifYY2rea8cONFuFJowqoYRQ0qwG5g8wCMWw7pHlT/WlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vaisala.com; dmarc=pass action=none header.from=vaisala.com; dkim=pass header.d=vaisala.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vaisala.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AdMhVx5W4qmt1DoI9yagQDMLzbzAPKsTpLntPZZFH5I=; b=gB0Ec0zOlm/nba+LLqYI3z3pEXHPDKGbao+OMwN5cnfWmvilmTY17jzuRr9gz5OX6eCDOVpaLpY4sUJz9wBF6mchm2KxeyCLlwp+NvNugoeIk+iryUtvMMZO9TuQdUAW0iNnLBJUlvL9Sy9YSltWKXezbNdNv43haKIKWC+TywomARKDN9hqvZ4S8ulow/UvDggQ4YEdIdgljQucwSXbKJ/Jkzkow33Qr9d5c8IJ292Xo2QQZOc/q5Rir+u5tJ4GtVK3XEIMuqr0WZJhQmc2S/5FvQ1TiQeXU3Qw3ueIM1OKKBODkfCv6jCI33XxmFUggQZ1QPDIouezppsRPlbYqA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vaisala.com; Received: from AS4PR06MB8447.eurprd06.prod.outlook.com (2603:10a6:20b:4e2::11) by DB8PR06MB6490.eurprd06.prod.outlook.com (2603:10a6:10:124::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.15; Fri, 5 Jan 2024 11:50:31 +0000 Received: from AS4PR06MB8447.eurprd06.prod.outlook.com ([fe80::820:f7b6:7f2b:324b]) by AS4PR06MB8447.eurprd06.prod.outlook.com ([fe80::820:f7b6:7f2b:324b%4]) with mapi id 15.20.7159.013; Fri, 5 Jan 2024 11:50:31 +0000 From: niko.mauno@vaisala.com To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, vesa.jaaskelainen@vaisala.com, Niko Mauno Subject: [PATCH v2 1/2] usb: core: Amend initial authorized_default value Date: Fri, 5 Jan 2024 13:49:55 +0200 Message-Id: <20240105114956.30714-1-niko.mauno@vaisala.com> X-Mailer: git-send-email 2.39.2 X-ClientProxiedBy: GV3PEPF00002BAD.SWEP280.PROD.OUTLOOK.COM (2603:10a6:144:1:0:6:0:7) To AS4PR06MB8447.eurprd06.prod.outlook.com (2603:10a6:20b:4e2::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR06MB8447:EE_|DB8PR06MB6490:EE_ X-MS-Office365-Filtering-Correlation-Id: 68d78e36-d2f3-49d7-cfc5-08dc0de4851a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZHBl0bJmEO62aZC3qLX/bTnyQoQ0sJgJ42VTM6/L4M9q3i3npV0KWeLvD9IzYC1pEACp4sT3FXxpchWz0OoFWFcuc7+xpd+kDtqZxc5aKjiHyO4+PW2J86zPORMScJw6mGg72d42kHCUupPlbLFRovltEIpsg8yrI0nCI2VDGset8cf18neZDjanAlg/4hQELzdwZbitSTilhN7To77stLgTR4/zC0f5jnuEyinzkm2rp+cv1rjIvjhamPRPC3K49fd74GrOZEaQkySJoXwOaAtLZ/NnshuSQVrzlNQObKLupdVGCDVW5EgbkNqGlYLdfz8uLUvCwGzKNGDDOpbpBeaix/0bIyYpoztP4DPJDhpLMxct0w8RcfVM0zv352wjRj3PJ6QhMLjbajUJ6I/FY860msrfNhsmcbirgAhkekGfPiP1dJiF09lv/kuh6+5b9eAig/tEKWpCLFiUsQEKWGHcx3aW3G9TK0pr4X8myuOn01Z4tuI5wSt8Dat17m3WxQozQ5YmU9ZWuHMHQ7vSTi9h6yAQkqLqL373bEkdTdBlfNHhiCD/bfcGbAnxTjvncmOVuNjuY2i1+W/vMAnQMHKL27xElTOk0811EWtsn8AW9xfZWZlrbUP0imlUiU6V X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR06MB8447.eurprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(396003)(136003)(39850400004)(366004)(346002)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(26005)(2616005)(9686003)(1076003)(478600001)(52116002)(6486002)(6666004)(6512007)(6506007)(107886003)(83380400001)(41300700001)(2906002)(66946007)(6916009)(66556008)(8676002)(8936002)(4326008)(5660300002)(66476007)(316002)(36756003)(38100700002)(38350700005)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZedDQ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qgqkfO1B/rnB7QSXSob5NBdMpMwMFurZpOGybSKP4J95lfqXQuHfbNxvSTnBjvTewTGI/YtkOoGkFoKLtWCjUUpPuUycCq9ejgVo7tye/r3va6QtWklOYklLYnjq6SG/sltpD7ssdyIgGvUm0DC5g76nGWs97oc143x5mBhu1KC3CL5/lXAO7HZooCHNEgGVHuUcHGfBnstkC5Rt2BTGrvIKVjJqEKNOKXAgjIHKiADg0ieeDrtLMZ9/agyuLVUP9nhkDfMdRTUBNhzkhlEe8sNR+ycUXl6NeBCQ569nW+ZydAb6wUkIEEFGB9+VRhMI5Vju9ARL/mR8YK7mn274MRpqTkmUgX7glkExRq0ah7mgiAUk43Qojmu0Pm+eAjpZ9TKKoofOIo8BccigehRRrA3WYFsCp2xECLwC8DfI4CzI4ExqFPp7nEIlXDOwQSBkXJC10dprjLwBgVIjXCQLj/+yU+wJwO1Q7jzImCm0LaR+sJe4MVFzLf2AY6JrzHMxv/MASrb1q70AVDLUEnS/4phqEI9d8b/9gsCh3Lw== X-OriginatorOrg: vaisala.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68d78e36-d2f3-49d7-cfc5-08dc0de4851a X-MS-Exchange-CrossTenant-AuthSource: AS4PR06MB8447.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 11:50:31.7619 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6d7393e0-41f5-4c2e-9b12-4c2be5da5c57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /lVvyR+wfkpCszI0nT2pPvLmPQTLAOb+DOrtI03FwiOq6Yt1oU5sQlZfa3/s5F/0A2PWlZmS6PgUuMqYT9VUwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR06MB6490 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787251097132573906 X-GMAIL-MSGID: 1787251097132573906 From: Niko Mauno 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 --- 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)"); /*-------------------------------------------------------------------------*/ /** From patchwork Fri Jan 5 11:49:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niko Mauno X-Patchwork-Id: 185373 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6167807dyb; Fri, 5 Jan 2024 03:51:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCXBptfAS1sdF/M7bpOrNLSkGbpf9ugM91l2gzezd+oZ0FG/C9lSkllgkmTXoeaxxcP7Zf X-Received: by 2002:a05:6e02:160f:b0:360:6203:f4 with SMTP id t15-20020a056e02160f00b00360620300f4mr2433445ilu.0.1704455479947; Fri, 05 Jan 2024 03:51:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704455479; cv=pass; d=google.com; s=arc-20160816; b=ZrHusiNXCGFv9njB+u76H8fDKAwo79CbtnmiobaKy/iSu+lEQwmE5my+FtJ9uB0Fuo Yvh2M2MepGlZLH0h7raq/SiLB0M3JjhPZPqbLrzYTRX3cswDuL4eXgFScfndFZ6RSy86 3LTWlVtxVM2WoetPmy+u8DHoSlfSsj/2+XZpmnmnIUYc+8DRv3sezX/7m2b3SWO4MZrp y3WqX5ZohBia1fvNJEFJ3xX20pF2WSJd6wJSXPcvktq59cK2M3KpFraygyMb0sHT3Ioo D3g6CcuFeGNqAqA4o0vFxcXKSDKB6LR79OQiSil24ZEruz0lcmUcIAU8ERMc0q29w2Xo WkGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DNXNaRVb0moaAFMdD8RxmAK8lvRkL/oF57z7r0FZP/I=; fh=Qaxyq4XWyvQXxjyl3VzlL20fnPQtPsOO3A2N+wWcYmQ=; b=L4tFk7vZk6GQDjOyvZKZS93DsJG3C7o+XrZZkSoDsgpCRN07iNkoYQRk7rxhKAxdF1 VrEGzY3KJFOjBBZ9gXZowN1Q4PdxRltIO1Cm6nr+Aq7EaNZdnr1UjLmUxK/l8oSbc0fu rpj3Qax/xLLKE7reNd/xv/IEzlVlfeE4CDQeb3fC1MX2pv3GCk3i6OHy+jWTGUZX7RcO k6mQymD9rkMiQoRpIrpBpNSQKirzoBrZpWZSxHdYSybKsTZg6pOFiDH55hEMRDh5gzLB lA+4fgzAyUoZQ5vBQkOvWJUABmtTMnvLIOvpU1xZjc7qL+ov1Jh1cM/CTn2JInAw7N0Y /8Hg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vaisala.com header.s=selector1 header.b=iKOzfGqu; arc=pass (i=1 spf=pass spfdomain=vaisala.com dkim=pass dkdomain=vaisala.com dmarc=pass fromdomain=vaisala.com); spf=pass (google.com: domain of linux-kernel+bounces-17817-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17817-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vaisala.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h20-20020a635314000000b005ceca000849si1146882pgb.195.2024.01.05.03.51.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 03:51:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17817-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@vaisala.com header.s=selector1 header.b=iKOzfGqu; arc=pass (i=1 spf=pass spfdomain=vaisala.com dkim=pass dkdomain=vaisala.com dmarc=pass fromdomain=vaisala.com); spf=pass (google.com: domain of linux-kernel+bounces-17817-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17817-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vaisala.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id ACCB62849C8 for ; Fri, 5 Jan 2024 11:51:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0408E2D619; Fri, 5 Jan 2024 11:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vaisala.com header.i=@vaisala.com header.b="iKOzfGqu" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2056.outbound.protection.outlook.com [40.107.241.56]) (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 3C4082D601; Fri, 5 Jan 2024 11:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vaisala.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vaisala.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hCcQ0uXhYxQ+naes3nxatP1467Nq3bBtsTUmeT++FY7zu/7DNeYIURPl2UqccPrGNF2paVFonUzkiEJ+BTpJOJ6RsvXqRSIDJczXK+tHx+vFXYha9hzJPujYTx1UhCUOp6sAfUUewbKNDI+HiAx/ZeJ/qlZYiMcyZ0u7Q2KlKioI3v0AvpICWARN0fo2SsGGht/HiaopBdHBLNvmIbswKX6cn6df37+mlxO63/taDbMiyOt4o7Qitqpkrmfk3DNFMqUxveNIKmIF+1FKrmMeQm5Gy1MI30ZYwsw3D3d7a5YYpvP9cWd7YSL4CQAG+dvNykmrqgRWUFGNuj76iox4Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DNXNaRVb0moaAFMdD8RxmAK8lvRkL/oF57z7r0FZP/I=; b=V/mqf5EkuP5uiRFBHiyxq/m85VqYMMJMQCXAXZj1imqfTO7TakBNwkyGgIyuM/9Aef0Ly8J2slN4SQYVn7ifo982505kfFFZsoHBUgssDIiJM2ytmUwYVVtrvAnLoOvt9vjnbt0o4PEHbtuXDtwlROKVRVv55i5UQ6ltZDr0DPYKJOGP9cdDOpkKzvQRCgHtMzTr9FBYBeub8NaodvCn4iwkREROY2Xw7pDBtJsHIm6ub9jkBnhuWkVwv59ltx9Rs1KOVXaUklVXI93Sv8fW9JiZ9gB+r7kI7rEYx8hcDQiuWGg8PqHJ8zs4cjslCstUP0MGobv0QGDabJVbtH0hag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vaisala.com; dmarc=pass action=none header.from=vaisala.com; dkim=pass header.d=vaisala.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vaisala.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DNXNaRVb0moaAFMdD8RxmAK8lvRkL/oF57z7r0FZP/I=; b=iKOzfGquUhuvXrGdxvv7b541bGkWC2RQslU1M+A+BE4IG40dGFoDzprrDqSasrQNX6Dc3gnRCojBIrS+mHzlD64IZduSSCETXvR9VAJPfmi/zRVX1d26xEleQR9c7SAWlhGOBl4FdmIN2ARJ5Ms/qsk760dOl2spQ3MebriGgJT+K36GXZlg63ZEpLwbE28Oy+ZHLqBTIKvctxAc8Vz/Qnfyd2uoiE38S+gIap/kaZGucAYIkIDrJFaQuCp89BMnFFpFNLG7mo0u3ILHcGwBh6Hh4YypEvMK+58VLHoDC8Pw4bvue/hQTGK2ztwCchb/BqZK1nI5VgxNftIQxlpSkg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vaisala.com; Received: from AS4PR06MB8447.eurprd06.prod.outlook.com (2603:10a6:20b:4e2::11) by DB8PR06MB6490.eurprd06.prod.outlook.com (2603:10a6:10:124::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.15; Fri, 5 Jan 2024 11:50:39 +0000 Received: from AS4PR06MB8447.eurprd06.prod.outlook.com ([fe80::820:f7b6:7f2b:324b]) by AS4PR06MB8447.eurprd06.prod.outlook.com ([fe80::820:f7b6:7f2b:324b%4]) with mapi id 15.20.7159.013; Fri, 5 Jan 2024 11:50:39 +0000 From: niko.mauno@vaisala.com To: gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, vesa.jaaskelainen@vaisala.com, Niko Mauno Subject: [PATCH v2 2/2] usb: core: Make default authorization mode configurable Date: Fri, 5 Jan 2024 13:49:56 +0200 Message-Id: <20240105114956.30714-2-niko.mauno@vaisala.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240105114956.30714-1-niko.mauno@vaisala.com> References: <20240105114956.30714-1-niko.mauno@vaisala.com> X-ClientProxiedBy: GV3PEPF00002BAD.SWEP280.PROD.OUTLOOK.COM (2603:10a6:144:1:0:6:0:7) To AS4PR06MB8447.eurprd06.prod.outlook.com (2603:10a6:20b:4e2::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR06MB8447:EE_|DB8PR06MB6490:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e797143-9dfb-4dab-b478-08dc0de489a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9uPbkcB8C6ioT6WlI8KQy3W3HvGUDna6Q4c2n+o8Dm4/sd1UaRKpr0x7ZOuC2sZaifjX4lylQpYNvyjQEJQcm6RJl6qiR+ogDj/f6I9hpcjbwmiDKrQvqkBL8EiglkUDJ2zK8EikrtcqqI53Q3BRf1ci6qTfTfcRG5k2oY/w9ukSZSLA8y4gf5nwQmKIntfT4rfK9vvy+OTXpYXFc22h5EHnnRwYMthcSFN3Vs6QXG6hjJoL9HvWGS/VUt2AEJrn8kMMHUbx6oZoLSLV7WpfclkanKy/ez5PHeyPI9nbxGhwDsdKTbqDfc7ehE8WdqDO0VjEnVh3XcleUyKteXgZ26ngfRqYL8OhLQtUjPI1tcyXCan7Z11AqlJy8PT7/2KjrnDzUb3xpks9HpXPCr1oAHXLoreDHpxRqx9LopvU7hm8RSG48wg43HiU0My/YhCFHwZT0psSN+p22lhfXte3sPNSaw2hMHvLWFTa6imej2NmAnehks/0lNZDJ0YWPXpCls0qxzMQ+CynFjmtqKKCBTqVoxhTVkUNPENMQA+BqCRPEtd+uJ6BMC3hH9isOeCHu2cBc/idQVcUyqC/XCj2obp9lV/6jOLkDMf5Dg67yhbeV2TQGh/gwds9bk4hq0KT X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR06MB8447.eurprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(396003)(136003)(39850400004)(366004)(346002)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(26005)(2616005)(9686003)(1076003)(478600001)(52116002)(6486002)(6666004)(6512007)(6506007)(107886003)(83380400001)(41300700001)(2906002)(66946007)(6916009)(66556008)(8676002)(8936002)(4326008)(5660300002)(66476007)(316002)(36756003)(38100700002)(38350700005)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CieqGXmA1jjp9wWlmAjkNXooUpjRzujLfVJcW25aX/q6YSLw+lM+/4sCfZh1xARrayAglgbZzdh5ZVpLrWdYCyXI5MUxZ23pnCv0e6rzmgo/ciHlum8Gyyx0ySX88rzZwh80sukIV9qA6wFwc5cZr8NKIRtXxM5+76Y09sXEdB/wIZKque4eFOsXilGQkDd3DXGVrQ5Az2gdazobNtm767iPK4OGPkBqaPGo/qWPvxrMrcYYGGvShkaj9ASGYoxc7QKmB5yhUmeR8SSolNX81Q4wg51M0tEBf4z7H0gDT6VmtVEzfAzKMUT1uCQdXrKMfyn4uKwnaLxtq3PjC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H1fRYQB5lKFC6bAmor28B4zGF1UxPoqFTQHJsrpgn0wiozCMZryUVY/wMyoE7hssvplSwJsTRTRwxgmBWOEuWjnTT/87cAWjfdE/kfFbICfEcnL38eVeGD24KpMtPMT/yGZwp9FMuBKeZiWA6t7S4E1X4+lLP6z/LFOjV1k9yXWeeBvSAyfUV1Km2lc1uFr+7APri+um1jWWnQkgrK83EUuu+g== X-OriginatorOrg: vaisala.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e797143-9dfb-4dab-b478-08dc0de489a8 X-MS-Exchange-CrossTenant-AuthSource: AS4PR06MB8447.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 11:50:39.3942 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 6d7393e0-41f5-4c2e-9b12-4c2be5da5c57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YQvJtENzXDV75sK0ksoy4Dg82duuVwr4PdDQQjuK5ojQwcFkiAbzGA0IJWl52UK5Iri5fSAd0Mr9RX7Dp/rYCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR06MB6490 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787251109306668442 X-GMAIL-MSGID: 1787251109306668442 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 | 17 +++++++++++++++++ drivers/usb/core/hcd.c | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index 351ede4b5de2..f337aaea7604 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig @@ -116,3 +116,20 @@ 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. + + The available values have the following meanings: + 0 is unauthorized for all devices + 1 is authorized for all devices (default) + 2 is authorized for internal devices + + 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)");