Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3492968pxf; Mon, 29 Mar 2021 03:56:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzro3ytN5cMFJgGySmAu9CZQS7scOEV/gh+EnFEHHZjj8P5LvHUbhvJR6Op0N5kxiLV32kT X-Received: by 2002:a17:907:d09:: with SMTP id gn9mr26977231ejc.538.1617015365731; Mon, 29 Mar 2021 03:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617015365; cv=none; d=google.com; s=arc-20160816; b=stf8LUT/1BlFlpUKnPGX/cZCkGG3El9smpPhaWJC6W2odQCKp52fxectq9985+/Nt2 wZXHHJXTypJ/gEqgXxrlzdfRisfiJEqfjQXd/VWBdtHEoOjET1NBmq4NC0lGAaBmYOkx HIQ17zs0fY9HO0/XOHbjbN4WFovcXlUw4TdWfw+iqslEiKwCbaZDB6B3YP9beqzXf4x4 588GkWRXOofT4tdymEalKgIt11gg9TWUnI/npJPG2JnlrZVGgokxzfmNgw+7i0c5cRMD ANuy4VZdQBWNZPdln1Y/zVSgj6ALx9tKkJdPIo/h54Ezvp++4bRUh8a03lO0nGpwoivz 3/Gg== 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=8e1/MgwK72ZosU6bsQ45zzG6jxTauGW/K0QbETOWHqE=; b=epWZF+lOPj/36pGTcIXxL2+rHblZ5B/92AsQlqARVsqDPO/OJJhUO3/9ydDpa7Y+Fd dIdtZVDWP5zI/No/etMs205rYAiDHcOw6ubSxrRA6GeXB5UBRgca14D8Epe0vM8/XNYH 9NFlX1Ixfwyv4TaM39L0eXe2hagS9PWaXz9k1UG0/vW8KzP63RomwL6d334p3yFlx0y7 eeJylbQDTVY0sdl4XX6Qu7xw75NyDILy7AFMbVmausrvCZr+RIMVZNY6JA/0N6fMfPnV 3iLrKRd+IW8CDqzc7ZqifF2qqQx6WqRNn3SESLu/iNVeVI38UgId4jzVDMdOkBMtpkva hrdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="EmDI/IRJ"; 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 n3si12617951edo.368.2021.03.29.03.55.42; Mon, 29 Mar 2021 03:56:05 -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="EmDI/IRJ"; 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 S232490AbhC2Ina (ORCPT + 99 others); Mon, 29 Mar 2021 04:43:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:42390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233661AbhC2IZy (ORCPT ); Mon, 29 Mar 2021 04:25:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82423619AA; Mon, 29 Mar 2021 08:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006310; bh=nwJmXZyvikEUvajC3mgvchdhiH/JCT/IkbHTO2+XaO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EmDI/IRJNAxyvxKT0KIjJs1KXjx351sBPMJ/V5lBnrsu4hvfcAJlLZbMDbfPX2Odj PttH0qUZbXdcAKWEt5Yix8lix2WrzLJWktwA0A7ytcG+FywraIgMeB2yZeU7L2qvpF rsG01aOBn+BoiZK0Lu8B/52iz0bYzqm8PqThcjDM= 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.10 195/221] Revert "netfilter: x_tables: Update remaining dereference to RCU" Date: Mon, 29 Mar 2021 09:58:46 +0200 Message-Id: <20210329075635.629309677@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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 04a2010755a6..d1e04d2b5170 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -1379,7 +1379,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 a5b63f92b7f3..f15bc21d7301 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -1589,7 +1589,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 81c042940b21..2e2119bfcf13 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1598,7 +1598,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