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 95B5943FB4; Mon, 6 May 2024 13:46:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F327406B6; Mon, 6 May 2024 13:45:28 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2081.outbound.protection.outlook.com [40.107.102.81]) by mails.dpdk.org (Postfix) with ESMTP id 04B50402E7; Mon, 6 May 2024 13:45:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RsL1M3tqMs4YfQgz+6I0yYxkMWZh0LHzYe15YaM/0JAGSm1rgkKVzODl1Cw2+b2BoZxJZ+0a+a0qcdE2zWsB7OSOn8uIw4YDKbhgg5soj3HwUQvMhEnChoVWZvVbeWf2jZ1gf+MrnLy+kuTs9oOKjebfC166ocjh9XbGEFxbTjm1LyKX6N205u+AoGOavX7/YwdYrhgkBHngkX8vtvA1o2y0f9qha39vjMwuhUzhKjtp2FALVGmkaF6E0wFqnzK2BgvmiJGB4yf7LVnsqXD6YOrxpZpG34tPbXVBqpxhnJmUy+mr+clswr3kfeF4Do9FQC2NQj33gyM3WEPPeHCCNA== 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=pZHmiEc4PZJEJxg0AF8TYPZx6aBsXEO7EH+/dRTW3iQ=; b=jsA6/lyfhLRLmzxhdX1IJp9fkAyOhcUgxOmOvXvEDyRu9GgBMLFhMNISdaq7FSifQwt9de2En79s3wUtooRrTJ95u503u6I35BfXgguIPyk6ndeGQY/sVime670tJun4+6BfBEx4JeDjRzRh/v7ZUPWANqtvpIWeyvadypCq7o16iCLN41bfrGVsU6WqToEuVehyiywQsITWUv+QxuHvG/URFdswPxu90VWs3O+JDOUf21wf3TPqH+fSGugIPNupSxFGa9LEnCq0EvdTNN+I1yALYkJKbyfZaPh4wyZI5w62rlkh6SjwkThtCvWbawjcBR0wqIUmjZcSXUDVS4S4rQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=monjalon.net 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=pZHmiEc4PZJEJxg0AF8TYPZx6aBsXEO7EH+/dRTW3iQ=; b=n73R8NyeLo7zd9sh1buVRU3Qknn3nXXJiNScddnfWjD9J0dTiTeqvBzqr61MRkPZIZFA91YemDEkqpkERBjU8jL5BxsN2l+RzJpdssfiIiaKc7sh6DXWdHfWhbXDW0sPmkpUhQfLXMltLp9OVkMOI/bzj8eVldvDW+APm6nZk5vr9rQZuNrfR4eR5HCSPclbSJarz3CF2vjTxVb287xDyDeE4fxMGWUP41Ee6cFyQ2xeHFKe4ZHHAOCqGNMxzPiYQT7hKnTtUYXHUabw6P/hJAHqp3tRUrkPz+hjSlm0ftVMOjkdiMlDJAVU3eVM4U/tAqEdgejUjIkNDMqb2UgREw== Received: from DM6PR10CA0021.namprd10.prod.outlook.com (2603:10b6:5:60::34) by DM4PR12MB8559.namprd12.prod.outlook.com (2603:10b6:8:17d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Mon, 6 May 2024 11:45:24 +0000 Received: from CY4PEPF0000E9D8.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::29) by DM6PR10CA0021.outlook.office365.com (2603:10b6:5:60::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42 via Frontend Transport; Mon, 6 May 2024 11:45:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CY4PEPF0000E9D8.mail.protection.outlook.com (10.167.241.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.18 via Frontend Transport; Mon, 6 May 2024 11:45:23 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 6 May 2024 04:45:16 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 6 May 2024 04:45:15 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Mon, 6 May 2024 04:45:12 -0700 From: Itamar Gozlan To: , , , , , , , Dariusz Sosnowski , Ori Kam , Matan Azrad , Alex Vesker CC: , Subject: [v2 14/16] net/mlx5/hws: fix invalid memory access in decapl3 Date: Mon, 6 May 2024 14:44:17 +0300 Message-ID: <20240506114419.966498-14-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240506114419.966498-1-igozlan@nvidia.com> References: <20240314114220.203241-1-igozlan@nvidia.com> <20240506114419.966498-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D8:EE_|DM4PR12MB8559:EE_ X-MS-Office365-Filtering-Correlation-Id: 5544689a-97a6-4107-6356-08dc6dc203ae X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|82310400017|376005|1800799015|36860700004|921011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?kfeTMCvi8hDe5Gv1rAia0UdUmZaRYxKfWwKxv+AcnHUE2mueLFQJIlI/vDSr?= =?us-ascii?Q?wDCkHgH4zrMmzfsfCCWdU+NBKehfzB0J/Gwt+ZMpiQAAWXP2zCyzNsqUY7rg?= =?us-ascii?Q?V1gNSWPxjpjSILAS4MQDjx3WvaT7sLZe/Ya+VuqSCX7rP1I8Ah3506ItCF7v?= =?us-ascii?Q?bTSzNO1xDIX/p3M8hR2gTGXSpOEcDZj9Jq9afU6XX9qa6YGvSqF6G+EtHz4a?= =?us-ascii?Q?eHYgpqb0gpP0v6hQF1dFu/7Ua9nygar7y+EjYTtX1emFpQWShD10SCohPpRg?= =?us-ascii?Q?fLDxU6FJDtSaXkTA9ZyamV4CNSiryjZO4DRaVshJ20Y9Yo9LnrIYAh9tl2hY?= =?us-ascii?Q?CG/ud2KWH29mGL6GlgZOlcSz8d3fktVFKw5NJjsApc54cEY+2IF3OXaD559a?= =?us-ascii?Q?RH5ufiyDu4ws8Cbz9/dicWrst4VgiH9X9m5t2F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eBQ2qnVwxRU3pZlvlF3XYKaEmTpUHhcRIHQ9fo5hw5EzhlO?= =?us-ascii?Q?qyokCAK6jOedy5zNcwLmHeNimsYG?= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230031)(82310400017)(376005)(1800799015)(36860700004)(921011); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2024 11:45:23.1517 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5544689a-97a6-4107-6356-08dc6dc203ae X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8559 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Alex Vesker In case decapL3 action is created we would access header data even in case the SHARED flag is not set, this would lead to an invalid memory access. Fixes: 3a6c50215c07 ("net/mlx5/hws: support multi-pattern") Cc: stable@dpdk.org Signed-off-by: Alex Vesker Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 084d4d606e..562fb5cbb4 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -1775,7 +1775,9 @@ mlx5dr_action_handle_tunnel_l3_to_l2(struct mlx5dr_action *action, /* Create a full modify header action list in case shared */ mlx5dr_action_prepare_decap_l3_actions(hdrs->sz, mh_data, &num_of_actions); - mlx5dr_action_prepare_decap_l3_data(hdrs->data, mh_data, num_of_actions); + + if (action->flags & MLX5DR_ACTION_FLAG_SHARED) + mlx5dr_action_prepare_decap_l3_data(hdrs->data, mh_data, num_of_actions); /* All DecapL3 cases require the same max arg size */ arg_obj = mlx5dr_arg_create_modify_header_arg(ctx, -- 2.39.3