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 D0D7C45C89; Wed, 6 Nov 2024 03:04:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CDCC42D3F; Wed, 6 Nov 2024 03:04:40 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by mails.dpdk.org (Postfix) with ESMTP id 1F55D4027E for ; Wed, 6 Nov 2024 03:04:39 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Pyj71OAOHwhzmCx5AapYEnGaYvaM7uLPzRIwylmU2ew3lqs9HAuTklUz+i3ifg0j07z5KN3wOJ59LIKDwJ2Fy343ap/ms9vJ93XmQ6VAuZXTqZNdn9YXG1j7EdaFZbzAQbqd1jaYU4aeQgsudavCNSkXPeWKaZ/dcfzrjl9wL6PfqKE6Xkluzt7NnvaX+4ZIhejsw5Gc8uQyqrFpsYu/faQxM6L2g6TafaxgT00qFckc2PsVXZvPoNtSuA0jfc7iqYmYNhoHBT6vJCnzRMk0K/MdYvPFjr2qpMLJTM94U6rTRvqhqUJmr5UT13YRnY5/yYRQ8uh8ejE4Dug7Ph2OLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=XPPufFDlJAMMy13b5pIknBVod7TbCRQIvWm5hhCWgyQ=; b=Jz57+ggozRjyTliygOfSOv8zW9ZWS7MTWrV9OE7afTxIXfSWQM0W7511NAYSUfCQPz3Y5CKjakf0tQVG3wfIZyMY6VLN50Ng7jnx8ygeihFcAtthrrd7b5DHO1lGItENo4kJ96LOpXG/obxYVBUqYTiuVTc4ICKXlybdCZUblWRLXqybbnIAUSh+B/1I5ecc8YBWU7Sd0ZnX3OgdG+uGF0kKJc/Ng01vl/oZTgm8ygr/Y8kgtGkNvLlx25HNJbFA+0+JqQOw9YlC2TIS5QUSNja/l5tymAHovZtHxslbJXcGzP7EK9BtXp6zWRNYtrcazHxuRu+1SgPJ2QbW5QBEFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XPPufFDlJAMMy13b5pIknBVod7TbCRQIvWm5hhCWgyQ=; b=PevMAtNUHCtViOKgO5cTYnln0U7prrfSFQ3hTvxWwG6i3t+1iA9wdi9GHyXnOBxPNOnWzvuME9TULPtwF6pPNu+nK+a8HwzuMqBDL6MFYq7cETG5FtS/328T8rhEet3NNzjTgrMODtOXoH4TJogvYlCImhYTKJ/OLg45/V/CEO4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by IA1PR12MB6066.namprd12.prod.outlook.com (2603:10b6:208:3ee::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Wed, 6 Nov 2024 02:04:36 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%3]) with mapi id 15.20.8114.031; Wed, 6 Nov 2024 02:04:36 +0000 Message-ID: <6ccc2c14-58a4-4acc-80ce-089e1858fa36@amd.com> Date: Wed, 6 Nov 2024 02:04:29 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] net/vmxnet3: fix potential out of bounds access To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , dev@dpdk.org, Jochen Behrens , Ronak Doshi References: <20241024110129.791362-1-mb@smartsharesystems.com> <20241104105220.1421305-1-mb@smartsharesystems.com> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <20241104105220.1421305-1-mb@smartsharesystems.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0642.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::11) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|IA1PR12MB6066:EE_ X-MS-Office365-Filtering-Correlation-Id: 719405c5-8a2e-4777-73e1-08dcfe075cf5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UjY3RjV5SVJvN0dGK1dvcCsxNmI5aHcydlBaUW1tZmJobTNPVllCcFZUWisx?= =?utf-8?B?YUpUb1ZWYmExZ3dQV0lPMC9zQVlJNW5oNDl6UXZjbUNvM0tXMXpNR2JRbmQ4?= =?utf-8?B?TTV3L0E3Y3A3OFlLSDdTaThXa1NxbHJlNTA0QWt5ZU1PQXNlMXhwNTlpcjlQ?= =?utf-8?B?QkRzaXNWTUEwZTNsbSsyOGdJWVFuWEhPTFhMZnRoMlFXRTc1dXlneUFFL3FP?= =?utf-8?B?Nng4NDE4d2lXL1lTQUoyQTI0dFVqMkdiSUN1UzJWTDlab3NNWHpOS0pQd090?= =?utf-8?B?Rzl4aE1iODgvVHRSUUhlMldxVmY3bXFuaDlxZjJxRHRXbS9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CZktCRit5N2RMQnZnZStwU2RVZW5tdk82WHBTc0Q5Y0pZ?= =?utf-8?B?V25ncGU5cGJuY0N0Y0hIcVYyMk1WMjlIY0RBaXp1OHZUVlFPQ0MwQ29jclhK?= =?utf-8?B?bVBnSGQ2Y3JMZGF1LzlWL0Zrc2RON1VyNWxnM2NlcTJ2L3hQbUlKSU1HM3VT?= =?utf-8?B?bWNCaVVqR0IydVpNVDJLZWVyS3I4b0Z3VHo2U3h6cFQyMWFicFpIUllhUk9L?= =?utf-8?B?c2tLdWJQQ2w2WmltWHI3SS9MUnkxVVY5eC9TWUpQektOc0JlZjVCdGdkTXhh?= =?utf-8?B?V011bkt1WnhPK0x3d01PZTFROS9BSTNiVFZvdUh5M21Ha3FyM3hRczIvL2wv?= =?utf-8?B?VnNFbjZQdzhaNnEyYnY0QWVOSzd5SzVoand2MnRrcVZDa2xhSTd4bzBnWGdS?= =?utf-8?B?RWdaZEREeVA1eGJFQVZ1d0wyelBrNm04VGVLeUtGTFp6M2VkdkhNMDZRQTU5?= =?utf-8?B?K3ZhcWVnZG1XY3BmZk1IRWsydVMyU0tEcEdXQnYvZWRTRmtacE1ZU05HbUhV?= =?utf-8?Q?XzYfmxjXnXcWbRgaINqNpDUY9ZlqGRBYH74jARk?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d1d4eGI3emx1V21Fc3JwM3FadzlLS3N0Z2RJd3hkMFRJa0lrazYrM1YwSXFi?= =?utf-8?B?dzNodWZYQSsyQkxJL0dRMmprRFAxUFhMZDRHTTRuQ0JHQ1djSC8yOEZnMm1q?= =?utf-8?B?ck50cTlxL0NkVE5vM082SThRRl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= =?utf-8?B?MFM4UG1sUkkreWh2UHpXWmNiUS95Z0FJK08zZ0FpV2IxKzR6NkRoRkRFYXFN?= =?utf-8?B?b1hQdGtaQkxkUExrNWVtRWRnZ0o5Y1Y5ekRWYmw4OURROURKb3Z5UnpTWXdE?= =?utf-8?B?cFEwTFRnZHNGNHJxZFQ5OHFhaWdGU3lZc3VyVkdJdzBEelVvVENKWXpCZytB?= =?utf-8?Q?p9128A/Fkn+qt4IBi1/HCVTI4?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 719405c5-8a2e-4777-73e1-08dcfe075cf5 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2024 02:04:35.9951 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ov6n1q7HZsLX8TbanbSxWzeNCd/V62Ku9K/FPxVy9EoJVBdWezfTXWAu1OSfVHLM X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6066 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 11/4/2024 10:52 AM, Morten Brørup wrote: > With virtual hardware version 6, the max number of RX queues was increased > to VMXNET3_EXT_MAX_RX_QUEUES (32) from VMXNET3_MAX_RX_QUEUES (16), > similarly, the max number of TX queues was increased to > VMXNET3_EXT_MAX_TX_QUEUES (32) from VMXNET3_MAX_TX_QUEUES (8). > These increases were not fully considered in the PMD... > > The configured number of queues to provide statistics for > (RTE_ETHDEV_QUEUE_STAT_CNTRS) can be smaller than driver's max number of > supported transmit queues for virtual hardware version 6 > (VMXNET3_EXT_MAX_RX_QUEUES) (32), which will cause accessing the queue > stats array out of boundary if the application uses more than > RTE_ETHDEV_QUEUE_STAT_CNTRS queues. > > This patch fixes this by two modifications: > - Increased stats array size to support hardware version 6. > - Respect RTE_ETHDEV_QUEUE_STAT_CNTRS when getting the per-queue counters. > > The build time check > RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES) > has become irrelevant, so it is removed. > With this removal, per-queue stats for fewer queues is supported. > > Fixes: b1584dd0affe ("net/vmxnet3: support version 6") > > Signed-off-by: Morten Brørup > Acked-by: Ferruh Yigit Applied to dpdk-next-net/main, thanks.