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 3802E45CE3 for ; Mon, 11 Nov 2024 07:37:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2833E40685; Mon, 11 Nov 2024 07:37:08 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2083.outbound.protection.outlook.com [40.107.212.83]) by mails.dpdk.org (Postfix) with ESMTP id 9283E40685 for ; Mon, 11 Nov 2024 07:37:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ykxfA0Tk0bWOBdV/HK4yBGSUNUCWgPbsP60H5FrgO0Mz6tobAU54P5azqll9Pm5VhhK1rTrSOYsAU0YTMZ/3gGc88lCMo9W+vjW644MiDX+g9cdm/nhciBWF+Zd3PkFQ4cZCRZES+QrBA82Q4X6/HM/pBb8cHgYWIzI4rIfuoPh4Hg8mWFBioisDXgvRtrdLl6hATbN5yDGfG21BDFV0WjjAsXWAvrGh98V7h2unygKyG943f9+YVWIYJ2hXEqpxD5Mu2ApzNUiK1qet7rZLY2yb1QNyzv29Gl1v5Iwed5PKQDVvKrRqS2k/nds97aC8wBKHZXaZVT1iu8C30GSYIw== 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=Zn6WOUn/6rKzm0wJSBb8W+k3IL6owgjm//idubhDpT8=; b=UPkcGAX2orv6938CxYGVfyJMVtVVh+Cm/dPE4mxnNkRL7VM+rfUaBG1YeSY34ryoLCtHG/y+ig342u31QJoY2eh9xWRwTcQ0adQzH8Ey8lSsOxdZz9jVOcyuMNZ6OEAtfQ8ItjSGC4odw8yGA9gKoKVdy7FVEoSj/wG7MUF+Bnc5ovBwMbQ3CYQ1POamkBrlHx2kjfsRlV7+DS2bHnA7o3BH8iAnSj34GHsq/q0BwRywkH9wzJ3BmS/MOeEN3alzKL45kmNkyltwnCGi4UJ1dXfRTuDQZrauYXQ7iMtqv89jZ46zBKhqm+Imw8VkOQetHWzFO4tX3EZA0B1vEH/iRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=Zn6WOUn/6rKzm0wJSBb8W+k3IL6owgjm//idubhDpT8=; b=Segr0Fdg6pGV3ui8+OAEQzV23rlqZ6K1QIyvJrzV8mweuRyX3VzpUXeCCkryCcpmgFqQIie1g4wgqAeDdcQRF3MuEwIJLYGdAgp7TStux/eve1YQQAzlabJjF6cXag/hFhGTFUyYrMkgsW5q5RLlLMwqXQ30OEnqqDEVGwZ94ad0fKYOepc0+WZnVXh50fDZxyiiE9t4mTEy+Ilpn9YxGwLlTobgNDsPwVDxA56wY1hmNVlr10nKzzLty9N5sVafpna1y1gocqlxm9bOM8TbQQnQbxJq90zoi4JAWIEbJePwOTRS1ZMmzYcgA4oVN+17tFLLyLHUBpyPbf+fqvXHlg== Received: from MN0P223CA0017.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:52b::8) by LV3PR12MB9233.namprd12.prod.outlook.com (2603:10b6:408:194::15) 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:37:03 +0000 Received: from BN2PEPF000044AA.namprd04.prod.outlook.com (2603:10b6:208:52b:cafe::ee) by MN0P223CA0017.outlook.office365.com (2603:10b6:208:52b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Mon, 11 Nov 2024 06:37:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN2PEPF000044AA.mail.protection.outlook.com (10.167.243.105) 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:37:03 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) 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:36:49 -0800 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.1544.4; Sun, 10 Nov 2024 22:36:47 -0800 From: Xueming Li To: Stephen Hemminger CC: , Ferruh Yigit , dpdk stable Subject: patch 'net/tap: avoid memcpy with null argument' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:28:01 +0800 Message-ID: <20241111062847.216344-76-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-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-TrafficTypeDiagnostic: BN2PEPF000044AA:EE_|LV3PR12MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: bff11000-e5e5-4cc5-3535-08dd021b40de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?w/r9XPim2xM3m3UmTP2s4TtTwSp2XJcddxDNjLJmAQH54hoItmx5lvXO6M2W?= =?us-ascii?Q?+PJk43Diyf46FUO8ZibE9AWrz2HQVLluLSNs7HVJdqHSXRiQ5JokAoqNHc64?= =?us-ascii?Q?/fh/x/e9zpDk+ze9J7u0CpXulIH5BwEqJpbT6wfT+gUX8iXgk8LgrUUh+3N7?= =?us-ascii?Q?nSXRlD5oIotg1BP9cy5GBntpycUJwPEUws+9ICDz7IDWV6xlnEx+voK3FEr8?= =?us-ascii?Q?zBOMLy9JDEkdCnYE6s7jnPs9MvjtZeaiZIzQzsywKfWPu22mZ8cQfUWBdgYR?= =?us-ascii?Q?3J3gASKmDqEzYvYpzF18W71Ke8c+Stvp9z4echzGYvR8tHm8s4tqpAcVVBea?= =?us-ascii?Q?XxI8hT8vpsH9AylDRsJYZCUapoVCUZo4ryB5rev6uLC68BOlJkZ4nfAKQEHq?= =?us-ascii?Q?erF15SOtJZ8Ikd4163tFeugYBDpE5sLQQXomuANvnBy519XGXyvWgT1GMvdr?= =?us-ascii?Q?d8sZwUav1ltA3y2Ri+1RBBl2vchM6tqQTBq/RwPTgdkGi9+4GgHb4iQl0tAY?= =?us-ascii?Q?MrfeNCn6362eN0CkHdkbFRpWgm+DiZV4mr/fdCV/H7GbUibHNMvB1kslXcFb?= =?us-ascii?Q?LjkrXGkEBDWjq8maY5JK/q86HRNiud8BykUsqBJKuJE8RVUStv2PCfprTesw?= =?us-ascii?Q?rjaZGToWViwdis6wrQ1nkn2TsXScXpmIFudDtqZF2Eeom4AHF6iSf+xIak7q?= =?us-ascii?Q?QweMabLQSSWJTqbxxUjNdS4Wl4paoAVUs67Vfd1gnO9m02lLItIA+GwH/42O?= =?us-ascii?Q?7Ryv278s3U+Hv61FtAN0dcqDmlPf75gz7UBpC6CbKvfrxog5UYE1G6fpYzoR?= =?us-ascii?Q?jPt0ZUdKfdhDCQ0NGcm8wzgVnG76bCTuwWknVjVCK6FBZPM9GnWjLIqxgbAd?= =?us-ascii?Q?kbrRUsh1oLdexEQ6rq3+x9eGi3I46uykTyQyxRr7J30Ll2YJWmGAQJG3xu4r?= =?us-ascii?Q?JAjbnYepiQKidGNZbMBS57TllzCr8LPp0BPsOegF+apdJXWMfuGh/yLgHIW1?= =?us-ascii?Q?iB0gAmTYJNHh9lvjJMp8SZ6+13b44jpLxK6RmDKrhi4UkjHEuf+eWGlac6fX?= =?us-ascii?Q?Qi38tXnoSKL8tyTYusnDnP5CGnkPVYNIvrgLGYq5z7IIhBm/DKGw4iAeOJn3?= =?us-ascii?Q?saaWhLw3yN7mBd/PpEzLnzV7bekFLUSp0F54YRKsRTbUCachEZ89i5z7dcWE?= =?us-ascii?Q?QqcXTCKq2YGXi70hnNbZGTfb1COqI6+BwPDs16ql3KdRS9uvxwKBmRC5fqSI?= =?us-ascii?Q?NXFnWnoSeipzOZWnx0ab/6/xyq4zwgHByUl1LGMUSN6pKAv52t8m3aZh9xz1?= =?us-ascii?Q?mAw5pGmtakwdEVKQ2mVcW6A2YOPucLJsb8rIrBNOQdNtD4sBozCNjxb4XR+M?= =?us-ascii?Q?5QoCaNor2VhGz+W9aN2TkFoy+qX5CNXtkpXTld3xUFDbgqtWtQ=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:37:03.0124 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bff11000-e5e5-4cc5-3535-08dd021b40de 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044AA.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9233 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=4014df8b926a9e46faeff7514cfb76f26fb74eb1 Thanks. Xueming Li --- >From 4014df8b926a9e46faeff7514cfb76f26fb74eb1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 13 Aug 2024 19:34:16 -0700 Subject: [PATCH] net/tap: avoid memcpy with null argument Cc: Xueming Li [ upstream commit 3975d85fb8606308ccdb6439b35f70e8733a78e8 ] Calling memcpy with a null pointer even if zero length is undefined, so check if data_length is zero. Problem reported by Gcc analyzer. Fixes: 7c25284e30c2 ("net/tap: add netlink back-end for flow API") Signed-off-by: Stephen Hemminger Acked-by: Ferruh Yigit --- drivers/net/tap/tap_netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c index 75af3404b0..c1f7ff56da 100644 --- a/drivers/net/tap/tap_netlink.c +++ b/drivers/net/tap/tap_netlink.c @@ -301,7 +301,8 @@ tap_nlattr_add(struct nlmsghdr *nh, unsigned short type, rta = (struct rtattr *)NLMSG_TAIL(nh); rta->rta_len = RTA_LENGTH(data_len); rta->rta_type = type; - memcpy(RTA_DATA(rta), data, data_len); + if (data_len > 0) + memcpy(RTA_DATA(rta), data, data_len); nh->nlmsg_len = NLMSG_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len); } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:08.664473368 +0800 +++ 0075-net-tap-avoid-memcpy-with-null-argument.patch 2024-11-11 14:23:05.182192838 +0800 @@ -1 +1 @@ -From 3975d85fb8606308ccdb6439b35f70e8733a78e8 Mon Sep 17 00:00:00 2001 +From 4014df8b926a9e46faeff7514cfb76f26fb74eb1 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 3975d85fb8606308ccdb6439b35f70e8733a78e8 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index d9c260127d..35c491ac37 100644 +index 75af3404b0..c1f7ff56da 100644 @@ -23 +25 @@ -@@ -302,7 +302,8 @@ tap_nlattr_add(struct nlmsghdr *nh, unsigned short type, +@@ -301,7 +301,8 @@ tap_nlattr_add(struct nlmsghdr *nh, unsigned short type,