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 946E8433D8 for ; Mon, 11 Dec 2023 11:21:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E03142DA6; Mon, 11 Dec 2023 11:21:37 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2068.outbound.protection.outlook.com [40.107.93.68]) by mails.dpdk.org (Postfix) with ESMTP id 3771942DA6 for ; Mon, 11 Dec 2023 11:21:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MnvdJ41h1utwPq0PQdghtmdiC4Hq7Fxsa9VbJvCw9s4kvaiIPC+jENFupY8mkM3Ybg0aZHY3TNNMRxdaAgpX4/1C3+S+ekLMd4zGxNk+XyEPUXnweud/MMwpbyyV88cbCUgSvTasmoWOCJcCBgRmz3McgFclDQmarN6AeYryw81Y8OuGvOEbmemVVlzShhLfMIyv4VQapulpPyEuhkxCrEX9eaCvPrusPZWXaBrxy3ZiS3uhyzhi//lsIsUVEEJw2CovOQujNJkKCQIjDXhn3M1ADuvAvJQzsSW/JSoAdnXDjXYTXwFRS8scdIdX64m9CsApTQ9vYXf79kgIb0KrWA== 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=kdyyku7GtjaBrYzMDKh2QLPTJHDeZ4mETyCLE9vmeHY=; b=OHOcY42dlIvbkB/miSfySYqu/H4M6eEMbhQvrAWWxEddRqzGK4I0D8yHeSbKh+mKsyolkFy19Vq6wT1a64v3Aq1bgtr3QAcaIJaahVKjDKi1nl3N1M2vgA7SQ5WAw2+RfpQgRj8hMcBMBbWrFkH9zfwLGYEZTVza61RkvOdD20ZwHaF8MNL6Z2HM+mWCdSXDPhiyNh8F6ibdA6Vw364/+lW0nIZFmZ+KPy37NRnTPIzXfVHwgSidOL4E4X7cdA7rm9LElHtjQ2mLhcZL4jRDNyfpknkQwbGdRtB2FugrYehiaT8RAknjqtaSsKnRehxRT65jQtjfJXWuZwuVte5ofg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=amd.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=kdyyku7GtjaBrYzMDKh2QLPTJHDeZ4mETyCLE9vmeHY=; b=HZYwRtIhrD5NyU6Z87Qv0lDjel22CINgzumoyEEtCGrYISp3+4ebuGLoIV9CVUNxiXUNVqWyFsqa9cT6ZhWAntQs5DAb8EBrVQaNDleMwPin4cnNh/1w4jnMjkr0afxSAXBRKqSeV3MO2hn+wJieQr1JHy5SAZFZP1wqvaU7IJ22+ee3HEcjK+rGBkK/WkOQ5vmu4n98YaifytSnDa0A7Y7Pfan992eyHg/fVDzgcZ3kI6zqitQAKcuT3px1R/0yiNTlVHJPkW7dY1bVbfU5UAQPZp2ZIwKpp85dg222soYO+5bKzO7svM5q4KL0bSoGxX3nVa4OyehS8kep0YIOeQ== Received: from DS7PR03CA0009.namprd03.prod.outlook.com (2603:10b6:5:3b8::14) by SJ0PR12MB6830.namprd12.prod.outlook.com (2603:10b6:a03:47c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 10:21:31 +0000 Received: from CY4PEPF0000EE39.namprd03.prod.outlook.com (2603:10b6:5:3b8:cafe::49) by DS7PR03CA0009.outlook.office365.com (2603:10b6:5:3b8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33 via Frontend Transport; Mon, 11 Dec 2023 10:21:31 +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 CY4PEPF0000EE39.mail.protection.outlook.com (10.167.242.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 10:21:31 +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.986.41; Mon, 11 Dec 2023 02:21:17 -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.986.41; Mon, 11 Dec 2023 02:21:15 -0800 From: Xueming Li To: Ferruh Yigit CC: Luca Boccassi , Jiawen Wu , dpdk stable Subject: patch 'net/txgbe: fix out of bound access' has been queued to stable release 22.11.4 Date: Mon, 11 Dec 2023 18:12:02 +0800 Message-ID: <20231211101226.2122-98-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231211101226.2122-1-xuemingl@nvidia.com> References: <20231022142250.10324-1-xuemingl@nvidia.com> <20231211101226.2122-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: CY4PEPF0000EE39:EE_|SJ0PR12MB6830:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a44b856-56b6-48ef-4230-08dbfa32f1d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6J4FyIrfAh/LKpxLYwJC56aaL7eG+74elgqP+v+XqIgjTYL7IrOdo0+TgEvx8gy3HgfNXgrf1QnzBUw+j64LrXEih/0HoqaUUoA06CwO86YgGTiZEkoLipyBCYY5Sg0EyAjKk2Poz7HpRWRy1LeL1mnon89fpZ9mo5qBnQ1aPHSHOhZ++c8SCva0d8rgwNAHg6xtAB95n7r+wbPEiJZS3IAy6gHbVCL9NixhaXpcAPu/d8q0Aj2FZjhyzUtv3PRt6HFWkEVtmxSz8hBy5/dk4ybWbxewYPINvWm15IcfmdkKIpJWltAJcFJhKBJ0ehUcU4G752z+Vl9SzrEsSJ7eaNuvoIavavXbHojy2QeMDFpyoz03P4nUfNER1oVHSKXg9yQgOQABp0sU6CWa2BNP9OIJiIwJMEeo+dks6VNtj5ItP9hTDp3pExHC5h4X+vTE0JBqTvcfQhvLXQZ/OtnMTYj208MrNG2tRFzC4gCheM3YPDeAaKtWPaetLKC31lWVfmmid5yOufpIyXNOYIuRS8AmXw3A83tmIYH9iSwjVv1/4aCHpyXQ2vh8U4bPzRHyThIGHOqeVMfVuYKAum01O4uS5jMMpUQAOWL4V8tmxWaYafTPE5q+ntXM0RcoB4p623Mw5ZLuaZ5E66JZa63zl/ce5qEqJ2qpBscxXlJpfMxsbSwcaC4FLzEjr+0+otoqJQ4zyyEpeDDUDjS9gjKJokbssKsTkjihoCg8aiJf6wPLEDeMakl3xS3ZGnAMJ+2hWzE/R2md3jSQ0beeVhCU+fIXk7YiWc2uYi9T3TNeNNc= 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:(13230031)(4636009)(376002)(396003)(39860400002)(136003)(346002)(230922051799003)(451199024)(1800799012)(186009)(82310400011)(64100799003)(40470700004)(36840700001)(46966006)(83380400001)(2906002)(82740400003)(478600001)(356005)(41300700001)(4001150100001)(7636003)(55016003)(70206006)(70586007)(54906003)(6916009)(426003)(966005)(40480700001)(45080400002)(316002)(6666004)(86362001)(7696005)(4326008)(8936002)(8676002)(53546011)(40460700003)(36756003)(1076003)(47076005)(6286002)(5660300002)(36860700001)(26005)(336012)(2616005)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:21:31.4048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a44b856-56b6-48ef-4230-08dbfa32f1d2 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: CY4PEPF0000EE39.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6830 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 22.11.4 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/13/23. 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=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=085a72d8f818acd9c7410e6b25352969d5fad5e2 Thanks. Xueming Li --- >From 085a72d8f818acd9c7410e6b25352969d5fad5e2 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Fri, 17 Nov 2023 10:12:04 +0000 Subject: [PATCH] net/txgbe: fix out of bound access Cc: Xueming Li [ upstream commit 4a2ba73b1d1a76a4c270aa34af22229172a7f387 ] Reported by SuSe CI [1] by GCC [2], possibly false positive. Error: In function 'txgbe_host_interface_command', inlined from 'txgbe_host_interface_command' at ../drivers/net/txgbe/base/txgbe_mng.c:104:1, inlined from 'txgbe_hic_reset' at ../drivers/net/txgbe/base/txgbe_mng.c:345:9: ../drivers/net/txgbe/base/txgbe_mng.c:145:36: error: array subscript 2 is outside array bounds ofr 'struct txgbe_hic_reset[1]' [-Werror=array-bounds=] 145 | buffer[bi] = rd32a(hw, TXGBE_MNGMBX, bi); ../drivers/net/txgbe/base/txgbe_mng.c: In function 'txgbe_hic_reset': ../drivers/net/txgbe/base/txgbe_mng.c:331:32: note: at offset 8 into object 'reset_cmd' of size 8 331 | struct txgbe_hic_reset reset_cmd; | ^~~~~~~~~ Access to buffer done based on command code, the case complained by FW_RESET_CMD has short buffer but this code path only taken with command 0x30, so this shouldn't be a problem. Command 0x30 no more used, removing this exception check that cause build error. [1] https://build.opensuse.org/public/build/home:bluca:dpdk/openSUSE_Factory_ARM/armv7l/dpdk-20.11/_log [2] gcc 13.2.1 "cc (SUSE Linux) 13.2.1 20230912 Fixes: 35c90ecccfd4 ("net/txgbe: add EEPROM functions") Reported-by: Luca Boccassi Signed-off-by: Ferruh Yigit Reviewed-by: Jiawen Wu --- drivers/net/txgbe/base/txgbe_mng.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/net/txgbe/base/txgbe_mng.c b/drivers/net/txgbe/base/txgbe_mng.c index df7145094f..029a0a1fe1 100644 --- a/drivers/net/txgbe/base/txgbe_mng.c +++ b/drivers/net/txgbe/base/txgbe_mng.c @@ -141,21 +141,7 @@ txgbe_host_interface_command(struct txgbe_hw *hw, u32 *buffer, for (bi = 0; bi < dword_len; bi++) buffer[bi] = rd32a(hw, TXGBE_MNGMBX, bi); - /* - * If there is any thing in data position pull it in - * Read Flash command requires reading buffer length from - * two byes instead of one byte - */ - if (resp->cmd == 0x30) { - for (; bi < dword_len + 2; bi++) - buffer[bi] = rd32a(hw, TXGBE_MNGMBX, bi); - - buf_len = (((u16)(resp->cmd_or_resp.ret_status) << 3) - & 0xF00) | resp->buf_len; - hdr_size += (2 << 2); - } else { - buf_len = resp->buf_len; - } + buf_len = resp->buf_len; if (!buf_len) goto rel_out; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-12-11 17:56:26.253976500 +0800 +++ 0097-net-txgbe-fix-out-of-bound-access.patch 2023-12-11 17:56:23.217652300 +0800 @@ -1 +1 @@ -From 4a2ba73b1d1a76a4c270aa34af22229172a7f387 Mon Sep 17 00:00:00 2001 +From 085a72d8f818acd9c7410e6b25352969d5fad5e2 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4a2ba73b1d1a76a4c270aa34af22229172a7f387 ] @@ -37 +39,0 @@ -Cc: stable@dpdk.org