All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf] netfilter: x_tables: Update remaining dereference to RCU
@ 2020-12-17  4:38 Subash Abhinov Kasiviswanathan
  2020-12-17 11:37 ` Florian Westphal
  2020-12-17 18:43 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 3+ messages in thread
From: Subash Abhinov Kasiviswanathan @ 2020-12-17  4:38 UTC (permalink / raw)
  To: fw, lkp, pablo, netfilter-devel, stranche; +Cc: Subash Abhinov Kasiviswanathan

This fixes the dereference to fetch the RCU pointer when holding
the appropriate xtables lock.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: cc00bcaa5899 ("netfilter: x_tables: Switch synchronization to RCU")
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
 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 563b62b..c576a63 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 = 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);
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 6e2851f..e8f6f9d 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 = 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)
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index c4f532f..0d453fa 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 = 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)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH nf] netfilter: x_tables: Update remaining dereference to RCU
  2020-12-17  4:38 [PATCH nf] netfilter: x_tables: Update remaining dereference to RCU Subash Abhinov Kasiviswanathan
@ 2020-12-17 11:37 ` Florian Westphal
  2020-12-17 18:43 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2020-12-17 11:37 UTC (permalink / raw)
  To: Subash Abhinov Kasiviswanathan; +Cc: fw, lkp, pablo, netfilter-devel, stranche

Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> wrote:
> This fixes the dereference to fetch the RCU pointer when holding
> the appropriate xtables lock.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: cc00bcaa5899 ("netfilter: x_tables: Switch synchronization to RCU")
> Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>

Reviewed-by: Florian Westphal <fw@strlen.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH nf] netfilter: x_tables: Update remaining dereference to RCU
  2020-12-17  4:38 [PATCH nf] netfilter: x_tables: Update remaining dereference to RCU Subash Abhinov Kasiviswanathan
  2020-12-17 11:37 ` Florian Westphal
@ 2020-12-17 18:43 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2020-12-17 18:43 UTC (permalink / raw)
  To: Subash Abhinov Kasiviswanathan; +Cc: fw, lkp, netfilter-devel, stranche

On Wed, Dec 16, 2020 at 09:38:02PM -0700, Subash Abhinov Kasiviswanathan wrote:
> This fixes the dereference to fetch the RCU pointer when holding
> the appropriate xtables lock.

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-17 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  4:38 [PATCH nf] netfilter: x_tables: Update remaining dereference to RCU Subash Abhinov Kasiviswanathan
2020-12-17 11:37 ` Florian Westphal
2020-12-17 18:43 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.