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 D21B945E41 for ; Sat, 7 Dec 2024 09:09:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DE1740281; Sat, 7 Dec 2024 09:09:29 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by mails.dpdk.org (Postfix) with ESMTP id C797D40281 for ; Sat, 7 Dec 2024 09:09:28 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U9MVgKPqA8yE2zH445sBz1/6XjjiiMuDZQR+RrcSwWxXLco6GoqzCsdUP3RXaGCeF/yfrZfLMwKz733U+e39h+eimbFCXbsN9Sy7s8xhA5fr+xwtExwQBoow9/uWZwrc1TLTXBDl6aPxrO9OVOCiUeM/mpwFT8mwykka2YFj17TQn6WS7/ZsDl49Cr2hY9p38AxpqUyfie4gTQ8gVeMZvPy0BQWTeqITVAbPWRhBo4/K8/g3WCcDoC57vBMSrKA4uhpBSZ9OghNZgGJB8b6ZkFFS6BqcsICWX2h+aTsRi2k0nlzgfvsCZ1alHsOmOVew6SzuiwFCFLXzTtGgkO5g2w== 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=Pu6wYwmvCY2Kz00OnQsplpVoaIEIEKA0SOnOrY59a7g=; b=SIdubcKgQi5xocuGBb6tuuNHfOgatvOwSpQ9tRpbVkN2frU461uNSpJt5mcCYXD1D0El4UymZEqXR/oMElqfRe0NSSjI1HONoHzdNwpNf/r3NHj+UIDVtbkDeD1+SXscSwv/MDPTre0Kx9AnWbzx9p66AioGWQ/sCl8XTFW5QMu3knrKfNKkzGt90Zb3cAldhcgy026FOVg/AOqt9GsSJkTvCeeIItzSHxha8ZNy2LabgQggNzpiTeKNsR+hlB6swbL5WoX9CQM6EGrjpfa26v7qK/ti1Q+EBtSB+a2l3MtgCw3MOEBqgx1yM/vD2zYVvABUzhXKu15u3UuxlBzWZg== 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=Pu6wYwmvCY2Kz00OnQsplpVoaIEIEKA0SOnOrY59a7g=; b=U/nB5oaD2k4kNO45RaYbjvW1MI3a5Xr6eUyA8QweWChQFwFNT79WABgoXnNPBTjGTK3N/bffMYAZB6V11IyjxOLlgGYJFMbvuhr5kiYgdyX9dDtbd0ETcD18GqNbsVEv0Ui6oeYie4Y3dBSufH78zmxOHKHzgEfWE1p05M+Ig02ZXzGaF+5+OoFP51+ejhn61+teFsJlKnaVGb+SlLfXWlclki5bTLcsVtQdPW6hkWw63fnoERgfBs78RcH0Ct1WrvIO9T+eflC8PKjacKtZNp93gEhjBvgCc7dFarcYTa0BVM2edvFFEmOZ5MjEPJmpgI3/b5GePMgMh9CQIsl/ww== Received: from BL1P221CA0011.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::23) by IA1PR12MB8539.namprd12.prod.outlook.com (2603:10b6:208:446::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Sat, 7 Dec 2024 08:09:25 +0000 Received: from BL02EPF00021F69.namprd02.prod.outlook.com (2603:10b6:208:2c5:cafe::ca) by BL1P221CA0011.outlook.office365.com (2603:10b6:208:2c5::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Sat, 7 Dec 2024 08:09:25 +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 BL02EPF00021F69.mail.protection.outlook.com (10.167.249.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:09:24 +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; Sat, 7 Dec 2024 00:09:19 -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; Sat, 7 Dec 2024 00:09:17 -0800 From: Xueming Li To: Stephen Hemminger CC: Xueming Li , dpdk stable Subject: patch 'pcapng: avoid potential unaligned data' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:45 +0800 Message-ID: <20241207080055.488538-88-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F69:EE_|IA1PR12MB8539:EE_ X-MS-Office365-Filtering-Correlation-Id: d4e5528f-68e9-402e-c9ea-08dd169676e6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YdvJf2FfO73Z4qNxVSnUaQlMkb2kHdaS+3ibJv2w7j7oHapgTZPIxy/Sz2oi?= =?us-ascii?Q?VTHjrogbReDu4zplr8njS6moYXwas5T3eHP4e8bwryFunRX3yF4LDrZocuRd?= =?us-ascii?Q?kHZhIqmRmWf+47D2uDDoSFcfcygqtAHpmAG94O+dh84oOMrM4doAUjOSvqWS?= =?us-ascii?Q?pz7JNmZvIP6YtJwL00h8xwQT4l6FHVCBm637goWVQXtMFf62uFRCDK1+/oQP?= =?us-ascii?Q?FfhBT8ozebErMXjR3SmKP3ZMPTvdm1LhYVFzZVN9aCXraEQw7j7/m+mSY7kC?= =?us-ascii?Q?cu8V67GC7ALkyOUOmj9mQQTX0JZM7HWcKp87FkcCppJx22iMXpM2QQ1vmcWt?= =?us-ascii?Q?QXWduj4fa1SDGoPAQgzDJp7Dwg2QMy8gCy8hgBNLwpfKUViINGiqor3zInmQ?= =?us-ascii?Q?jm3B+f0DrRc8JpyI5hu4xLRZ3JbyUHqUAv7JXWMFbcQtiXKzgA+WIPMJPjDt?= =?us-ascii?Q?VjBfu1VGRg0zLn8AMcPGjH7kwkyqmqE60+HEV8Y3GoqVfir4ERq8gWtATEf8?= =?us-ascii?Q?fpeP2VD9QXSpVArOPrJ1qWyUkPGkot1iO4uJ0o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UYAVnPQGnV?= 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)(376014)(1800799024)(36860700013)(82310400026)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:09:24.9876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4e5528f-68e9-402e-c9ea-08dd169676e6 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: BL02EPF00021F69.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8539 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 12/10/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=939b471310e29c5b7f9640f53e9ba22ce32e6441 Thanks. Xueming Li --- >From 939b471310e29c5b7f9640f53e9ba22ce32e6441 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 20 Nov 2024 15:06:35 -0800 Subject: [PATCH] pcapng: avoid potential unaligned data Cc: Xueming Li [ upstream commit 0cbf27521b0d6e7cb79f41a5e699d82562b09c03 ] The buffer used to construct headers (which contain 32 bit values) was declared as uint8_t which can lead to unaligned access. Change to declare buffer as uint32_t. Fixes: dc2d6d20047e ("pcapng: avoid using alloca") Signed-off-by: Stephen Hemminger --- lib/pcapng/rte_pcapng.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c index e5326c1d38..16485b27cb 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -33,8 +33,8 @@ /* conversion from DPDK speed to PCAPNG */ #define PCAPNG_MBPS_SPEED 1000000ull -/* upper bound for section, stats and interface blocks */ -#define PCAPNG_BLKSIZ 2048 +/* upper bound for section, stats and interface blocks (in uint32_t) */ +#define PCAPNG_BLKSIZ (2048 / sizeof(uint32_t)) /* Format of the capture file handle */ struct rte_pcapng { @@ -144,7 +144,7 @@ pcapng_section_block(rte_pcapng_t *self, { struct pcapng_section_header *hdr; struct pcapng_option *opt; - uint8_t buf[PCAPNG_BLKSIZ]; + uint32_t buf[PCAPNG_BLKSIZ]; uint32_t len; len = sizeof(*hdr); @@ -212,7 +212,7 @@ rte_pcapng_add_interface(rte_pcapng_t *self, uint16_t port, struct pcapng_option *opt; const uint8_t tsresol = 9; /* nanosecond resolution */ uint32_t len; - uint8_t buf[PCAPNG_BLKSIZ]; + uint32_t buf[PCAPNG_BLKSIZ]; char ifname_buf[IF_NAMESIZE]; char ifhw[256]; uint64_t speed = 0; @@ -330,7 +330,7 @@ rte_pcapng_write_stats(rte_pcapng_t *self, uint16_t port_id, uint64_t start_time = self->offset_ns; uint64_t sample_time; uint32_t optlen, len; - uint8_t buf[PCAPNG_BLKSIZ]; + uint32_t buf[PCAPNG_BLKSIZ]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:46.992965606 +0800 +++ 0087-pcapng-avoid-potential-unaligned-data.patch 2024-12-06 23:26:44.103044826 +0800 @@ -1 +1 @@ -From 0cbf27521b0d6e7cb79f41a5e699d82562b09c03 Mon Sep 17 00:00:00 2001 +From 939b471310e29c5b7f9640f53e9ba22ce32e6441 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 0cbf27521b0d6e7cb79f41a5e699d82562b09c03 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org