From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ADAB7A00C4 for ; Thu, 17 Feb 2022 16:24:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CF18410FF; Thu, 17 Feb 2022 16:24:23 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B164A40042; Thu, 17 Feb 2022 16:24:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645111461; x=1676647461; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=YjdmuAzQ8hYD3/61eBB9azAZBoN2SEgAGinVumghvjA=; b=BFlEJTR2yVVj34Fyrbu/o4faVOFAS0OJGKmtTMIpZQEm5QcxSEJGo5ww rptbva+rG569DIWtJvRKWSnMCLmDHOsdHyQX7iFM8Pjzges0zX8mlWWSL JtBseyMT/uUxjk6ty28745pnA1i6bqZr49yeIFR9vycuThrRYUeAb17Nz FHk186AhtJ06NOlUdKZ/zRuRlbyDXsw5FDqnulUHIOcrG4ZXxx794jb0o 9q1G8ppDtYahwhezKsYTfK8o7KGKN30koLvu3sFvdzgg1cqwgHrp7UhTu SXOGj/dyD1yrMGDR7tXKCp/uTbEIjS0R2cF74aPMFnYpfMakXi6h9PKbT Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10260"; a="250632436" X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="250632436" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 07:24:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="541154132" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga007.fm.intel.com with ESMTP; 17 Feb 2022 07:24:19 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 17 Feb 2022 07:24:18 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 17 Feb 2022 07:24:18 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 17 Feb 2022 07:24:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k4dXA3J+pogTASCtpmSuEMAzb3VQ1hQkU71pDfHIL+iB+pVJFSC/iVsvtDeCMHOjbkUrwqtE4wb3R4xEme1zZIwQNzjgEX2bxpDWThLdQPpLciFwg1CpoGAOnoEcyuGCle3N27lPhbb5x2EPHeQmRTlKMIQZoHRsQeuP9q9OY41AqYXcK+A0Zf/rJ59h9wuavMOpvR/XfuqMv5TjrK6uAoPYlENZDwV1zSwwUNGmnTWhOg0QagyjiKOtR1iqMA+QPlDGjA8ZYMT1KYCTrws/W7jdbSxl2tMRJFuYdRZdp+swhz7VEaE618u5JIDm6+izmni6SCg9N/hEssrK1hu6ig== 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=jBSzqxGgEYO/WG6AeWGpkp/ZElwIYUR1I8IOZRAEBuY=; b=NDcyw/xVBEMZKZPkd++Rs11h9uRFhJ97vkWz4bdrHNFp2oA8ijrUfuihqf6A4BhyO6UzsA+aiDT99f6cAAph+3g66eNyzqMVbSudm4uWNFzbnRxlWE/oK/FA7t1tUijrdAtrWwZ8Vuy5IJaZZm5JqRZqrXA+hXKQQk96631c+vZzXgrgMuOlineRNE1yiBtTsraidoN+YUtDCbubHlTCkwqMaF+1jqRU0GL0/ngtddNoqjWHOdza0DT07OImoPES5kV6nviDg1MmDl0XYoYGHNg8yam3pI+VsE046zBKY8bKjPc14AxGEAmmR8xBBh18Dgrs04NI/1pCFE1Tm1Elvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) by CY4PR11MB2023.namprd11.prod.outlook.com (2603:10b6:903:30::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12; Thu, 17 Feb 2022 15:24:07 +0000 Received: from BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::6d2e:b8c1:3247:f9f9]) by BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::6d2e:b8c1:3247:f9f9%3]) with mapi id 15.20.4995.015; Thu, 17 Feb 2022 15:24:07 +0000 Message-ID: <153e9fb1-8568-1c82-0281-ca74bce0376d@intel.com> Date: Thu, 17 Feb 2022 15:24:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.1 Subject: Re: [PATCH] distributor: fix potential overflow bug To: Bruce Richardson , CC: References: <20220217150239.69876-1-bruce.richardson@intel.com> From: David Hunt In-Reply-To: <20220217150239.69876-1-bruce.richardson@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0151.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::19) To BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a410c9b7-bbc4-49b0-849d-08d9f2298a00 X-MS-TrafficTypeDiagnostic: CY4PR11MB2023:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XEROQN0WLqDA8k+LI8KcMbxOru7Ct+EtSuGytvl5kuASBpn/cJihNS1UO7neCM0zslEYJXjdcTnVjhnTc6XeIRe/fEjp6uqnszDvRGNtJH9h1+6Q91xXsRvYN/T+Eyqz+xF5SNFRoqSKfshak+2GzMiRVWuHyz/MrfsvNL8lGLd4lz6gI8fEHGoVkGvK4MJIvuluc67jKzJ/e6cX1mvcl9kR7RSkXvo/gYtSzbspXR3+mQWc2XwRa6Idnz+dtP7xyZ9VLD+Z4VUA4s9henfHd56Q15s7BVIx01LBfh4eJFjhewrRR1hVZX2USZJCuN/+WyQcQaUqRCt0bc9j4Sx/NzByVrrWb5KC00Bm4EKO2Ctzru/mbbsXtSlGH0dcvP3MgRlrp+CkgdXYWRjIg0HYTw6xu1uq6iN6XOcGUTdU4Ejl1iEMMvyyFQDhRKP6b3TFPXZr0q1N+OFClU6bdy5BSxNTXB/Gb7b+VpUzu3W+itLTLqxJrLyFVL9mJmuiVosbx33VYVVE0jiRwdDoCk1sqF/R0aFxhCnm2I8Qh0pADrN8QND5CMbUVlyAJn9h6fDiD/er+zv0+tZRjPUt+NtLGLkltK4nDeIOI6sUjV1GoJ3uUcLlwzhtPdyGAHza3BAaoX+qKkFBlv2J5IT5Iq8KMnLoldRWuBlsh5AQeaazKA2IAWItOtgTBpCSD0BZDzxBfBXuGs32O2sYhuUE0lhcRFrZUYudiiTHC0JWEkZgK70= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3799.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(53546011)(316002)(8676002)(31686004)(38100700002)(6486002)(36756003)(508600001)(66476007)(4326008)(66556008)(66946007)(2906002)(31696002)(26005)(2616005)(450100002)(44832011)(6666004)(186003)(6506007)(5660300002)(83380400001)(6512007)(86362001)(82960400001)(8936002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Mlk2c0dxOEpwTitlS0RvY2p6WmNNZ2c3cWVkaVh1bWM3YkYwc1BFL3A2cVJF?= =?utf-8?B?OFk0cmplRUxmeVp2SkZGYmpIU21oUmsra29yZENZcEZLR042L01zZEh4SEli?= =?utf-8?B?RzNIV1lXZ0xIL0FodDhzMXBURkJYc2hKVzVtb3ByTnFXYU1ZT2JLYXlFWXR3?= =?utf-8?B?UGsyUGJwWXFYb3d0SURiV2FmQjJtczZPZmNwN1lNYTg3WTlqMHkvUzBUZ0lz?= =?utf-8?B?ZEtmcmNkS2QxZlBGWHRDcjB1T01JVTQxMEtoQitabjl6Y3BoMUpDQ3JrOVdy?= =?utf-8?B?TGY5QXliYnp5NnhYU016NGJ4UjdaZ09ybEFQbXlVNk1kZitidlkyUTFHaVRQ?= =?utf-8?B?R210aWRud08xdVpFQllWWi8yWUJvV1ExZ3h1M21hOUtteW81VDFvMU1OMHRp?= =?utf-8?B?UFl5azY4VFlXU2hPamROcThnRG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c4-49b0-849d-08d9f2298a00 X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3799.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2022 15:24:07.7037 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ih0ukOQ87p29gTKQUYlR7pF8yLdy+UaR+UvJrjxhakhu+3Uje9D7rOBOCEzjPNOldcsQBK4U/LlA+apIfIonPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB2023 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi Bruce, On 17/2/2022 3:02 PM, Bruce Richardson wrote: > Coverity flags the fact that the tag values used in distributor are > 32-bit, which means that when we use bit-manipulation to convert a tag > match/no-match to a bit in an array, we need to typecast to a 64-bit > type before shifting past 32 bits. > > Coverity issue: 375808 > Fixes: 08ccf3faa6a9 ("distributor: new packet distributor library") > Cc: stable@dpdk.org > > Signed-off-by: Bruce Richardson > --- > lib/distributor/rte_distributor_single.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/distributor/rte_distributor_single.c b/lib/distributor/rte_distributor_single.c > index b653620688..60ca86152f 100644 > --- a/lib/distributor/rte_distributor_single.c > +++ b/lib/distributor/rte_distributor_single.c > @@ -247,8 +247,7 @@ rte_distributor_process_single(struct rte_distributor_single *d, > * worker given by the bit-position > */ > for (i = 0; i < d->num_workers; i++) > - match |= (!(d->in_flight_tags[i] ^ new_tag) > - << i); > + match |= ((uint64_t)!(d->in_flight_tags[i] ^ new_tag) << i); > > /* Only turned-on bits are considered as match */ > match &= d->in_flight_bitmask; LGTM Acked-by: David Hunt