From patchwork Fri Sep 28 17:55:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 976424 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=redhat.com 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 42MK984v7Tz9s3Z for ; Sat, 29 Sep 2018 03:55:56 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EB66CE6D; Fri, 28 Sep 2018 17:55:53 +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 E607FE1C for ; Fri, 28 Sep 2018 17:55:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 85AC07C6 for ; Fri, 28 Sep 2018 17:55:51 +0000 (UTC) Received: by mail-qt1-f193.google.com with SMTP id x23-v6so7610606qtr.1 for ; Fri, 28 Sep 2018 10:55:51 -0700 (PDT) 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; bh=1YTkClKyuJn0ZZrpLgpquSIX96VUUYotqlKDgb7PA+I=; b=qpE/syTqChZrvIgHjq+6xEr44aIEvtNoupOdIrK0pI+7ywTwAE1oyExYACvAaLOpUr oBzzKPqOf4mnayifpMya5ghrw5HBv+rWCBNiUQbn8JFZGKw4SvPRxbCC+KQxku0bE0Ip DBXXJFNOCmqYMP3ItVGkLqH9+bWLmzgB7Lm9DSdhE8SrOP6cA7d7Hc1iECbwVfnvwOed E0hRsAMEbEe5kXcOug+YmCpmfAdQE51nMx7qG7askZV4UXhGhzr8/92ilU1pqcgc9y5d lJxskXij/97I6csJq+6cuZig8w6vtuc2IfQHL90eeIAlcBT5bkar4ax88HvxW1gfO3zq GZfQ== X-Gm-Message-State: ABuFfogO8VQA+Jq00P+r9YLRpUo5pj3UdFSjykmY0wqI6eQMHYjdYPgz heJYPLRFG4Gy1CleWxIkTdZSag== X-Google-Smtp-Source: ACcGV61JHYQopNbE9KEcNYygAL+DTsp9ngKShz3um8mQhmseXFXDF+IoExmrzhKba1SV/BVQpeQ3DQ== X-Received: by 2002:aed:3f08:: with SMTP id p8-v6mr13124810qtf.185.1538157350661; Fri, 28 Sep 2018 10:55:50 -0700 (PDT) Received: from localhost ([177.183.215.101]) by smtp.gmail.com with ESMTPSA id c50-v6sm4038871qtb.8.2018.09.28.10.55.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Sep 2018 10:55:50 -0700 (PDT) From: Flavio Leitner To: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, dev@openvswitch.org Date: Fri, 28 Sep 2018 14:55:34 -0300 Message-Id: <20180928175534.13590-1-fbl@redhat.com> X-Mailer: git-send-email 2.14.4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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: Flavio Leitner Subject: [ovs-dev] [PATCH] Revert "openvswitch: Fix template leak in error cases." 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 This reverts commit 90c7afc96cbbd77f44094b5b651261968e97de67. When the commit was merged, the code used nf_ct_put() to free the entry, but later on commit 76644232e612 ("openvswitch: Free tmpl with tmpl_free.") replaced that with nf_ct_tmpl_free which is a more appropriate. Now the original problem is removed. Then 44d6e2f27328 ("net: Replace NF_CT_ASSERT() with WARN_ON().") replaced a debug assert with a WARN_ON() which is trigged now. Signed-off-by: Flavio Leitner Acked-by: Joe Stringer --- net/openvswitch/conntrack.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index 86a75105af1a..0aeb34c6389d 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -1624,10 +1624,6 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr, OVS_NLERR(log, "Failed to allocate conntrack template"); return -ENOMEM; } - - __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status); - nf_conntrack_get(&ct_info.ct->ct_general); - if (helper) { err = ovs_ct_add_helper(&ct_info, helper, key, log); if (err) @@ -1639,6 +1635,8 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr, if (err) goto err_free_ct; + __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status); + nf_conntrack_get(&ct_info.ct->ct_general); return 0; err_free_ct: __ovs_ct_free_action(&ct_info);