]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
netfilter: x_tables: Update remaining dereference to RCU
authorSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Thu, 17 Dec 2020 04:38:02 +0000 (21:38 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 19 Feb 2021 15:44:05 +0000 (16:44 +0100)
BugLink: https://bugs.launchpad.net/bugs/1913486
commit 443d6e86f821a165fae3fc3fc13086d27ac140b1 upstream.

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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c

index eaff8c772056b27f254505210d6bfcdfe5057ad3..8394afcb2c8fbb9ac99f9d58098760510f032b15 100644 (file)
@@ -1423,7 +1423,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);
index 77643a0c4c87898a34e910ac3b4b0faf3afd05a9..62db6153216343ee906edba167b8883586bcd672 100644 (file)
@@ -1633,7 +1633,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)
index 5422a1660e3d6a91fbcc40e17dd684c37dfcd963..30eb8307582f9ffe0c458b153a557cd0ea396b2d 100644 (file)
@@ -1642,7 +1642,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)