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 6B56DA0543 for ; Tue, 21 Jun 2022 10:04:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 628A042802; Tue, 21 Jun 2022 10:04:16 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2040.outbound.protection.outlook.com [40.107.96.40]) by mails.dpdk.org (Postfix) with ESMTP id C29C1427F0 for ; Tue, 21 Jun 2022 10:04:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kXGErX19qvNnlNYFGJUu2lfhCHCPvJ7gBFnqtGGVyPHyn/D6lu0a0jfcemzU8MS+IvJfI5nA8yfh4OAVfoDXYIlwJ4kyrL2ty/aAgDSvrz1eacRfYOKmXGcRdsUqE5fRApCRk6ZDVHCXKw1iPHAGC+vmuWQ3DNBm0Uv8KwhoB0BYUa8hTlYGkDVzcmEYScuGsYKLCsSdT4AzLZW9sfGkx/wGKdn0rQjPzJ1+IT2oIhgNwoIGHePVbct+VG9mqcQK9V89O1WhxkyqWT9KNv0HDrsC9qhLCbY+E+KWAbhD0GgAuHrL991ALR5yjF4w1UlbC1sXAxApZXRRoDscO42q6g== 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=/MIDrH4gQ6kjgM1rVMJ3CY8BiACee2330opI9dBMBbY=; b=gRvd/Kk/Yig6OIrRMNA1sTnFyVh0ClL5W//G2xcydhJXNvELSzaQg0RRZ8L+yV2XsN11PhOMOAl7ulU6Q7B7lnKyhEodZJVMUyrlq2XTvDx7dz6xXtV2rq1MnYgPVbqJGoEftzeFrjKeWlU2iWvmq7vLwOAvi+uW4s6Z9qRU3TUbw8zruoBAQOSOtjeHRovWkzgH8Zifl7FN1ct77k438MRVQlBSnirvyk5/I20D5mbRXh/km4yEsBn1RfyDK0ar6MfLiCWkpklao0NFBk1biUNMifa5jfEhHXw6UXFTYsmlmU9FKG6RfFCvZmcj5W6kfscfn8gzSoqstn6J3rFS9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/MIDrH4gQ6kjgM1rVMJ3CY8BiACee2330opI9dBMBbY=; b=YuWNpLjXpeuw8suZeej97HW2LZXu8oy+QinBPCvyzFyUtKsmrKoru1Vo62L5B+T+pl8Xcaux1+zlLiL8ktS59Ji12Nh4IrSt8LDDvAx3eEnqmbfHfXM51YzacSHfv7mkzNSE8/xKuhF21VIlqo2+ueL6VcLqiB1EpM3cNY7ChJUfgXM0/Nx1wUqeyt09+7hdLfrKTKcQGS2bkfUpuhD8wjjcYGnQAz+n5oeyVG/A1c/NUgtR5rWF5rkDnxJ6H5blzMWv6YvQC2wDYUqKH/zpozpYwn80tAYbodWikJ+3NknnSLcNn/zmk+xLI4/lds40G9727ExfkLUypIv0uXIeLw== Received: from CO2PR04CA0136.namprd04.prod.outlook.com (2603:10b6:104::14) by DS7PR12MB5935.namprd12.prod.outlook.com (2603:10b6:8:7e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22; Tue, 21 Jun 2022 08:04:13 +0000 Received: from CO1NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:104:0:cafe::13) by CO2PR04CA0136.outlook.office365.com (2603:10b6:104::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:04:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT021.mail.protection.outlook.com (10.13.175.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:04:12 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:04:12 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:04:10 -0700 From: Xueming Li To: Vladimir Medvedkin CC: Cristian Dumitrescu , dpdk stable Subject: patch 'test/table: fix buffer overflow on lpm entry' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:01:18 +0300 Message-ID: <20220621080301.2315720-13-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8714bda-308d-4fec-cc54-08da535ca10a X-MS-TrafficTypeDiagnostic: DS7PR12MB5935:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /iWhdFzA1mrlZz4ZwUeayg4fWdBIaY5fiakdSnEDWi/SQDvUPGjU8wiD2WAPlf5s7lcXS0o273RRnsnN9fzgKxpRSTyuDf20VKCRViHU7HleIRS1QFQL6kJnCZY7X/CW+sSRi0ugu05OIRrkIqbxz1pk/k7sHg3tiCRXbMl5Ytb/Dx/vNCtE9+xdQCACswym4SjDpk5Nk/yclZkfXbP70MqOR57X4FZo0+5hw17vlJgjaCa6/xx0a8fW2tcKPCW9XoCTJYI3PSNGTxRXtBabqN3GXn4THsq6vv/EurgBQUz5plC9dnV5qpupHB9LrDgvDXaXB4FLHq5hUT9G7SM86qF4lvKWrZtZfCX6g5HIRQzlapJJclDPo+R+QDkJ0fLHF60Sklqhbf0YqCa51/RTHlwoQYTC9UBq2tfrtzv4faCgxfqgtTLYcS9KUuc1WK1AHL40L5kYFNeRh/w+2OwCopC+PMoo+ks0D00vJmDCQctjPFA0u9h0c6mM6NykEI9ORQCWxEToSkkoAAyAK+EZCpeHQ9e7EMWb76daBhtjYexhk6rwRh+owUhPEpSJ58dzLZqHWqjsP/8zkgRUM8w8lI5FjA5jlhRT8gzTCW3tR/b8AY47+QMyUbz+J/6TN5MzMgXQcLqxTWPe2bUY7zdJeuWZmGeFEJdQmOWRiYmAiZd6RJxlDX4HJYVC7gALl+dQzUJB8NxTPqk7isUXDD2/hNO/mPW5lx2Pfjkj36oG2RdohvMGvVdMZoUOcgp72uDdF10q/6zDaOyQnXWicdeSev/hdgWZTPRkTH//XVBcFoNapiP9818aSOYDuAdbd94zSltQ/uyr/9fO79NHPDu2l0Qu8i7ZdxhJGnJKr6ii8TI= X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(396003)(346002)(136003)(39860400002)(46966006)(40470700004)(36840700001)(5660300002)(40480700001)(966005)(41300700001)(356005)(8936002)(55016003)(478600001)(7696005)(36860700001)(2616005)(82740400003)(81166007)(26005)(53546011)(86362001)(6286002)(83380400001)(40460700003)(2906002)(82310400005)(426003)(336012)(16526019)(36756003)(70586007)(316002)(4326008)(6916009)(47076005)(1076003)(70206006)(54906003)(8676002)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:04:12.9032 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8714bda-308d-4fec-cc54-08da535ca10a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5935 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, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/072f7ee4708dc63b66fbb3d9c9589d9e1a0f26bc Thanks. Xueming Li --- >From 072f7ee4708dc63b66fbb3d9c9589d9e1a0f26bc Mon Sep 17 00:00:00 2001 From: Vladimir Medvedkin Date: Thu, 21 Apr 2022 17:35:27 +0000 Subject: [PATCH] test/table: fix buffer overflow on lpm entry Cc: Xueming Li [ upstream commit a6699a6eb22a763ad4bc7498ca53cf89ab9917dd ] This patch fixes stack buffer overflow reported by ASan. Bugzilla ID: 820 Fixes: 5205954791cb ("app/test: packet framework unit tests") Signed-off-by: Vladimir Medvedkin Acked-by: Cristian Dumitrescu --- app/test/test_table_tables.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/test/test_table_tables.c b/app/test/test_table_tables.c index 4ff6ab16aa..494fb6ffaa 100644 --- a/app/test/test_table_tables.c +++ b/app/test/test_table_tables.c @@ -290,10 +290,10 @@ test_table_lpm(void) struct rte_mbuf *mbufs[RTE_PORT_IN_BURST_SIZE_MAX]; void *table; char *entries[RTE_PORT_IN_BURST_SIZE_MAX]; - char entry; + uint64_t entry; void *entry_ptr; int key_found; - uint32_t entry_size = 1; + uint32_t entry_size = sizeof(entry); /* Initialize params and create tables */ struct rte_table_lpm_params lpm_params = { @@ -355,7 +355,7 @@ test_table_lpm(void) struct rte_table_lpm_key lpm_key; lpm_key.ip = 0xadadadad; - table = rte_table_lpm_ops.f_create(&lpm_params, 0, 1); + table = rte_table_lpm_ops.f_create(&lpm_params, 0, entry_size); if (table == NULL) return -9; @@ -456,10 +456,10 @@ test_table_lpm_ipv6(void) struct rte_mbuf *mbufs[RTE_PORT_IN_BURST_SIZE_MAX]; void *table; char *entries[RTE_PORT_IN_BURST_SIZE_MAX]; - char entry; + uint64_t entry; void *entry_ptr; int key_found; - uint32_t entry_size = 1; + uint32_t entry_size = sizeof(entry); /* Initialize params and create tables */ struct rte_table_lpm_ipv6_params lpm_params = { -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:49.841197546 +0800 +++ 0012-test-table-fix-buffer-overflow-on-lpm-entry.patch 2022-06-21 15:37:48.977784372 +0800 @@ -1 +1 @@ -From a6699a6eb22a763ad4bc7498ca53cf89ab9917dd Mon Sep 17 00:00:00 2001 +From 072f7ee4708dc63b66fbb3d9c9589d9e1a0f26bc Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit a6699a6eb22a763ad4bc7498ca53cf89ab9917dd ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ -index d5c5a426bc..010dd5a794 100644 +index 4ff6ab16aa..494fb6ffaa 100644 @@ -22 +24 @@ -@@ -292,10 +292,10 @@ test_table_lpm(void) +@@ -290,10 +290,10 @@ test_table_lpm(void) @@ -35 +37 @@ -@@ -357,7 +357,7 @@ test_table_lpm(void) +@@ -355,7 +355,7 @@ test_table_lpm(void) @@ -44 +46 @@ -@@ -458,10 +458,10 @@ test_table_lpm_ipv6(void) +@@ -456,10 +456,10 @@ test_table_lpm_ipv6(void)