From patchwork Wed Sep 16 17:32:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1365748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jPFw10t/; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BsJxy2CMYz9sTW for ; Thu, 17 Sep 2020 11:18:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7D0AC86ED1; Wed, 16 Sep 2020 17:34:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HbgYvsp-ihq1; Wed, 16 Sep 2020 17:34:09 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3815D86D92; Wed, 16 Sep 2020 17:33:40 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 04CF8C18DA; Wed, 16 Sep 2020 17:33:40 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4E809C1818 for ; Wed, 16 Sep 2020 17:33:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3FEFC2E0B5 for ; Wed, 16 Sep 2020 17:33:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CTaCQpj06CSn for ; Wed, 16 Sep 2020 17:33:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by silver.osuosl.org (Postfix) with ESMTPS id 8E4212E0DC for ; Wed, 16 Sep 2020 17:33:23 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id v14so1877816pjd.4 for ; Wed, 16 Sep 2020 10:33:23 -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; bh=obbizrJjrNhuuMlB/P+3DBbai/Gj1TvmoMVf/5+aric=; b=jPFw10t/wN7TRnJrmlorSC0Qg1N0/Tad+mt6SFz8p3Yv0p+zncuFzqF5Pl6u33/reI U4q0XtKTKuVEOwt1V8xIJq5in3JNnORts8/+1PpQ7t7wzWk4sqMYc9jMq4Kf161etuYx oOj7AGU0t2B0InYUmMIpa/Y36KtR0vXWNOqfSRz4jnDqCG69fgfttlUSPO9An1fN6iDm //irk8K1Mz+b5AwDUQseJFCZAvrDAFQzqZzwpiwTlYeAwwvZyBSrTfNHyU1JHpeuKG3k HjcsP6/lBJrRvO5oGnqfcb9Tv8IJf+M4dsjHeQHOtbCy5xrTvgQsZKAhvLFEYbGMshqK ycmQ== 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; bh=obbizrJjrNhuuMlB/P+3DBbai/Gj1TvmoMVf/5+aric=; b=ZOUluefmHbNKtlMlHduzO66IWpLCF5gMCJSbciIRp3kfDZrmbR9jr+xjPk83vRfDqS D97SAeZopTRGeDMvUphOY/TbSLaKRARy41xRe9bTkscoQvzaKrBsWsgjlsoPJTRDrBfq cniUUle4P8xvrsDgeFBISCyXTKjsZBWcs7hGsqbvz+ZYf9uREEuw5lbP0bH/7jYx86k1 L4NP9ILuFYygJJQa6NT3TaIn77n1885rhKEbWa5mFoa3EDVZ+4Ot4K7xXlk7+y3mQmRg ZWuSDSB8j94ala6O9akAp3Byn6DZI2EIMGc+bSNKGNj7MNysuqXFreOMj270Vg3ihcfO 07Rg== X-Gm-Message-State: AOAM530v84SPfiaM9g7QaaxSNWmc3GbDcnIcHWNflElqmii29aafz4oj d8/e+5iq5A6yWYBVbggkIZX6Wz6EtuHfhw== X-Google-Smtp-Source: ABdhPJw0xySLaSQAxy6j7WM2T9ERQ5Tvm1zjV2AJuPl6nZAz8exOJjbj3zRc2Akx81gKtwyTgrP8PQ== X-Received: by 2002:a17:902:eed4:b029:d1:cbfc:60f2 with SMTP id h20-20020a170902eed4b02900d1cbfc60f2mr13864072plb.0.1600277602688; Wed, 16 Sep 2020 10:33:22 -0700 (PDT) Received: from VMware-box.domain ([97.115.183.169]) by smtp.googlemail.com with ESMTPSA id o20sm16248519pgh.63.2020.09.16.10.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 10:33:22 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Wed, 16 Sep 2020 10:32:54 -0700 Message-Id: <20200916173311.30956-8-gvrose8192@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200916173311.30956-1-gvrose8192@gmail.com> References: <20200916173311.30956-1-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH V3 07/24] datapath: don't unlock mutex when changing the user_features fails X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang Upstream commit: commit 4c76bf696a608ea5cc555fe97ec59a9033236604 Author: Tonghao Zhang Date: Fri Nov 1 22:23:53 2019 +0800 net: openvswitch: don't unlock mutex when changing the user_features fails Unlocking of a not locked mutex is not allowed. Other kernel thread may be in critical section while we unlock it because of setting user_feature fail. Fixes: 95a7233c4 ("net: openvswitch: Set OvS recirc_id from tc chain index") Cc: Paul Blakey Signed-off-by: Tonghao Zhang Tested-by: Greg Rose Acked-by: William Tu Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Cc: Tonghao Zhang Reviewed-by: Tonghao Zhang Signed-off-by: Greg Rose Acked-by: Yi-Hung Wei --- datapath/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 1235c4e3d..c222ef88e 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1746,6 +1746,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) ovs_dp_reset_user_features(skb, info); } + ovs_unlock(); goto err_destroy_meters; } @@ -1762,7 +1763,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) return 0; err_destroy_meters: - ovs_unlock(); ovs_meters_exit(dp); err_destroy_ports_array: kfree(dp->ports);