Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3417246pxf; Mon, 29 Mar 2021 01:25:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxoRkutujpIe8wLSU5UjSeLd2pep3rYuYNC/jc3jf07q9ZJYqCFxMcv07Di2baKniLByv3 X-Received: by 2002:aa7:c74a:: with SMTP id c10mr26968294eds.332.1617006357355; Mon, 29 Mar 2021 01:25:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006357; cv=none; d=google.com; s=arc-20160816; b=OOVGO6bk8UO7yBnLm35aatKKXwpFS+qxhixlr07v2UQ5aakcZyaJfcdpogPl3SKnUk eMmmNTPzXBzARehrqizQGKSYM1f24GTywegl7ugsjS3SLw9Dj7WFA40mPIUC9bHBldVD rGgQV/6owLwy4sSMlf0vUfSvNF8kMn8eWEEuCkPmlTR24JfZKOLKrVgFbtl7pSTTM1sj lpzv+BCciGZ148HTy+FG4MDKCZoV4VSJpf6PfkkY8KlOYXUOeHPyvsqppRCvcsroMeEH 3SpBfK75Yu6JjQe1skuQwTmcGvSQRJqTUK1x3Mfn5xUxugNUAwYu8BmBXc6Pe+2DxMep AXQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xpZNHZjLKuzSN4+QRc4XMP7Z6TBN32tosgkTeDKKARQ=; b=ODy0sjhKcpCenM8Su2GWVlWbLTD1oeAyYrzcg/sIMv+7VlZ1Mv27ZVxwIOs7KbEiH9 HhDHSDPfrHLMLMN3P0BEsKVtMgDWJbv9Lwezf3xJr0kJq2KUnH4mXtvzHp6T3XUfDhR/ todhk+e5pbgFM0C7c7BqoMTCbo6qYoxe4iSFjEgMBYoGrI0oGerGNllid3xn9v4EdYFL WueOQCEg42wm/KLLrzx6T3feE9br2xYDZAHA76ypUQYpzLk7a24XmRyZ491+Q8yZ5wH3 x5zmKPVUpOy5ZM/5QAZ+5FnPoiWxzUVj3u4jYcdeByOYVMIMOAW6BNJtJVLzkqbgD1eS GV+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QiNycyD9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si12450135edc.152.2021.03.29.01.25.35; Mon, 29 Mar 2021 01:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QiNycyD9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233535AbhC2IYR (ORCPT + 99 others); Mon, 29 Mar 2021 04:24:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:58912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233045AbhC2IPt (ORCPT ); Mon, 29 Mar 2021 04:15:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B63B61959; Mon, 29 Mar 2021 08:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005730; bh=ATi5ccoVKsqKmD1D8NsF2tx63RLYduU5eu00IddEJcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QiNycyD9/S2++sdJhDAfZdkH4KBspknvXKdhDnPhWmCmDLycQjImJzPihiQ3WoYCp rrWZDETvo2x5VX34BD9Ce83qcneBHHEWW7pnUm9LAWJwArsi4h1bCTU3m5e9yOd9zF b89oznt8YGTYPExpFozGuuRKaj17GpPwN+rQudeA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Tomlinson , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.4 096/111] Revert "netfilter: x_tables: Update remaining dereference to RCU" Date: Mon, 29 Mar 2021 09:58:44 +0200 Message-Id: <20210329075618.412408710@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075615.186199980@linuxfoundation.org> References: <20210329075615.186199980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Tomlinson [ Upstream commit abe7034b9a8d57737e80cc16d60ed3666990bdbf ] This reverts commit 443d6e86f821a165fae3fc3fc13086d27ac140b1. This (and the following) patch basically re-implemented the RCU mechanisms of patch 784544739a25. That patch was replaced because of the performance problems that it created when replacing tables. Now, we have the same issue: the call to synchronize_rcu() makes replacing tables slower by as much as an order of magnitude. Revert these patches and fix the issue in a different way. Signed-off-by: Mark Tomlinson Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/ipv4/netfilter/arp_tables.c | 2 +- net/ipv4/netfilter/ip_tables.c | 2 +- net/ipv6/netfilter/ip6_tables.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 680a1320399d..f1f78a742b36 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -1406,7 +1406,7 @@ static int compat_get_entries(struct net *net, xt_compat_lock(NFPROTO_ARP); t = xt_find_table_lock(net, NFPROTO_ARP, get.name); if (!IS_ERR(t)) { - const struct xt_table_info *private = xt_table_get_private_protected(t); + const struct xt_table_info *private = t->private; struct xt_table_info info; ret = compat_table_info(private, &info); diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 8c320b7a423c..10b91ebdf213 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -1616,7 +1616,7 @@ compat_get_entries(struct net *net, struct compat_ipt_get_entries __user *uptr, xt_compat_lock(AF_INET); t = xt_find_table_lock(net, AF_INET, get.name); if (!IS_ERR(t)) { - const struct xt_table_info *private = xt_table_get_private_protected(t); + const struct xt_table_info *private = t->private; struct xt_table_info info; ret = compat_table_info(private, &info); if (!ret && get.size == info.size) diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 85d8ed970cdc..c973ace208c5 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1625,7 +1625,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr, xt_compat_lock(AF_INET6); t = xt_find_table_lock(net, AF_INET6, get.name); if (!IS_ERR(t)) { - const struct xt_table_info *private = xt_table_get_private_protected(t); + const struct xt_table_info *private = t->private; struct xt_table_info info; ret = compat_table_info(private, &info); if (!ret && get.size == info.size) -- 2.30.1