Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3413943pxf; Mon, 29 Mar 2021 01:19:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIVhkwbRuJp7FNpuaoDmN5R26RPhOCgUgHhxNf2xOL4A31dcBPZrDfU0P5Dw03jgAwFuZJ X-Received: by 2002:a17:906:80ca:: with SMTP id a10mr27557421ejx.297.1617005942633; Mon, 29 Mar 2021 01:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617005942; cv=none; d=google.com; s=arc-20160816; b=FFYCcRIbfjcffciaKeE6rlqylnIu8jv3Zn20b9x/VY+q1ulM5k8yXis81Ji6N+zgD5 TTGt0MSZYvOHTXrM3rpPEMxj7BO4DX38f22aIhEiIfGXjco8hfTbgZfeYXLQ1FT5Qlru GlK33ymrXWWpAKZvjPt1GflXSSP4Xe4fEDVYQP6u/I9jnDdurZt0mWUePNVDsPtIMjdL /nEKtgiI9guWz3PCvawSIPZAwbqXOymB1a7fxlrsBfH2fApGsC+/R2jXv5HdohD9f0jp YSXbU1S/tcVohRQvGPHGgNWr3PWwpMI0JqNHcuPvEwjWRET5Jb+3Y60zpOeoDDl95Yii Jf+g== 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=M2nt9srnAmKghk5ltZQPGt+icdHWfTc6nwnvkmd++sg=; b=i9YoE+gvcPYMzsXty2+VoItlurxfl6NHxEaPYXFkUlydbrQVHRflCaGnf4foYXa7zc rBkYPi7XHnVkgjsOpOT5DfxB9p/u56SAnaSC1+MAboUwoOI5GFJy86D0OTV+3PoE9Ay8 stYwh3VdSszDzCzqjimBZ2p8PzleahPJg7ytxvGXZMRsBaM4FQ4d2o9VQDhAE4C4rFZt TnAN4LBMlz6f5nT8+p5LNvvKUF4S9swBRR8gOL1EH5f+MAJ1QF1M4zd1y7wjj308/1vm wWQa0b9Z+Fy+O5NnsMkMLtG6rCGm3TcSsjiNM1GDiE+RLDbMfyt3cnOWO2I2h7YfHKjO z2zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TbAsnhI9; 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 ds7si13700831ejc.534.2021.03.29.01.18.40; Mon, 29 Mar 2021 01:19:02 -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=TbAsnhI9; 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 S232986AbhC2IPb (ORCPT + 99 others); Mon, 29 Mar 2021 04:15:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:53426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232583AbhC2IJg (ORCPT ); Mon, 29 Mar 2021 04:09:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4E5061959; Mon, 29 Mar 2021 08:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005375; bh=mBBvYGagjQbW9Uhpi8KOWsgyNWHTc0ss/psoTuFgfYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TbAsnhI9x8a9MqFBOwvk+GUG+6KGkGO8gR1sS3eEOrGdsHKvVul8oOoNW/j8DW30p S+sCOirvVK97xlM28yFIQKmIlzyOpeWBmzaeMmuWwvm+d11VD19/3AHXKsjQy7hwyO Yl4A1CxWv8v41DIyM9QeIrN9/LxgVUX16twewcP8= 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 4.19 58/72] Revert "netfilter: x_tables: Update remaining dereference to RCU" Date: Mon, 29 Mar 2021 09:58:34 +0200 Message-Id: <20210329075612.210307901@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075610.300795746@linuxfoundation.org> References: <20210329075610.300795746@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 b1106d4507fd..10d8f95eb771 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -1405,7 +1405,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 2c1d66bef720..e77872c93c20 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -1619,7 +1619,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 19eb40355dd1..daf2e9e9193d 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1628,7 +1628,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