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 75F0CA0093 for ; Tue, 19 May 2020 15:16:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5D1191D991; Tue, 19 May 2020 15:16:48 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id E51511D97E for ; Tue, 19 May 2020 15:16:46 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id l18so15878331wrn.6 for ; Tue, 19 May 2020 06:16:46 -0700 (PDT) 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=X6sNEtOlmoht11f80QBpHESiqEjtJn4YK4y150mlSQc=; b=b/2dAEDvVk0GPnX7qHQ1gSTa5QoJfjlKVoJD+/0gpW5WCj6eKHKRJm/H1LlPR1lvKE hh5TwZC/Gx5KoPLNHa/wStTHIygUHYijJLvrbW08HPNdPNDNkqD8zBwC8j11nVtgG85f ftKJMC4zrBBoJyMbKfZZCrpEFntqv32hDNqwQ7RNnbYsZI+fDMb/btAFWhUg3Mt8z5a3 jFgIjTuN20DK1+1ooooRT5b+LK3UCQ3rvY1Ni5x79Hy0oMJprjNDtA5ooh68bCrx8J9u EMo0uugXc1lS+mchs4WwYC8uhXOVo8FSccrkqixp7pShr531mRncL/towOffj9+Siv3F xO7Q== 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=X6sNEtOlmoht11f80QBpHESiqEjtJn4YK4y150mlSQc=; b=adZ/S3NQyJ+ZfsvILQK663vbczKzVPBcB1a9M6UyLtbHci4Hi1fOS6MjCedQe0svWt Obm8ihUW0HSEE1OJL4nx5JQeeeZfeKOSVSFBUUgnzRlkfV3uA9loPIzhhxT1lJpbN51w WDLWx/BDaYTuOIdF4nwrtJorAnliPsXUyTEz0sukY9kkNDdA13rDhYVPrwBQ/yCqou1O Js6ukTF8UoUkHM03G5StdNradbGm/q4Yw9m3kicCKsem+qomRtko0Rf6riOeZd6cgyw9 +iJD2+txISt/BbOVozdXSJdFKCn3BO6tbJTvA8V+Hwp6P1CCEjOqGxTsneMzpi7pf2bJ 9urQ== X-Gm-Message-State: AOAM532Z3G0k+de+uskJe/FgpfpcPrgcKleoipKuyGj6JJM/9GUw2kDO DVbPPjhtadbsI+rUXKuxzH29YNQO12kt3BgT X-Google-Smtp-Source: ABdhPJxW3Jswj1KpVO0YpOqn4oE9G5h35hDf1ak6zSTNmM6Bc1fhTLbVBByaW9/ILPppoAPqVr9ltw== X-Received: by 2002:a5d:4f81:: with SMTP id d1mr27094833wru.95.1589894206672; Tue, 19 May 2020 06:16:46 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id g6sm20858366wrp.75.2020.05.19.06.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:16:46 -0700 (PDT) From: luca.boccassi@gmail.com To: Michael Baum Cc: Matan Azrad , dpdk stable Date: Tue, 19 May 2020 14:05:44 +0100 Message-Id: <20200519130549.112823-209-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix meter color register consideration' has been queued to stable release 19.11.3 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.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 05/21/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 46cd8f27b1dd7a7ac17e125eb7d263e0682c651d Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Wed, 6 May 2020 16:24:06 +0000 Subject: [PATCH] net/mlx5: fix meter color register consideration [ upstream commit c8f0abe7f89d61a347ba9e2d3bf337c89c0fb16f ] The mlx5_flow_get_reg_id() function translates tag ID to register from the registers that are supported and available for use. The user does not know which register is available at a time and therefore there is an array that represents mapping to the available registers. Usually the free registers are continuous in the flow_mreg_c array but sometimes the mtr_color_reg register is between them and it must be skipped and the next register returned, in which case the function returns the mapping of the next entity in the array. When the function reads from the next entity in the array, it does not check whether such an entity exists and in some situation invalid access to memory occurs beyond the array boundaries. So, when all the registers are valid from HW perspective and the meter color register is not the default, the tag id 5 causes an out of bound access. Validate registers availability when meter color register is not the default. Coverity issue: 146355 Fixes: 792e749e92d5 ("net/mlx5: fix register usage in meter") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5fcff9a075..e05c35a417 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -432,6 +432,10 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev, */ if (skip_mtr_reg && config->flow_mreg_c [id + start_reg - REG_C_0] >= priv->mtr_color_reg) { + if (id >= (REG_C_7 - start_reg)) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + NULL, "invalid tag id"); if (config->flow_mreg_c [id + 1 + start_reg - REG_C_0] != REG_NONE) return config->flow_mreg_c -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:53.130573830 +0100 +++ 0209-net-mlx5-fix-meter-color-register-consideration.patch 2020-05-19 14:04:44.604655406 +0100 @@ -1,8 +1,10 @@ -From c8f0abe7f89d61a347ba9e2d3bf337c89c0fb16f Mon Sep 17 00:00:00 2001 +From 46cd8f27b1dd7a7ac17e125eb7d263e0682c651d Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Wed, 6 May 2020 16:24:06 +0000 Subject: [PATCH] net/mlx5: fix meter color register consideration +[ upstream commit c8f0abe7f89d61a347ba9e2d3bf337c89c0fb16f ] + The mlx5_flow_get_reg_id() function translates tag ID to register from the registers that are supported and available for use. The user does not know which register is available at a time and therefore @@ -25,7 +27,6 @@ Coverity issue: 146355 Fixes: 792e749e92d5 ("net/mlx5: fix register usage in meter") -Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad @@ -34,10 +35,10 @@ 1 file changed, 4 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c -index 01376f3c51..08c7cdf005 100644 +index 5fcff9a075..e05c35a417 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c -@@ -442,6 +442,10 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev, +@@ -432,6 +432,10 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev, */ if (skip_mtr_reg && config->flow_mreg_c [id + start_reg - REG_C_0] >= priv->mtr_color_reg) {