Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2270002pxb; Mon, 11 Jan 2021 05:40:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbRGe5DkmCj2zjHOhAoVyWNRZLXh8cb0R/iDQQ3jvIF538hwrpVUuKoeuKNjgZdYSMKXdw X-Received: by 2002:aa7:c749:: with SMTP id c9mr14467039eds.3.1610372413764; Mon, 11 Jan 2021 05:40:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610372413; cv=none; d=google.com; s=arc-20160816; b=GQfM/UE+4Xr69gbHxzSQJ+h2bOAkL3bIfK6rnBchLVGiv3fy23IOGcqDikyjYNRiX/ ebnAxyAw7Qk+EjNnzAdCBfx/k6bjBacKZc47PaDP2rZnqYjv3wJXY5hnaIQTVC75uCH5 r7n0QMBTe8rwZyZpbL16uvXK7dchg6xXhSW8tD0bw2xeSipqLVUXPok+7kZjr+O4Upxw tlO1K7kM89CZPSNm5HYdsmn3P2q2aFKDVYH/6CZ+8un+nTPrloLX0SRf3iBmCOl6+hAn vWWW62oOGAV3krfUZYqjsjqw/jiABqCOgylvi3OjFxceoTTITEp1KQJbFK7lKwJBUKWH 1L2w== 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=QMPYSKLWKyydSroagvMXRcduMH7pS9TtHVmq2BwobYg=; b=JC7ZIqS+1mkC3TR0tIDA3TVq1ABgN9xD3o7wmN85c/KWQU/BZ735urQk44k/nur4je v4tZ3hG50/HS9D+NCxDQHQN0uYQOkiFB7i0jNBl0h8sYGBW+JOLBR9ZtNKoK24a551Gp H58/3NqU/DN3yLwXwoZcDLUbZU1lr71q+Yb+1KGtqK6uJeSdHoXwIMEGaG2+Sc5qgEZl CyaQ9xugTbrRRtdO5hG+OQjXoENaaARdniJfCnZRGHjXpzJNLKvGWeYhACB9VPAgn0oK Fdvl7aRr5MWZzUJz+WntTBCHdJSRqlneX9l8uCcVFjoJg8ktfwveYi2ex1c6oRanxUh6 +e5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H9ZzCy0L; 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 m16si6371454ejj.44.2021.01.11.05.39.49; Mon, 11 Jan 2021 05:40:13 -0800 (PST) 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=H9ZzCy0L; 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 S1733058AbhAKNhL (ORCPT + 99 others); Mon, 11 Jan 2021 08:37:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:60390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726890AbhAKNN0 (ORCPT ); Mon, 11 Jan 2021 08:13:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B901621534; Mon, 11 Jan 2021 13:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370765; bh=3yp5qsA3SEx3Gj+bzyrpvCgVBvhwQdMDTMprdwZU3Wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H9ZzCy0LrzaBZa+cZQVY0ht+OukTgUOqnjrtCw1L6+fF/4SsxZxDKFln9wNmq8djQ DvemY0WDwSnFtpLENxD7/eCLeMr3XVghoNOFfaaPxfHgfgmVI/kem+xNjtHzHlE8y7 jnd5hZuYBNTrv73u7nElcxYz8eFmRPFszQ3kZow0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Subash Abhinov Kasiviswanathan , Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 5.4 87/92] netfilter: x_tables: Update remaining dereference to RCU Date: Mon, 11 Jan 2021 14:02:31 +0100 Message-Id: <20210111130043.351425234@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@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: Subash Abhinov Kasiviswanathan commit 443d6e86f821a165fae3fc3fc13086d27ac140b1 upstream. This fixes the dereference to fetch the RCU pointer when holding the appropriate xtables lock. Reported-by: kernel test robot Fixes: cc00bcaa5899 ("netfilter: x_tables: Switch synchronization to RCU") Signed-off-by: Subash Abhinov Kasiviswanathan Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- 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(-) --- 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 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 = t->private; + const struct xt_table_info *private = xt_table_get_private_protected(t); struct xt_table_info info; ret = compat_table_info(private, &info); --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -1616,7 +1616,7 @@ compat_get_entries(struct net *net, stru 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 = t->private; + const struct xt_table_info *private = xt_table_get_private_protected(t); struct xt_table_info info; ret = compat_table_info(private, &info); if (!ret && get.size == info.size) --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -1625,7 +1625,7 @@ compat_get_entries(struct net *net, stru 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 = t->private; + const struct xt_table_info *private = xt_table_get_private_protected(t); struct xt_table_info info; ret = compat_table_info(private, &info); if (!ret && get.size == info.size)