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 78332460D6; Tue, 21 Jan 2025 18:10:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 779CB406B7; Tue, 21 Jan 2025 18:08:45 +0100 (CET) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 81B6340662 for ; Tue, 21 Jan 2025 18:08:35 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2169.outbound.protection.outlook.com [104.47.17.169]) by mx-outbound11-0.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jan 2025 17:08:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QIFesic8SiA9Y1OZYt4Hrs/JbPSrvf6dB1BgBuA/ghgXPy2vT4UHXDvL3kuEcQ8GNK/pdRLki8Yp8XTaQoz28qjog53MxncMaf2JL+IdeusoHGdy4vboYjPV1KJ0z1c5wgWM0GQKDUsNA12VbQv8ajzO6JjoL+w99fJRgOkDPSu8T5ydzcbV57TJUuwzDWhdPiPgFZPgDxYW5eJScqpAjO4yXuwQ9ODFDPhj0EyeocOBcWX5jwhKeFZQggakBDYym0siMP/JexMkg1y1AXjb3N7bv947kEjkBI8WTmabue2cnv0ZM0dsAWvAl5Qy4HfhW73qlU6nRDXvhIhdH561VQ== 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=8T2x73jL5Qn5jvQnqyabfIRApLBkLX33/SAHRPkP808=; b=IOSfi3O9bCEeFF8obG4EL4bDslxTABV+qQjmThFj679SF7vxo8KgOFLTPwiRZKAv5x456or24CyGSbByDkRKezg5ENh1egkrYdjGr7LpojuS1p3SebFH9BU5SlhxSOpK+uIdEI1FhlO1e52jGZXN/0VEtOA4qDM01EeVAQFLKRCfIvR9MbSf+A3LTQbb6hyAGPKKiPQxWZaMdJfLLtS4xyCx21ApcvAHtcfDJ8w57qjmAkjrxxv4/m1Xwk8LWJ/TUqbC6eyXJv+Nz/Qoj1k/J0Rgdm1kS6NRqag0dvVZ2dWlIYcXxWpWpv4axpWL5cH7ylNWK21wf/Hd3pKpoBo/kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8T2x73jL5Qn5jvQnqyabfIRApLBkLX33/SAHRPkP808=; b=cq+w/KzS72yQyW81NiNuFq9i2YbL1WaFi5K54sT8/U0qpPA0Q/ERXDxWFVggMDw1COH5qJwjMwyGse/CfGyKG7Y8QIu8MGJseIhxRTuYs4cEj2JSl8pJwGRWvBjuQkzr3e//UspARFr3kwt/3f1CecVvL11vMhKSlIsfDvCh3XE= Received: from AS4P251CA0020.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::9) by VI0P190MB2105.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:24a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Tue, 21 Jan 2025 17:08:31 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::61) by AS4P251CA0020.outlook.office365.com (2603:10a6:20b:5d3::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Tue, 21 Jan 2025 17:08:31 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by AM2PEPF0001C70A.mail.protection.outlook.com (10.167.16.198) with Microsoft SMTP Server id 15.20.8377.8 via Frontend Transport; Tue, 21 Jan 2025 17:08:31 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, stephen@networkplumber.org, Danylo Vodopianov Subject: [PATCH v1 13/31] net/ntnic: fix untrusted loop bound Date: Tue, 21 Jan 2025 18:07:51 +0100 Message-ID: <20250121170814.3252171-14-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20250121170814.3252171-1-sil-plv@napatech.com> References: <20250121170814.3252171-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C70A:EE_|VI0P190MB2105:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 293a40a7-966c-4779-9898-08dd3a3e3b96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?wfNpt8NjLmRboYYdLwr+AnF4A9mpZ7X7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Q?rH/7txA263nyUapj2zKAbNW1nQ+HUqGo/VDqAAk+p+n5ioGXoKXUrR8Thu+F?= =?us-ascii?Q?nFbPN+nMsZbCd178HNxBa1HWUPNOVOsxa00FRoNLaLyzLHr1GkM/sycAezT4?= =?us-ascii?Q?EYUpxTdgmDKCHYP/qcFgF4wRkkZonnAdDM5qZyqTZIj64o+QCu6NPWS/2bdy?= =?us-ascii?Q?2SF9YOw2dCwt/nBwT9IPKW/K/PdSqV8o4tR2wsA1rTztPj8abZSR3TiIyzWt?= =?us-ascii?Q?7mFIMOjd53ko0mTuenP/fJiQYeBDLQKq0WwyDGmnFkIheX29qIC767/q5vFG?= =?us-ascii?Q?yTAixeB7wJWk1RgW9A05eNtiR6a55O/p/QnNN+tZoovrQm5+J2m4IqIyIXm6?= =?us-ascii?Q?RM56NHn0Qc1pHXtVboSrNHKPKTiQUxf5t0hp9a47A8wXVIEGYkoU+PKP4z2b?= =?us-ascii?Q?zJ7aGoSWZHJUU9qJS4FFNhcZ+escQ7UJlyqCKwcRJDv5UK5FhzQ7d+2Dx/sa?= =?us-ascii?Q?2vHmry1Ms8PRVcuYLqgTQBvmVYKZyL61M814u7GgfnwvSEXNi10uvUGxommX?= =?us-ascii?Q?ZTQxBmI7ERDDfbBrf910dIYiwNj2c3torI0yUkMsAEa2EE+syunhuQ=3D=3D?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: x3Yn9puIKhe5XCTcfR5sX6hFFEsWMwn/1XaNu1A04rh7Z+WH8kupPOVlqfmlFndesY/IJXgUPAeiOqcyclqZuNcP8X6O6R0vtTLUU0SFuHAIHmGiZOaLDJzcF05bF32ICWfABkxLWaxTrIT4p5+qbyEIt4Mjrrxg3vazq8eqAEmO+PYJhGP+8MSPeTc/jYccsrRKWmUXGmHe4y4IcuB/+9ttTZ2noVAaeS/ZpE+xlFOKOm99u2TyHToaAJYTmFEcRNNhVxfOwqJMjKP9cqVKt00QH5F+eRcjNumFHmxDVWv2KKWKWSe87uVJS7hz9E0btEGY6+wN6zrAhJ4A3b0JuXxrCRgBsehbcXyBbdMD4J7C4FZ8YiUoEz0flldEK+3d5bUO4kyZ7nrmXc2t97knNeqWVgGIw5DK5RFeeHAXGclTs7zsmSEqDX/bVHiIaowbViDI8Hf5pqp/m7u8qhc3a95/TCg0Yh4fOPrRPCAq9+eBbK9OYKYk0PA3QOssMKs/6aMfFBcloMglsiDpeHU2rDXgoQXRMwQ/so/aDsYnox/vifYMmQUCyhO4nhdZc6BkRbQ5piMMAQqWEaYn0VaGRAEqLIbUwxhUDOsA0Pv7RrmK9aA2GpwHlOyT33I82aSQ2xhd/NQuigP3r/fmBJJmnQ== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:31.7337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 293a40a7-966c-4779-9898-08dd3a3e3b96 X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C70A.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0P190MB2105 X-BESS-ID: 1737479314-302816-13354-7952-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.17.169 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoYGlkZAVgZQ0MjYxMLSwNzSNC 05yTDZPDEpxdLAINnQ3DI1KTU10dhIqTYWAM6eS69BAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261957 [from cloudscan23-197.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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 From: Danylo Vodopianov Replace while with if statement to avoid infinite loop in case ther_type will be modified with extenral source. Coverity issue: 448917 Fixes: c6821abf58e8 ("net/ntnic: add flow items GTP and actions raw encap/decap") Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c index e00b10ff82..b07e16c1d3 100644 --- a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c +++ b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c @@ -53,7 +53,7 @@ int interpret_raw_data(uint8_t *data, uint8_t *preserve, int size, struct rte_fl goto interpret_end; /* VLAN */ - while (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN) || + if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN) || ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_QINQ) || ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_QINQ1)) { if (size - pkti == 0) -- 2.45.0