Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6227691iob; Tue, 10 May 2022 13:21:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCyoapx/in0Zsa/iDPKX1ADYIi4764Xt5z8f3B2s7DemYLyjbMV2ueJUsX9TEYX76buzS8 X-Received: by 2002:a17:902:cec4:b0:15e:cff6:676 with SMTP id d4-20020a170902cec400b0015ecff60676mr22181331plg.2.1652214085925; Tue, 10 May 2022 13:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652214085; cv=none; d=google.com; s=arc-20160816; b=e0OvoToDNK1UTR7MkazxNxDiUqkq8lGm+peoojTliyzwWhHe5SghjJDx+LJ0P1ib4K dK06kNfLj0EwOwmCrMJfD4u2zsHf3/0olLJjxwLl62kQY4jJHDqq2IWZ6bPOL834aVKF 3MyI6ZJNQsXUedBfp58jG1z1z/dzF7RJkpgiQ0QN/zvV9bwKe5MVbwYjPtPXNg/WS5Iy pZqMLQHRivC9vLs3kx1ywk044u657xEUm3UsLRz4b0Xv38f1PA+W94qLY8kdRD0AS3LG jBybZ21bD09a4LWT3/vw6plckdLCtR9KjKul0mXFfX7lNNm6lwFz57tetc4ycrcqztvy HQOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=snEVnbKYNYTxDt6rWFreOb1na1d7t989WGj3ImCIL20=; b=NpzXXT6cu+rmLQIuCptCrwIo+5QhnsLCH30yHuoHnRgnTiyY6YpdmMx3G256XjguTl BJxQIC4gWqCUL/ueDPCVeKVQXnntGva7EXwWJaFipwkn3kh77SwmvEjuWXzZtGb9fYF3 ZKXx0SXipaCEeB6QEB8n/EbxZsYnr7kpW8+7WO4trkwGn8xLUpau9w9yANiOqLKYKXV1 I11Ddm50COgFl9G0Txyed0/VmgIOLZ2ujkPTK+3+zvaGxJdmCdkpbSFM0fy8gm8tYes9 UhotCtxa1xJF6hcNLqYiOps6n/LkrFBXO/q2me6SmtOGtUkSvTVK2roqeCvCMzNDf5Nz HVFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SHHDj38G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a056a000c8700b0050d20bfc382si20361545pfv.194.2022.05.10.13.21.09; Tue, 10 May 2022 13:21:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SHHDj38G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244888AbiEJOFr (ORCPT + 99 others); Tue, 10 May 2022 10:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244810AbiEJNmJ (ORCPT ); Tue, 10 May 2022 09:42:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB4A81991; Tue, 10 May 2022 06:30:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B3BB461763; Tue, 10 May 2022 13:30:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A94B8C385C2; Tue, 10 May 2022 13:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189433; bh=bZpbnHDawu3VCWMLYiGy43zxTarsma7M7G7naDOwl/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SHHDj38GX4WBsxMtFT119xfrPyB2F5UwLG5fd+k+R+x/ZTrUIWNz48NPb2c84GnQr 3ONmIYq/UZzAWFbIJRVe73GG4jO8R/rTsARW7jsQdaJV6wfhQn4qkjq/+NF47Ik+D7 KsECsk1SIoypHZbRR7hCODnxBEE0iZMXH9++m1rw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oz Shlomo , Paul Blakey , Saeed Mahameed Subject: [PATCH 5.15 050/135] net/mlx5e: CT: Fix queued up restore put() executing after relevant ft release Date: Tue, 10 May 2022 15:07:12 +0200 Message-Id: <20220510130741.835869717@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130740.392653815@linuxfoundation.org> References: <20220510130740.392653815@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Blakey commit b069e14fff46c8da9fcc79957f8acaa3e2dfdb6b upstream. __mlx5_tc_ct_entry_put() queues release of tuple related to some ct FT, if that is the last reference to that tuple, the actual deletion of the tuple can happen after the FT is already destroyed and freed. Flush the used workqueue before destroying the ct FT. Fixes: a2173131526d ("net/mlx5e: CT: manage the lifetime of the ct entry object") Reviewed-by: Oz Shlomo Signed-off-by: Paul Blakey Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -1699,6 +1699,8 @@ mlx5_tc_ct_flush_ft_entry(void *ptr, voi static void mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft) { + struct mlx5e_priv *priv; + if (!refcount_dec_and_test(&ft->refcount)) return; @@ -1708,6 +1710,8 @@ mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_p rhashtable_free_and_destroy(&ft->ct_entries_ht, mlx5_tc_ct_flush_ft_entry, ct_priv); + priv = netdev_priv(ct_priv->netdev); + flush_workqueue(priv->wq); mlx5_tc_ct_free_pre_ct_tables(ft); mapping_remove(ct_priv->zone_mapping, ft->zone_restore_id); kfree(ft);