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 7FF5343B86 for ; Tue, 5 Mar 2024 10:50:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A6854026B; Tue, 5 Mar 2024 10:50:50 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2083.outbound.protection.outlook.com [40.107.243.83]) by mails.dpdk.org (Postfix) with ESMTP id 90B5B4014F for ; Tue, 5 Mar 2024 10:50:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KrkRERJSN5IITzUequFBnki4Ds0a/QAHMAvm1rHSOjHZIgY4ZDO71jo2RCCTg9n2axd1oASYQjFps/Q+GXKM6MxSPfip/E9oK7oJhHfAM708vSJ9bHmEadx4U8vVr0EzZBpy2DuEVQZYsJKQLR4lsUAokjIwCz0ZAtEmi5iJnsTopOkaX+nbrvEH/40wfiHFfPboY3CY21wCtmWNnKUo/BZGlrgx7Cz+9/6h7pMCzR7yQPl3Cc+fJ9exIHsh1UL9P7UXo0zvINeQxoUnR0DTQZ/iSriueHg0SXzvfPZvRY+Te7x/uXroAkhnaNLTGbwth0OGONrLqmSbdfs1JxHYSw== 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=Y+cJsoS87p4n9NeLibimhnIRX+4shOeJRysV34SymkQ=; b=jeCb39rkPlTXM6WJ3qIMgMUnS8+0lbYwxlSiZ7P5OnpopKbsrQck6taO1m3FZGUva/orSWpfExNh4YwvqIqcTJbQbx1Ut4G7ET+x+SODqHTMCNN9fbnnhjrMiw4axW44niH2CvLpN2QRtPDx91rUYEaK3kpv35p5yjiWZ6/t+Jwh/LpId02EpTH53o9ePxw6nHHfbbheeOnAH1zvYxWQlqftpja3hj/g796FoMsodelPbrlNj7FQxZ1znj+gqn1DnmeiOXBVnQhgUxhqjIXDNKSGiHahnwQiDKI6DhTZQ0dcYE2Q4dNF+jiGiudWoC8HC/IOA4fTrryftdiwDuTVhw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=huawei.com 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=Y+cJsoS87p4n9NeLibimhnIRX+4shOeJRysV34SymkQ=; b=GshonzjxL91n9pYAS0dcDSM9Hh3S7nmttliUefsUrv5Q0e/I92e9yj9bVjK/LWpYvtEE0P47KyT2eJ3JKBHFw9yGDeyIeI1G9dcQjrCnfeU4PMWv597334VG0yU7LGIzPATReVqmgAfKkXcBvgCxf6iElhNDslYGuX+Zt0EV7MisJOsp1bIhUC7cKjUFju4iAXRcbQOFq7Ebz1gU3f0iEGYvHoUCqct9vwE84UXA10Kq/tBaS3GkHc1C/SYHjfP/GqYXCgSQuVlD2XIQUKkC3zO9CPtsgsDF0ZxjINSSA/DgBhwpwwAmsDPIA8l3bw+pjHurwn7uwwWCVjNkfX+Ygw== Received: from PH3PEPF0000409B.namprd05.prod.outlook.com (2603:10b6:518:1::47) by BY5PR12MB4225.namprd12.prod.outlook.com (2603:10b6:a03:211::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Tue, 5 Mar 2024 09:50:46 +0000 Received: from SN1PEPF0002BA4F.namprd03.prod.outlook.com (2a01:111:f403:f90c::) by PH3PEPF0000409B.outlook.office365.com (2603:1036:903:49::3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.22 via Frontend Transport; Tue, 5 Mar 2024 09:50:46 +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 SN1PEPF0002BA4F.mail.protection.outlook.com (10.167.242.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:50:45 +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.986.41; Tue, 5 Mar 2024 01:50:31 -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.1258.12; Tue, 5 Mar 2024 01:50:29 -0800 From: Xueming Li To: Chengwen Feng CC: dpdk stable Subject: patch 'eal: verify strdup return' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:46:07 +0800 Message-ID: <20240305094757.439387-27-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: SN1PEPF0002BA4F:EE_|BY5PR12MB4225:EE_ X-MS-Office365-Filtering-Correlation-Id: 6862efac-ef16-47d5-cc93-08dc3cf9bab4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LEW/mGLHPuylIYf1L3KRye6TukQYlpjFN8BKYZOjONbDhJXv8ggFoky+0QKFNaIFMyN5wRqsk34gwe8pBoseSqfbCvEEhhTrV1VJikqhsOKHHPCzddUESJiBcqSlnxdHfidaBjEHHj83vaIu2JViGClkdYdNP8R8RUb80LKWKWFxc9azNWKFty1AJlJntw4ccJKDPBvaScx9k486UPRuKpdQseARpOE06vmyw+oFSzBHymZJHgGiAFsRiUrQnzC5CQhhJxbBoCm3J2i3JGbH+9phzLRLkMn5bhKENbXomVrubYPnSociRZ+ux+PhtpXVN0opPrPecpRNaLi3mYJKEXxogsKokQHo+0qq+/FXL2z8YNp9xWLOe5zHJEaEcPNbMWJ5BZT2R24JhYUo/dHECqF5nEd+LVv4A00XXnODhT3ICWVhCQctNEze1u/lywg88EPiwPJq8BdKxxOEduemR2AbrtNVXflhcJciY+gLT0bHX43ksZwNIp6nNuxJEWaBN7yvGytjt/shrZlx10v04rLUmEngDZM7+xu76/ANmuWM/C2/kPo7X89P4cS9+vL4WNw5zDN3dtVGfid7g2ZNrK2t5roWQounQzxmO5ulXr55sf9ygkSd/Nr/NED9wj3ru8x9I74BDTZqdaWHG6srTzA3HjGINqxbQ4oiM49WSne0GEzPiMc/cCyrh5vVzJt7x2x6YBz+91sRQJrZPxZgYfvnwDBl9DCX5sBgOW+y7AK5L6dzGPRePgoij1XEoF3H 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:(13230031)(82310400014)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:50:45.5295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6862efac-ef16-47d5-cc93-08dc3cf9bab4 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: SN1PEPF0002BA4F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4225 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/31/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=2feed5de509bed9536955e38c0a917126fbe6283 Thanks. Xueming Li --- >From 2feed5de509bed9536955e38c0a917126fbe6283 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Fri, 10 Nov 2023 10:01:02 +0000 Subject: [PATCH] eal: verify strdup return Cc: Xueming Li [ upstream commit 5821a384a4ca611e0f67786400b9f5b18f34a416 ] Add verify strdup() return value logic. Fixes: 293c53d8b23c ("eal: add telemetry callbacks") Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process") Signed-off-by: Chengwen Feng --- lib/eal/common/eal_common_options.c | 24 ++++++++++++++++++++++-- lib/eal/linux/eal_dev.c | 2 ++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index e9ba01fb89..aec51736f2 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -226,6 +226,8 @@ eal_save_args(int argc, char **argv) if (strcmp(argv[i], "--") == 0) break; eal_args[i] = strdup(argv[i]); + if (eal_args[i] == NULL) + goto error; } eal_args[i++] = NULL; /* always finish with NULL */ @@ -235,13 +237,31 @@ eal_save_args(int argc, char **argv) eal_app_args = calloc(argc - i + 1, sizeof(*eal_args)); if (eal_app_args == NULL) - return -1; + goto error; - for (j = 0; i < argc; j++, i++) + for (j = 0; i < argc; j++, i++) { eal_app_args[j] = strdup(argv[i]); + if (eal_app_args[j] == NULL) + goto error; + } eal_app_args[j] = NULL; return 0; + +error: + if (eal_app_args != NULL) { + i = 0; + while (eal_app_args[i] != NULL) + free(eal_app_args[i++]); + free(eal_app_args); + eal_app_args = NULL; + } + i = 0; + while (eal_args[i] != NULL) + free(eal_args[i++]); + free(eal_args); + eal_args = NULL; + return -1; } #endif diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index ac76f6174d..c0ba98852b 100644 --- a/lib/eal/linux/eal_dev.c +++ b/lib/eal/linux/eal_dev.c @@ -182,6 +182,8 @@ dev_uev_parse(const char *buf, struct rte_dev_event *event, int length) i += 14; strlcpy(pci_slot_name, buf, sizeof(subsystem)); event->devname = strdup(pci_slot_name); + if (event->devname == NULL) + return -1; } for (; i < length; i++) { if (*buf == '\0') -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:31.864153229 +0800 +++ 0026-eal-verify-strdup-return.patch 2024-03-05 17:39:30.713566491 +0800 @@ -1 +1 @@ -From 5821a384a4ca611e0f67786400b9f5b18f34a416 Mon Sep 17 00:00:00 2001 +From 2feed5de509bed9536955e38c0a917126fbe6283 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 5821a384a4ca611e0f67786400b9f5b18f34a416 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ -index d9748076b4..e541f07939 100644 +index e9ba01fb89..aec51736f2 100644 @@ -66 +68 @@ -index e678dce6c7..fff4e8fa83 100644 +index ac76f6174d..c0ba98852b 100644