From patchwork Fri Oct 11 14:00:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1175243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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="NG8DKB8x"; 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 46qVVX5Ynjz9sP3 for ; Sat, 12 Oct 2019 01:20:52 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C5CA3178F; Fri, 11 Oct 2019 14:15:37 +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 E4F7D15B8 for ; Fri, 11 Oct 2019 14:06:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A333A709 for ; Fri, 11 Oct 2019 14:06:10 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id f21so4518081plj.10 for ; Fri, 11 Oct 2019 07:06:10 -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=5h+mm5b4p4hFAu72NQVMEV1XO70kNtCw7rgNvqIUP0k=; b=NG8DKB8x9sU1H1Lw0+HKzEl28Kkt7xEQkk/CoZ3xqTBarv2sR/+tt9rRJu1/1SLmPm Squ7sgtdwzTn/HyI2kTrS9wU6RrUeLk0fld9MDHW57b2TN3PbfHwB0fCl+FnaOhl81HU ONZ3AktdMaJNtBazgDrFyE1NK72Yk+bahH5pNTc0MlQz1Ggj7a5sY6uNOB6o173iDRj0 wxPYniSVPH7x16jO3YefeRo8G/zIaFReVy984ZM1PsyXcBdlpnRoWgiWaK1tBbF8IeAH d6xJE72cyhKnn/JpNfiMTvMcn27QVkENOSNWAW40BaPSLEsfiTSiSFf3qMaVrRMaXPoy EzPQ== 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=5h+mm5b4p4hFAu72NQVMEV1XO70kNtCw7rgNvqIUP0k=; b=VPLKdxkUPQw8KkE1PxNTVdsAjtuG5ihHtmPruTAjVXQzkXsof5qolPRwSD448USZrr mM/x1RYGuwVIEQTS58H31yn+CpUA3lySuuUpYHdibjBHNZW/sqZQavKQLaJMqUEBtvzU dzwo/GVNrsxx5pxX/OJxcFCsW3onMqXXZQumG55ejRLUJ88MV9vZVhKeaFbb+UPWbl4x g+ElUUSPkNT3JH6uphXvr1KjNT8Evqnex+2Rrn5aOQTQSksyexe1KhEdYb8nWQN0GZOh xrPIqZOaynMB4OvgbaaOA5tNtzLscPdlncUchdRw8y0DbpE64Ht1/WmhbgLKHEkX6P2k WkNg== X-Gm-Message-State: APjAAAU9kEygqbngrvdPY5ciZoffDULdlREXpxcC1sY23nAJIRADiZmc w6wyZF5tSFXYbv+aoe01GCc= X-Google-Smtp-Source: APXvYqxTvrl7XI01KCj9dwb+AZJcpTR03XXmdXoUz/KXypbnT1OxhfpptDwbDJx570IZnh53ZkCc+g== X-Received: by 2002:a17:902:bc48:: with SMTP id t8mr14858034plz.255.1570802768878; Fri, 11 Oct 2019 07:06:08 -0700 (PDT) Received: from local.opencloud.tech.localdomain ([219.143.130.165]) by smtp.gmail.com with ESMTPSA id p190sm11499392pfb.160.2019.10.11.07.06.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Oct 2019 07:06:08 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: gvrose8192@gmail.com, pshelar@ovn.org Date: Fri, 11 Oct 2019 22:00:46 +0800 Message-Id: <1570802447-8019-10-git-send-email-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1570802447-8019-1-git-send-email-xiangxia.m.yue@gmail.com> References: <1570802447-8019-1-git-send-email-xiangxia.m.yue@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham 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 v3 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 --- 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);