Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3111799pxm; Mon, 28 Feb 2022 12:15:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgumgqAgpK1z1fiWqkm0qvkM6cDszEBXh/GgOmW1sGA0rmj9soG0XpXHNJVYjY3GfszMg7 X-Received: by 2002:a17:902:ead1:b0:14f:95e1:86fe with SMTP id p17-20020a170902ead100b0014f95e186femr22006488pld.21.1646079307674; Mon, 28 Feb 2022 12:15:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079307; cv=none; d=google.com; s=arc-20160816; b=ca855UOLGPrnPRfmlMP/MZPDJks6Ld790eKOleU2FMZSPHAwSkkrv+1t9demD7v8Il lnBaL7D0lugzkaDhFUoXEqIdPvdt89nEPjE53ImUgsCvKRO8Oq/0AuMAMEh+yLFTPSMy fR5/qvxonnUUPnzHlZ35AQTM+WkNEzTTirT3sSu1B2N3lzKyzCcCCsfxhEYnxvuZBbXj feH+0s5dQCb44SHtzcgY1jSmZ3Q1mGJp1Kogl4gtKAEXg6m5q+WhlrZwg1zsfepLHCS2 RfI9Hmz7cnmjjx6Ry83O95pumWOeysyKzei519lTQhnQINC1fOPnMo+6fgVvp7Gc17rA pVow== 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=y2v1hsrtdZ+r14YhxcrBbSFGuBngnklYjlR3J2XrVnQ=; b=APUapVl/1jRMnx9b/t92GVhKmyhPVAMabz6V7uTNmPCAGw0kxHq2nrvjel6THDFFHa TVOfetdI+JJYEXPQeauhJJt6OGpYtfSA0QMJIuCOZmrbSNRb/g0XkjxHyRvbBwdACcxG /YJynGTWdfCoIj44r2hFcEmVWDgjIVRo0IvqoNZ64davkcOb3kfkDfo3nayORg1t2VnW G+xCHxFkJw3rvfDGh0pVhwx/0m1kfPaR5/htwAVOg45IIEe2F8hF/wYlIxgqhetUtBEi +m5NBLt+/mNjwjHuAIvkf8zeS1S7lQYx/tiBSjxa3Q0sbdSG/O7Q+NZBefSCcgSUwltp 6ZDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K3KiHZSR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u13-20020a056a00124d00b004f41abe3900si2046987pfi.273.2022.02.28.12.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:15:07 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K3KiHZSR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 681583EABC; Mon, 28 Feb 2022 11:37:21 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240077AbiB1SHx (ORCPT + 99 others); Mon, 28 Feb 2022 13:07:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240458AbiB1SDf (ORCPT ); Mon, 28 Feb 2022 13:03:35 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFEE5B1A94; Mon, 28 Feb 2022 09:47:15 -0800 (PST) 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 2AA636090B; Mon, 28 Feb 2022 17:46:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D2E2C340E7; Mon, 28 Feb 2022 17:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646070393; bh=/qOcK68W8HfNhLzrkb3f4fmvbBeVDcxcPV7W7EcBejw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K3KiHZSRG90iv79diy8R1FCzmrFwF1PnwnfPP5SfyT88LvAa03I2HJDjGKO/8J8r+ +JBUYScSzuIp7QkqJUYeGRdkV+3QzdpD3JPfSk5uzu0fuOlf00bvjkVJn1F3/bUtz5 4Rj9QN6mcl7a1BTuu5NyqUNYG6aPMoWbTpYqtmik= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maor Gottlieb , Mark Bloch , Saeed Mahameed Subject: [PATCH 5.16 091/164] net/mlx5: Fix possible deadlock on rule deletion Date: Mon, 28 Feb 2022 18:24:13 +0100 Message-Id: <20220228172408.084994170@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172359.567256961@linuxfoundation.org> References: <20220228172359.567256961@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=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Maor Gottlieb commit b645e57debca846f51b3209907546ea857ddd3f5 upstream. Add missing call to up_write_ref_node() which releases the semaphore in case the FTE doesn't have destinations, such in drop rule case. Fixes: 465e7baab6d9 ("net/mlx5: Fix deletion of duplicate rules") Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -2073,6 +2073,8 @@ void mlx5_del_flow_rules(struct mlx5_flo fte->node.del_hw_func = NULL; up_write_ref_node(&fte->node, false); tree_put_node(&fte->node, false); + } else { + up_write_ref_node(&fte->node, false); } kfree(handle); }