From patchwork Wed Apr 3 16:49:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1076197 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="oaGPKMUE"; 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 44ZBr75JwRz9sNq for ; Thu, 4 Apr 2019 03:49:26 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9A32B12E2; Wed, 3 Apr 2019 16:49:23 +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 4856F1235 for ; Wed, 3 Apr 2019 16:49:22 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C9EC9712 for ; Wed, 3 Apr 2019 16:49:21 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id g8so8620251pgf.2 for ; Wed, 03 Apr 2019 09:49:21 -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; bh=nYdhVbWdg3omyd+x7qS1LG6F/+7u/yiWoLhj2NqppK8=; b=oaGPKMUEbiNQcAeGP4PjDiUhGSwbZR4zXLKh503eHcupZiAiA15h4rJ2JlWImzivkd TmTL6Wp6XG8v6bA2ZWMltXspUQPX2ceiegs5PcjkR3ufem9OsTWWQCFtz3GeTo3EQo+D gsi7jXMpzgKYLDyN3ooip6MQGRZ0+dHJLyyEUp892pzZCOEOskb0dsBEgaO3zgwNpIGA mHx0hmhAdJ7VrS/OIXwcpyM3SG/A+86cC/G82dm9OK2PcvGGSpmkc5/OuIQQQS0nvMZf ywkrPHbzUjtCxMkgSVg8AB+dtpmJOYNkZVQIi7cl9+yCuXz6r4OWCev7u6UAhzCs9jyH /4ZA== 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=nYdhVbWdg3omyd+x7qS1LG6F/+7u/yiWoLhj2NqppK8=; b=YD+KZ4VRVjzYyQ8XG/+6YqYSSe6LCKI8jLDwmsT7As9Ic8c7fVnnEMCV9IQj7ehFjI m5KzhUNXweAxvhDEAEhdRG3r+0H0cRY2ux4Zuliqd8CTMPmnuLkP1wvHikYjjYEN4l/D Op3hrVVA7jyz5YM+GiBmXg9qknhyhTEZ6EkrGX8+VA4aQ1CXp4cnBPH52GT2zhqzwvjW nB6dA9Wkctdk0iUvw++wz882QxB791Te5wOxd6OEEQG36yj6pdasJLUbpdMJrG+a/RgI lvOsF9RZlrs7TxVldUvV+qkKo+6cN5x8aYRKDL0MB7lb4mYW9La1PGwDGE6QS/XBKcxj CAZw== X-Gm-Message-State: APjAAAX6c23UGCHPYZ3BWI6MaZ1avZOOTF+OpXzURmkaTA4PPzFGGXu4 iHyJwOBcY4cMcPx6s8EZuz9/vk8u X-Google-Smtp-Source: APXvYqzqxFYYux550LXPA8vTiVKDu+9WJVF1Vl9a/EF8uaJ+B6vlgZFT+6K1GivwabrGC8HH8KMnlw== X-Received: by 2002:a62:209c:: with SMTP id m28mr374976pfj.233.1554310161025; Wed, 03 Apr 2019 09:49:21 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id d2sm20902769pgg.47.2019.04.03.09.49.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Apr 2019 09:49:20 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Wed, 3 Apr 2019 09:49:13 -0700 Message-Id: <1554310153-2544-1-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 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: Flavio Leitner Subject: [ovs-dev] [PATCH] datapath: Revert "datapath: 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 From: Flavio Leitner Upstream commit: commit 7f6d6558ae44bc193eb28df3617c364d3bb6df39 Author: Flavio Leitner Date: Fri Sep 28 14:55:34 2018 -0300 Revert "openvswitch: Fix template leak in error cases." This reverts commit 90c7afc. When the commit was merged, the code used nf_ct_put() to free the entry, but later on commit 7664423 ("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 44d6e2f ("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 Signed-off-by: David S. Miller This patch backports this upstream patch to OVS. Cc: Flavio Leitner Signed-off-by: Yifeng Sun Acked-by: Flavio Leitner --- datapath/conntrack.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/datapath/conntrack.c b/datapath/conntrack.c index a7dc9e0c3513..52208bad3029 100644 --- a/datapath/conntrack.c +++ b/datapath/conntrack.c @@ -1691,10 +1691,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) @@ -1706,6 +1702,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);