From patchwork Thu Aug 20 22:49:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1348672 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.136; helo=silver.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=rb5pjNqG; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BXg0124W1z9sPf for ; Fri, 21 Aug 2020 08:52:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 64D6023340; Thu, 20 Aug 2020 22:52:31 +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 wo+Rn3E6NBkh; Thu, 20 Aug 2020 22:52:22 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 28888233B9; Thu, 20 Aug 2020 22:50:34 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DDEAEC0051; Thu, 20 Aug 2020 22:50:33 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 79BF0C089F for ; Thu, 20 Aug 2020 22:50:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BDECE884F6 for ; Thu, 20 Aug 2020 22:50:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eA7VsO6tixxD for ; Thu, 20 Aug 2020 22:50:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id D8FF188484 for ; Thu, 20 Aug 2020 22:50:16 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id u20so106882pfn.0 for ; Thu, 20 Aug 2020 15:50:16 -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=xvgls63EPMvkaCK9aLLPOG/qJlre0KKuaEBeTfM166Y=; b=rb5pjNqGM0z1M3ZrFQJLd4Y6k3qm250S0+05HhXvCqGj5jlanBOEEDq8C5xPa3KgY5 GAIL6kmykTFUX14ycH6zupjizv4GfjTXUDKAQKJrILAVdmH33uZHU8f23p9dJuDKwabm gWxAO4pTqv4n7bqNSQUkvBfnDgotoUULCTaBycwebiXFwpRzFK+4V/gQDR1fjJiPelcc 20ZQ9oXIxJaceh8BVNa7nE0RyQVtkAGzQq4mQhOPi6dHL7mc+LxI/Dq5OuvZwjetqXsQ lNq/Sg8Ojw/GIEikL7jmKmCAJfTx/b03GpZWxv6FX8yJ4Whwa22t5RD5aeKI57kPN1Ku CaWA== 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=xvgls63EPMvkaCK9aLLPOG/qJlre0KKuaEBeTfM166Y=; b=UTjL6xV3sUGtWYHTlUZO5PSP3tn7Kky1gWlmFRjiD+0moY9zMGBTCeau7At73nLQjN /iR/UCz0RRNKTWmb7WhUtTYMkaab+VEoqkkcTcPFsJKujGmuV4PGc21M0cTQda1divQL YAQiC5heM3oi+s2Yk9C7vl20H5/elCDIo0/YklQBAL2fZ8IY8qw9O9kzTE7YX8GenlJx Hjff8I1qLsGXxYjbHndDtr36CYWYGnu+qYQQY6t5/zpeXBuiT/gssRJmmI2XFfoYs8xZ mYHeZJ0mPQzX4vhXdCQaLN+RfC4ec9DA3CFB9qQ6bq5mVzIymhzXBGkv4qwcLirCrDRj xsmg== X-Gm-Message-State: AOAM532jbgiKYQJJ0IEHMRtWZO46o5CbtjWYXFjDQJrXDcMdiA2CNYsr sMEBab0ZquV0rDFAhncUVDuZjK9Wa4/ONw== X-Google-Smtp-Source: ABdhPJxj8HlkjZhpsV2imlKQgemPDKO7WD1X/v0o3rcJ5gRT4xzkIPai9o4wt/xMelqReqnwEqSfCA== X-Received: by 2002:a65:5a8d:: with SMTP id c13mr248632pgt.268.1597963815704; Thu, 20 Aug 2020 15:50:15 -0700 (PDT) Received: from gizo.domain (97-115-99-106.ptld.qwest.net. [97.115.99.106]) by smtp.gmail.com with ESMTPSA id y6sm116866pfr.61.2020.08.20.15.50.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 15:50:14 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 20 Aug 2020 15:49:35 -0700 Message-Id: <1597963790-12362-9-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1597963790-12362-1-git-send-email-gvrose8192@gmail.com> References: <1597963790-12362-1-git-send-email-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH 08/23] 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 Signed-off-by: Greg Rose Reviewed-by: Tonghao Zhang --- datapath/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 1235c4e..c222ef8 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);