Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15671351rwd; Sun, 25 Jun 2023 22:56:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Ui0d9+gPsW13gjxz7V91CgU0qiVxsJVmnEAQau8kKTeHSetO/q3mHX2uePD8NbBdDAnra X-Received: by 2002:a05:6a20:918d:b0:126:f0d8:445e with SMTP id v13-20020a056a20918d00b00126f0d8445emr3891796pzd.32.1687758962639; Sun, 25 Jun 2023 22:56:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687758962; cv=pass; d=google.com; s=arc-20160816; b=CfSt6FSpJRGoL05hlgnnQu5QSLasFPEVoeP2jkldPFmmKfABDEVR2cU7RfueVOSZTz mttbic6tq8S9qXczxHDkHyrE60N5QyeyabtQ7QPSCllHNgCrwMWhhwhwAuUT3y08veMV ZPoMncCcRSPnzF1+F6bfdiyhFt7uYMT80neAVcGLZSzYnNDHtav+0hdhRZ2pQT5F1n0X GGN77c7C4U5h17eloUiLm8mxPVRM+h7N8NQRhMHCO5uk7t6KOappYfLY0/X+M3HSs2CF zjV56ySkBSjEPHCeCivu3dqeOeimnDMoiBkLK7VDroCkWY90hrlQ62QQ6oLt53DsY2JN 6PXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=5OIfhZel9OSIrMnwV9oqQHwKNabLshgbuxOifQmEuME=; fh=mVIJh9X6gTc+r6wF4WzYmLLdzFivdTOw+SKB2MM0dtQ=; b=uhaVH26W+lb8EUp7ZryFBnJprf/AENldBP36mcwgextywpYaSX0THEwRv2aKKb1DGk eIYHjf1SdHtc5IeUDwDwXb1Lca83Hw04Y936hsVQwUE4uITCPeXtVATyRsnsQU1vRJzH uZp8khHgDZTmlExG2QGbbkElpQrYvEYyxaf/gFH7W9wNE1dWj5TSe6JS+hMN0m6YKmeD SpjCG668jxLQ/R4iRGjSBpHGXi/jbHxPepb4S/WGjfSyedqM4C8gHYWEg5J1r5f6lclz iTbYnGY+/+qnFqAaoJ1ZTgSBfo7aamZflbShhw3yfs51HfX2qbGTTPnUXChOpDTBYH6d 04kw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=QbEQd3om; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x185-20020a6386c2000000b0054fd5f23cbbsi4626460pgd.727.2023.06.25.22.55.50; Sun, 25 Jun 2023 22:56:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=QbEQd3om; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbjFZFsP (ORCPT + 99 others); Mon, 26 Jun 2023 01:48:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjFZFsN (ORCPT ); Mon, 26 Jun 2023 01:48:13 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaf::604]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4DA9AB; Sun, 25 Jun 2023 22:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nGALV/Bgjr9Zgr/jaXsWO667wUCIXnS00EhJbUAORrfQcoT800jr6YNULnserDwGYs7neQhVbR9BjgrdRrzjkMGWel8L/yestQU4LbT4gExU/4O7/T1+4BjJxwyVODjAq+myIaVsD8Uzs2Cf6V3HKlrO4URS5Eo18MLFhUgWTRaDlWAb/2vMkBwG+iQ+MaNpczUO7Yg3uKKppC/+RrfccMtBi+9JVIXMSaVMsHNzJCGLH7V5RF+BDbCiUyb2MxFpu4yRNFJ6Uwj7IV3UW6JceCloSFNaqmGdJRvze8sUl8Sf4eQbnw6xh2jgSv5zSFGOHeAJDcngWrGvPW/DGNojyw== 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=5OIfhZel9OSIrMnwV9oqQHwKNabLshgbuxOifQmEuME=; b=n2nY33vbEHPNnUclYBujDTni5548h3VaKnjyC6VKHjmC4t4mx4qwtLWDyuYgTUOf9/ZocoAUTNw7LcT+L0FFxeeB862giB6xc4TkGB86gSvMuUmBoLCyrKYsGu5usUBRZOhGBDc9dzQ45eYtWpN3/ycMbZ8qGriTx9zL/G+crIAHeW+xAD+DHzZTO4FK/a/lDeQvzMdUVUeGhCsWvcZwvcEd8Vqw5NkoIbirUmgl+eP3ccEuRynsMs6Itdx2EPMAfq9jaL63fC/6enrX91hzKGhcGegvKa3j9YHY2sTcWVEJeaB4nwwNrs/LYXxVx4WKHmUoE2xNKOoGpagMPJoAsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5OIfhZel9OSIrMnwV9oqQHwKNabLshgbuxOifQmEuME=; b=QbEQd3om9N8XlGHiXHkO7Lgegxtes1q2FZd59e+UiuTDx/qYIhqAjYBaZCdFdvJsXOc8wD3uvOEhq8xOhNgzwyF3poog0g+a0YPB8K5uP6v1hWdqMcMMxDqfaKKW1Lbqv7+yavYfZWhnXiEGfpH20vCB3xPXqmlNixcxXNLIL4FCSeHkFYowLC00TSZDKS+DXTUx48TboY1d3/HPRSCQJd3kV2AOrd4HVs32obAjXcpdUDzO3iHR2Bme3owrfk9P9ZDHUnBKxWuZFwJ14SHWMfYJbos1j2XjVwj9oeSh3u6IvY0SJG/ZLvWOvHvejFY6H1wEPWK0TX8Uc2vECKFEqw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by AM0PR04MB7028.eurprd04.prod.outlook.com (2603:10a6:208:19a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Mon, 26 Jun 2023 05:48:08 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6521.026; Mon, 26 Jun 2023 05:48:07 +0000 Message-ID: <1c8ff405-2bfe-37ff-42ba-aa4f81853475@suse.com> Date: Mon, 26 Jun 2023 07:48:05 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] xen: fix potential shift out-of-bounds in xenhcd_hub_control() Content-Language: en-US To: Zhang Shurong Cc: gregkh@linuxfoundation.org, xen-devel@lists.xenproject.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, jgross@suse.com References: From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AS4P191CA0003.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d5::18) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM0PR04MB7028:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f82fd14-42cc-436e-3c9d-08db7608eaff X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nF9SemVm3OVNylZqEv1SRMwbuul3RsgFO3cpD8IALrGWMYH3S9bUp09glPbP8rMSOJ9Pe108r8O3NhgjyjmkDjJoc7Wgh/qloQbCuJcAv5+YS2IZo1B+ObbVkamdJkYtnGGitKfxAyJf8xbq5V2BlOPkk/dah5yb1ADbajy2bqn4XYC35wQKuALDcYNKueQ6ZWYvf1rNuSEBTT7Bi9JK+Af14wmGtqf7XylAKCsEmXzcT/LYB1nbVEAxPILsUzCuPlHX+fkHoj5Fy8YHAMJunvwM+Qc01M47AF6OArPtNFI9x8bPquXlBnMPoEYWd16R+rcexJ6bAu2NO5C76F//M3t3EUPmQLFHYLlGmqgEvCS0KfPpFWA4vJPBTUbzWTACQKJ7z/kpu9zCRIY2FW2rT7td1AtnV1sl5VhKIpWUGybdUBstt744QHdHJgHBZ0OiX17szi6dPfemDtxTbBXvB8yERrJW9ZbChEAB6udPpw0jBa0tw8ehxmFEohq7UAaBY83YfHsg8WbIeuBaua2k7O5bTTMtPkvjyK7LxFfmWe8A0AKQlO3fbauoxuvLVVKG+W8YF1OOT8ictnUsMzceLKU63jU9j78BVjkn4hdnHe26ws4o4xouoMArjt3u+Nwds1UpiR/jPQQ9G/APzu6CBw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(39860400002)(366004)(346002)(396003)(136003)(451199021)(31686004)(26005)(36756003)(5660300002)(6916009)(66476007)(8936002)(8676002)(316002)(86362001)(4326008)(41300700001)(66556008)(38100700002)(31696002)(66946007)(107886003)(6486002)(6506007)(2906002)(4744005)(6512007)(53546011)(186003)(478600001)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WVlpZU05cU40enFtSWlDVDZuSmdPMHo1Y1d0ZFhhVVR2eEM1TFM4OHVlSUZQ?= =?utf-8?B?bFRQZ2FscEZUaVZXcXlUSk02ek9ZZGpsdkpTM0JiQnhiYzB1UjMvVGFzQXl0?= =?utf-8?B?MzlaZW00QXR3ZUxHM2JKUXNCVkM2M3krUmhHWHhmamNmaEFFN21OT0ZLQ1B2?= =?utf-8?B?OSszdnIrY1hvaWlRRW8vYlVkVHdIZHFBZWxWbTk3QUhLTmpaQnBqOEdIMnU3?= =?utf-8?B?N2l4a0dHZ3FvN1I5VG9tVzNTTGpSeVF5ektOM3czRWhqaWVEVDV5bkRteUdV?= =?utf-8?B?ZWRtSjRIeXYyV1haYUI4WkhXY1pWQlc3ZkxrRmxDVXhkcHRrWjZFV2VKRlU5?= =?utf-8?B?bzJTYU1PQmdyYTNTclZWRS9tQ3N1Y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-Message-Id: 6f82fd14-42cc-436e-3c9d-08db7608eaff X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2023 05:48:07.8926 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pXOFLzBhORRexMX92nieAgueVNeErH35rI/2chGIpuf3PUAxqN/q6d2NyB74lJQrtFz0gUoUZ2O3nbVHDhFOhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7028 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.06.2023 18:42, Zhang Shurong wrote: > --- a/drivers/usb/host/xen-hcd.c > +++ b/drivers/usb/host/xen-hcd.c > @@ -456,6 +456,8 @@ static int xenhcd_hub_control(struct usb_hcd *hcd, __u16 typeReq, __u16 wValue, > info->ports[wIndex - 1].c_connection = false; > fallthrough; > default: > + if (wValue >= 32) > + goto error; > info->ports[wIndex - 1].status &= ~(1 << wValue); Even 31 is out of bounds (as in: UB) as long as it's 1 here rather than 1u. Jan