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 B1301A0C41 for ; Tue, 30 Nov 2021 17:38:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA8ED411CB; Tue, 30 Nov 2021 17:38:54 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 0F6C241190 for ; Tue, 30 Nov 2021 17:38:54 +0100 (CET) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D652F3F1ED for ; Tue, 30 Nov 2021 16:38:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290333; bh=fa89tnYJwAac17iKNAphLGL/tNDT4e9rGUqfmi1Amnw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XU7rAb7/egQfPhEj/lSjuocHrd/Gb4tGp23dxF3y50kovNLakkIsTjFlW1AM/8Krn f9nUI1hItDphwr3WELc5KQk9vEFjj9mGN+VgG3cTALYEHGhFVoRPYb883OzrQ9Yoki BJS3xYUYnw76NHQqbAxwou7M2TzMOgA3N61+ljdLxWxMmwvexPNGvBGSDlY1IkP549 UJCaUzKCn3ZSZ9898GuNVSA5VPi4p4zV2UuAT9qT+tnH3yqDSJ2Um2mnc0b0GEBNUF OXLs4H+GW9lfdX3bK6ULnlZ2A6Q6L8HV0L8wNpgmEpLPK3RU8Ch9jyOcrDSA+Ofz1t Wn9iJpqJioZtQ== Received: by mail-ed1-f72.google.com with SMTP id b15-20020aa7c6cf000000b003e7cf0f73daso17407160eds.22 for ; Tue, 30 Nov 2021 08:38:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fa89tnYJwAac17iKNAphLGL/tNDT4e9rGUqfmi1Amnw=; b=cIN1lg2MN2fJdm9qYFdw6LIGMfPqONHMamzOvbARi9d6K6tXON/PVzLYMHw9ChoqAX vfOsb1Wo/27yuuNxgSAq1gWUNG1yqjtvNAhD/+L40jRZiy6aE9vPaeLquM6sb9MRVzKn d5+D/FM/pd20Z68p9BADN3c1bPJnaNWzyzcV4DK5Deo8aDHLizpP1ei6hEJEWt29nBoi lw2sj1KDKjRf126kOA5t4Y05eMVknFiIB3IHsxCKLJzgx0hD6j2JqP2ofV0JO+0h1Zy4 Q0PS5bC7RwuknlFA28guBhkFzrcSXGAIMFKTSNIrsOcPP3eJprmqmyf0wHHFzqqwokII /2Ow== X-Gm-Message-State: AOAM532m1muWW2+lK0uszaytLnD5x5Jbk88l0xhPOplZLt7HtG8nGCW1 c8hcbV2nv/iC9JxRc3pXx2pPGdlk5B6u9u3/HgJQlEC8W9rtJWCLBlGpXbfgEdpSlVR876im1RG aY+d4mbAhWwyvpFOsSUPPVBrd X-Received: by 2002:a17:906:9144:: with SMTP id y4mr257317ejw.98.1638290333335; Tue, 30 Nov 2021 08:38:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7xdE2nPBfpgtiDisd/HN/llUmVvE4Zqw3Hs2znGemxNoAYfb+jJYKkL+R/syLGB4KPY5mUw== X-Received: by 2002:a17:906:9144:: with SMTP id y4mr257296ejw.98.1638290333166; Tue, 30 Nov 2021 08:38:53 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id he17sm9307168ejc.110.2021.11.30.08.38.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:38:52 -0800 (PST) From: christian.ehrhardt@canonical.com To: Bing Zhao Cc: Matan Azrad , dpdk stable Subject: patch 'net/mlx5: fix flow tables double release' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:17 +0100 Message-Id: <20211130163605.2460997-53-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/4ca7fab3b0e3365bf427660fcb62c0cd856ea73e Thanks. Christian Ehrhardt --- >From 4ca7fab3b0e3365bf427660fcb62c0cd856ea73e Mon Sep 17 00:00:00 2001 From: Bing Zhao Date: Tue, 28 Sep 2021 07:08:51 +0300 Subject: [PATCH] net/mlx5: fix flow tables double release [ upstream commit a6b57ff48708e659ad35aed499c32805de85d3cd ] In the function mlx5_alloc_shared_dr(), there are various reasons to result in a failure and error clean up process. While in the caller of mlx5_dev_spawn(), once there is a error occurring after the mlx5_alloc_shared_dr(), the mlx5_os_free_shared_dr() is called to release all the resources. To prevent a double release, the pointers of the resources should be checked before the releasing and set to NULL after done. In the mlx5_free_table_hash_list(), after the releasing, the pointer was missed to set to NULL and a double release may cause a crash. By setting the tables pointer to NULL as done for other resources, the double release and crash could be solved. Fixes: 54534725d2f3 ("net/mlx5: fix flow table hash list conversion") Signed-off-by: Bing Zhao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 3134b7956f..d9db6aa398 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -849,6 +849,7 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv) rte_free(tbl_data); } mlx5_hlist_destroy(sh->flow_tbls, NULL, NULL); + sh->flow_tbls = NULL; } /** -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:09.134719536 +0100 +++ 0053-net-mlx5-fix-flow-tables-double-release.patch 2021-11-30 16:50:05.706872913 +0100 @@ -1 +1 @@ -From a6b57ff48708e659ad35aed499c32805de85d3cd Mon Sep 17 00:00:00 2001 +From 4ca7fab3b0e3365bf427660fcb62c0cd856ea73e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a6b57ff48708e659ad35aed499c32805de85d3cd ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -31 +32 @@ -index aa428366b3..45ccfe2784 100644 +index 3134b7956f..d9db6aa398 100644 @@ -34,4 +35,4 @@ -@@ -1372,6 +1372,7 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv) - if (!sh->flow_tbls) - return; - mlx5_hlist_destroy(sh->flow_tbls); +@@ -849,6 +849,7 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv) + rte_free(tbl_data); + } + mlx5_hlist_destroy(sh->flow_tbls, NULL, NULL);