From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 94266A051C for ; Tue, 11 Feb 2020 12:27:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E19E5B3C; Tue, 11 Feb 2020 12:27:51 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 468382B9C for ; Tue, 11 Feb 2020 12:27:50 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id z7so11831882wrl.13 for ; Tue, 11 Feb 2020 03:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yk5ovbBnlv502qQO3+CBRMqx+/l+FlxKLrKVPXcrnYs=; b=Y//qnbkeCdKzoqW5mGNR+4iUCn06JiioEe6031qZfYv3EbxMY/MccPDsgr6JUxuom6 d6ygYX+n8JICPaDwMDDlziyLdCa6Vh94FigLyKrVIkcHIF3dj91fv7WysXQRaZhpOPus d2LvSIaXoWijRBkJyQSDFhyqtHxFMe5xlb8MmondG59fVmuONlSWvdJ1liJHILMxOltv /hVQpT02Y/gdLjYFVP/4xcb9LmfOaXDlFCXo21w8oIXXA9nh6nMmcv9LWlEhZReaHInx pAyj8yk1E3EmvEQIF96nSs7HCcByA7ESbGbfO0XpJGUeaXsVN6YnMPDLVrpAcvw9KUwM OkvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yk5ovbBnlv502qQO3+CBRMqx+/l+FlxKLrKVPXcrnYs=; b=CIOLSQsyKkNwvPsHte0MFMK32aQq7zGGzDDmNRV4NzLhOtY0zxmETvTgavhxkjkNY4 DIWCJHJIYbXEQOAy8+0bEGXaELDLepo9vaaAjWsFkEiTUOyyaURiTP9cwRwp6L6VmuTy PxI9ZSLkwKo9DfVsnsDOm1nipWcPD+f2qcEraF+e/GOu5k+lunryBFFabhZlgVHnoJ00 9sYxXJsQ/G+umguf3mg/WFWt3bTLQslBiEbYV3WdNg5fKFVuozHSYUWJvmWutBLCR5Ss gqmF5cAIP93KNh+BrybhQ3OR31NICjpEwDce5YbfzhP1um3UtN1afX5NIYuo59FqBUKK Jc/g== X-Gm-Message-State: APjAAAVTbfh5J8Y45cFo+mrgG/byyBYAJuoFtf/0FkcxHxu8TT6Uwyrw DZoheQkuaa/ga8Of/vE0P6YBgIQpCwM= X-Google-Smtp-Source: APXvYqwYU0i8+4TP9B+XOO8uHvNmTV6dJ3tfO1VZXy0riekmcKIrEFdpSeap8ag3q4n2MfG3ZHsNsA== X-Received: by 2002:adf:b64b:: with SMTP id i11mr8657293wre.58.1581420469796; Tue, 11 Feb 2020 03:27:49 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id g2sm4776061wrw.76.2020.02.11.03.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:27:48 -0800 (PST) From: luca.boccassi@gmail.com To: Tonghao Zhang Cc: Suanming Mou , dpdk stable Date: Tue, 11 Feb 2020 11:20:04 +0000 Message-Id: <20200211112216.3929-58-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix crash when meter action conf is null' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.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 02/13/20. 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. Thanks. Luca Boccassi --- >From 4eecbd58009e2c6c2ebcd983a244a51b1b9aac41 Mon Sep 17 00:00:00 2001 From: Tonghao Zhang Date: Fri, 13 Dec 2019 22:21:34 +0800 Subject: [PATCH] net/mlx5: fix crash when meter action conf is null [ upstream commit 4f19f4140e058c92822f228dcdc55c44bd88b613 ] When offloading the meter, should check the action conf and make sure it is valid. Fixes: f46bf7488705 ("net/mlx5: support meter flow action") Signed-off-by: Tonghao Zhang Reviewed-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_dv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index e50d40040b..baf617aaa6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3402,7 +3402,12 @@ mlx5_flow_validate_action_meter(struct rte_eth_dev *dev, { struct mlx5_priv *priv = dev->data->dev_private; const struct rte_flow_action_meter *am = action->conf; - struct mlx5_flow_meter *fm = mlx5_flow_meter_find(priv, am->mtr_id); + struct mlx5_flow_meter *fm; + + if (!am) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, NULL, + "meter action conf is NULL"); if (action_flags & MLX5_FLOW_ACTION_METER) return rte_flow_error_set(error, ENOTSUP, @@ -3417,6 +3422,7 @@ mlx5_flow_validate_action_meter(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "meter action not supported"); + fm = mlx5_flow_meter_find(priv, am->mtr_id); if (!fm) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:41.073083208 +0000 +++ 0058-net-mlx5-fix-crash-when-meter-action-conf-is-null.patch 2020-02-11 11:17:38.440002095 +0000 @@ -1,13 +1,14 @@ -From 4f19f4140e058c92822f228dcdc55c44bd88b613 Mon Sep 17 00:00:00 2001 +From 4eecbd58009e2c6c2ebcd983a244a51b1b9aac41 Mon Sep 17 00:00:00 2001 From: Tonghao Zhang Date: Fri, 13 Dec 2019 22:21:34 +0800 Subject: [PATCH] net/mlx5: fix crash when meter action conf is null +[ upstream commit 4f19f4140e058c92822f228dcdc55c44bd88b613 ] + When offloading the meter, should check the action conf and make sure it is valid. Fixes: f46bf7488705 ("net/mlx5: support meter flow action") -Cc: stable@dpdk.org Signed-off-by: Tonghao Zhang Reviewed-by: Suanming Mou @@ -16,7 +17,7 @@ 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c -index 4c162816e4..5bd1b1cdb7 100644 +index e50d40040b..baf617aaa6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3402,7 +3402,12 @@ mlx5_flow_validate_action_meter(struct rte_eth_dev *dev,