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 BC43445CE3 for ; Mon, 11 Nov 2024 07:30:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B535B40E0C; Mon, 11 Nov 2024 07:30:36 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2062.outbound.protection.outlook.com [40.107.237.62]) by mails.dpdk.org (Postfix) with ESMTP id E49AD40685 for ; Mon, 11 Nov 2024 07:30:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cHv7WsnNA1rMI5vgcsufKRxrBC8ZjtBxN/P4Q0/+8Lqb258le0KhxiCGt5kR8I+OTIBact8LnfhJofRDztaMhWLm8F3jbPkWlN6kI5CSrJR36M/UJwl6EJGF6AAklLJg/xvfH3dzyoOhzMeCIOUL3kokJrxTXFsIxC0CyrRHR4YakFTHx38gpvsw+2mEaRFpUBJ89Cn/EFgvD1vw1oxO+ZJA54JihH1UgF82mWilUvUB23s/q81FLRqvP5R/NP2EVYb3yZG9eJCKCz8+eqc4gAh1MV+bij4S3csLiD5Tv7+1l0JaYXq/eQH0v0mDevhQcG0438u+iTbZDi4g78b+gw== 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=ZBPMwWRrNsz5vIdSW8sw/wC9YELqOi9rALE/Zu6MRXk=; b=nir5/FplhBNAfA8GxiYIE21tqIpMKEj/BxZwOXZhSVqyZk5xXLw8K1NnWYDkYzz0bQRYToV4QulHyL5YvveRzqYMNDm5trZ63Fc8UEuTmuLl7hOusyHKq6ApYNhjKwaZ6ExeXC9wWH+9AK9b1K/Gbm9zWZosI/PrdsPyju84cgopeZdLBbcLpuXtJGTOLyD3DAuZkXQEWjnOs4hHUKvqiLdlYVhGg8yiPUkBlMVj7LGnceIE99O0skE189MGcNgVqsXphTUQN8vRqq4+NTtguEu7Czxs6HL39XF5smMZdACeB6TsiodzS5in4wM1rvRWfhFbQ7OqJxctOKYBbeo61A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=networkplumber.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 (0) 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=ZBPMwWRrNsz5vIdSW8sw/wC9YELqOi9rALE/Zu6MRXk=; b=VjJDdbSHzzv44O6ZIFSYIQjFD+j4j6SOufC3BcJ280ph4t/S97N8MAOkFRsi9O7A3Vi0YJEoQf2Wxnk1Hy1sm2UgeqN5r7w03H/r+qtaoKFB4DXMxKxiifXNHCR8DvcaAeiGV2CTO0KA1id0oWe439vudw/RcZ+TXiYeq1kRVlYtbP482RizOjwfpS/PSSV+Do39jUyCiezRb2N7ttTC9G8r5RtBDrgRttp/ocgWnlj1zWh5479usbsWQLFAXf4iYe2D3LXx8N/lSS01EEszRuHwEGv39uK4adZgw3biT6V5nQCwfu1T9gxKA6xE3nGEMrbPQGuB4JCjGKp+o24W1w== Received: from DS7PR05CA0096.namprd05.prod.outlook.com (2603:10b6:8:56::28) by IA1PR12MB6210.namprd12.prod.outlook.com (2603:10b6:208:3e6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 06:30:30 +0000 Received: from DS1PEPF00017090.namprd03.prod.outlook.com (2603:10b6:8:56:cafe::ed) by DS7PR05CA0096.outlook.office365.com (2603:10b6:8:56::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.15 via Frontend Transport; Mon, 11 Nov 2024 06:30:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS1PEPF00017090.mail.protection.outlook.com (10.167.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:30:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 10 Nov 2024 22:30:18 -0800 Received: from nvidia.com (10.126.231.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.1544.4; Sun, 10 Nov 2024 22:30:15 -0800 From: Xueming Li To: Stephen Hemminger CC: , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Konstantin Ananyev , Wathsala Vithanage , dpdk stable Subject: patch 'bpf: fix free function mismatch if convert fails' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:26:59 +0800 Message-ID: <20241111062847.216344-14-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.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-TrafficTypeDiagnostic: DS1PEPF00017090:EE_|IA1PR12MB6210:EE_ X-MS-Office365-Filtering-Correlation-Id: 8675d86b-8e3c-4112-6e93-08dd021a568b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MEpSNGVBaW9mNmpxRGhQQno2LzMySWNVVW9BeWh5UHpHR1FuVDJWam5mTHFH?= =?utf-8?B?VkphTU91N0k1SnNYU0YxcUVFdmI0SnJCM3RHdXQ2UDFiUURhMnpGZE1oSzhm?= =?utf-8?B?TEhRNmMzUnNzQ0lxaFV5TzU5WnZWK0YvL2NMUmtESWtHRUIva3dQcDEzL0RB?= =?utf-8?B?V2pSQzloQktYaXFvMFpEaEMwRndWL3dCT3cwVm8yS3NrcjdsQ0pYYlBXaERE?= =?utf-8?B?RXlqMFlYZ2cyQUlIVnRpeWZySVhpYmtodG5EY1lRdkZMWEsxdC9zNFEwM1Np?= =?utf-8?B?YUlkQjdHREF0QVNsRzk0Q0twTXFHWnZsTTNReVg5VE5xeDNwKzBNVVEyS2Ji?= =?utf-8?B?emE5VStiQjM4dGNJYkdFdGZyRVI0UWZOcU91aE9rQmgwQ3JqSFJxdTBUdllo?= =?utf-8?B?dDhUbmhQbyt4dlI1aXJKMHArRU5CYWVXKzBNYmtjZnoxamxadDBBa3AxWEpO?= =?utf-8?B?SE11QmtuYjR6VjQxdG5xRjZuMGNFR3dFb3FGS3dhQXFxSzNKbkZrSk1POGh0?= =?utf-8?B?UzlDZkR0THg3MDlWUC90K0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f-8?B?cE11RDNTWG9ZZHM1djJsUEJraHEvN3M3bjlNMnhHOWdsOGZ1cVJSNzBlbkln?= =?utf-8?B?OU9mOWZxM01iMXpXKzhWYVk1Zkl4N2U0cGg3ZEpUWWxadXI1NFhJbDRGQUk2?= =?utf-8?B?RldVb2h4NWF6eWcwb1BWNFU4QXl5SjVJQXhPYjBJOUN1YUpKOFVDVlA5VXQv?= =?utf-8?B?cU9TdnpEMUtLNWlPUjVRN3pRR3U5cUFINWkxdXR0OVVRSW5DSW01WGQ5TnFo?= =?utf-8?B?ODVkcWQ3SlUraE9XSkg5dWRqYzBaeTg5b1FlL1BpNmVTcGFJMy9tRkhaenpN?= =?utf-8?B?b0VEWHc1b3RLbGttMGMxM1J0a05PK2NieEFrRTNuZDhyZDk3U2JqVmJOTFFH?= =?utf-8?B?NkFZNzNVREJGS3J1UUtqRGdQUVlRbmoyTjJTN1QzQVd2d0ZkZTBJSDE2OTZ0?= =?utf-8?B?RWtMZXlBb3BLNDE3aW5xZVdlTEpPcXFVOGFVeVJCZVFVaHc9PQ==?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:30:29.9455 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8675d86b-8e3c-4112-6e93-08dd021a568b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017090.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6210 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 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d4c099c6fcf9849630f3b7f930fc193d3ef54e6c Thanks. Xueming Li --- >From d4c099c6fcf9849630f3b7f930fc193d3ef54e6c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 8 Oct 2024 09:47:11 -0700 Subject: [PATCH] bpf: fix free function mismatch if convert fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit a3923d6bd5c0b9838d8f4678233093ffad036193 ] If conversion of cBF to eBPF fails then an object allocated with rte_malloc() would be passed to free(). [908/3201] Compiling C object lib/librte_bpf.a.p/bpf_bpf_convert.c.o ../lib/bpf/bpf_convert.c: In function ‘rte_bpf_convert’: ../lib/bpf/bpf_convert.c:559:17: warning: ‘free’ called on pointer returned from a mismatched allocation function [-Wmismatched-dealloc] 559 | free(prm); | ^~~~~~~~~ ../lib/bpf/bpf_convert.c:545:15: note: returned from ‘rte_zmalloc’ 545 | prm = rte_zmalloc("bpf_filter", | ^~~~~~~~~~~~~~~~~~~~~~~~~ 546 | sizeof(*prm) + ebpf_len * sizeof(*ebpf), 0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF") Signed-off-by: Stephen Hemminger Acked-by: Morten Brørup Acked-by: Konstantin Ananyev Acked-by: Wathsala Vithanage --- lib/bpf/bpf_convert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bpf/bpf_convert.c b/lib/bpf/bpf_convert.c index d441be6663..cb400a4ffb 100644 --- a/lib/bpf/bpf_convert.c +++ b/lib/bpf/bpf_convert.c @@ -556,7 +556,7 @@ rte_bpf_convert(const struct bpf_program *prog) ret = bpf_convert_filter(prog->bf_insns, prog->bf_len, ebpf, &ebpf_len); if (ret < 0) { RTE_BPF_LOG(ERR, "%s: cannot convert cBPF to eBPF\n", __func__); - free(prm); + rte_free(prm); rte_errno = -ret; return NULL; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.070564820 +0800 +++ 0013-bpf-fix-free-function-mismatch-if-convert-fails.patch 2024-11-11 14:23:05.032192841 +0800 @@ -1 +1 @@ -From a3923d6bd5c0b9838d8f4678233093ffad036193 Mon Sep 17 00:00:00 2001 +From d4c099c6fcf9849630f3b7f930fc193d3ef54e6c Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit a3923d6bd5c0b9838d8f4678233093ffad036193 ] @@ -26 +28,0 @@ -Cc: stable@dpdk.org @@ -37 +39 @@ -index d7ff2b4325..e7e298c9cb 100644 +index d441be6663..cb400a4ffb 100644 @@ -43 +45 @@ - RTE_BPF_LOG_LINE(ERR, "%s: cannot convert cBPF to eBPF", __func__); + RTE_BPF_LOG(ERR, "%s: cannot convert cBPF to eBPF\n", __func__);