Skip to content

Commit 443d6e8

Browse files
Subash Abhinov Kasiviswanathanummakynes
authored andcommitted
netfilter: x_tables: Update remaining dereference to RCU
This fixes the dereference to fetch the RCU pointer when holding the appropriate xtables lock. Reported-by: kernel test robot <[email protected]> Fixes: cc00bca ("netfilter: x_tables: Switch synchronization to RCU") Signed-off-by: Subash Abhinov Kasiviswanathan <[email protected]> Reviewed-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 161b838 commit 443d6e8

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

net/ipv4/netfilter/arp_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ static int compat_get_entries(struct net *net,
13791379
xt_compat_lock(NFPROTO_ARP);
13801380
t = xt_find_table_lock(net, NFPROTO_ARP, get.name);
13811381
if (!IS_ERR(t)) {
1382-
const struct xt_table_info *private = t->private;
1382+
const struct xt_table_info *private = xt_table_get_private_protected(t);
13831383
struct xt_table_info info;
13841384

13851385
ret = compat_table_info(private, &info);

net/ipv4/netfilter/ip_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ compat_get_entries(struct net *net, struct compat_ipt_get_entries __user *uptr,
15891589
xt_compat_lock(AF_INET);
15901590
t = xt_find_table_lock(net, AF_INET, get.name);
15911591
if (!IS_ERR(t)) {
1592-
const struct xt_table_info *private = t->private;
1592+
const struct xt_table_info *private = xt_table_get_private_protected(t);
15931593
struct xt_table_info info;
15941594
ret = compat_table_info(private, &info);
15951595
if (!ret && get.size == info.size)

net/ipv6/netfilter/ip6_tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr,
15981598
xt_compat_lock(AF_INET6);
15991599
t = xt_find_table_lock(net, AF_INET6, get.name);
16001600
if (!IS_ERR(t)) {
1601-
const struct xt_table_info *private = t->private;
1601+
const struct xt_table_info *private = xt_table_get_private_protected(t);
16021602
struct xt_table_info info;
16031603
ret = compat_table_info(private, &info);
16041604
if (!ret && get.size == info.size)

0 commit comments

Comments
 (0)