From patchwork Tue Oct 15 10:30:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1177893 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.169.12; helo=mail.linuxfoundation.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.b="THQbjyNN"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46tXNP66K3z9sPp for ; Wed, 16 Oct 2019 23:56:04 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BF0F5E39; Wed, 16 Oct 2019 12:50:52 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 99950E36 for ; Wed, 16 Oct 2019 12:50:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 54E9A13A for ; Wed, 16 Oct 2019 12:50:51 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id q12so14668601pff.9 for ; Wed, 16 Oct 2019 05:50:51 -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=OQEEYsmRkKzu9TtGovz6XYfXyWzBs/Q6P9JLMlXDN7c=; b=THQbjyNNODM4ft1lCIR+4gihbs0/iyMMaFt87VNbFIGUarRgqNIunYC52PdAjQpnf1 IY5u2RRRyTUcRt02Hs/gAqmdSOsZCTPylHWeSaHNKZSlLzeK8UrR89nt/HncFEtZF0Sa h/QsVpQlKCfGJrWzfcwl5EiOBnyw9/95glxVNm7MsLL3F5G3Z/53VFmp9LRM77vwqxg6 ymXF+hQqGeBHyxHk0IAAGc6QsVgbnv15k+F7UJgUm42Vyq1qVU7RVs0MVKh/sYZHjHKz yjFNlioDiLemoBtgjEfd7lG5VEON4R6Q5Xdj6TEIDp/6u48g4lHH8qWbHoe6x/yKHYL1 1oGQ== 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=OQEEYsmRkKzu9TtGovz6XYfXyWzBs/Q6P9JLMlXDN7c=; b=N0Yhs/DNLgCWSZzL3z28U9gjlbTO2D4amP/THBiIQzkUoPXcpOPlSXeCR+M3ZMkc6v Q3CU+KkqDdrpvdaFpKdPtXd6Rm3Wb3fY6tq+NIhpUc+W9d8IGhsVdzNymaG4o8NJSpig 4fdUU9jnnl5krMqlYoMevCo1xJoVyVmhIxFqOs3vIe1xQJ0Jk3aHjRwhEVfyoafUEOKW VGi54avairgpU2tiguKaeZ6E4zih5S5y/5sq64CbY8TfCHfAULZgkvA4MtGdgXvoJEit tGaSbhhPQGvYvDgjNRuWvEPwrzZkPotxKsVsYogTnAMSQpCTu1Ez0wNVQnqHdFd6JTIY aqIA== X-Gm-Message-State: APjAAAXCOF9h8juacKzTjky8AHhslW9Yn70UMTl/BwkVaxHSjPVGK3WH EbiedntaH8zgmofL32vfywuOJMzR X-Google-Smtp-Source: APXvYqxDgjBARu93kHuKXrdpTZif6XCSPRIn/F7fIT/5cxDFtNYmvU4NKR3lrDZZ3yT90z5mZl2Klg== X-Received: by 2002:a62:4d04:: with SMTP id a4mr44307154pfb.60.1571230250981; Wed, 16 Oct 2019 05:50:50 -0700 (PDT) Received: from local.opencloud.tech.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id d19sm2747339pjz.5.2019.10.16.05.50.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Oct 2019 05:50:50 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: gvrose8192@gmail.com, pshelar@ovn.org Date: Tue, 15 Oct 2019 18:30:39 +0800 Message-Id: <1571135440-24313-10-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1571135440-24313-1-git-send-email-xiangxia.m.yue@gmail.com> References: <1571135440-24313-1-git-send-email-xiangxia.m.yue@gmail.com> X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DATE_IN_PAST_24_48, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: dev@openvswitch.org, netdev@vger.kernel.org Subject: [ovs-dev] [PATCH net-next v4 09/10] net: openvswitch: don't unlock mutex when changing the user_features fails X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Tonghao Zhang 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 --- net/openvswitch/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 9fea7e1..aeb76e4 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1657,6 +1657,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; } @@ -1673,7 +1674,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);