]> git.baikalelectronics.ru Git - kernel.git/commitdiff
netfilter: nf_tables: allow to fetch set elements when table has an owner
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 8 Feb 2023 10:34:27 +0000 (11:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:22 +0000 (13:55 +0100)
[ Upstream commit bdd5c691802bafd564efe1296367a46c0d273814 ]

NFT_MSG_GETSETELEM returns -EPERM when fetching set elements that belong
to table that has an owner. This results in empty set/map listing from
userspace.

Fixes: 10e0d9638f20 ("netfilter: nftables: introduce table ownership")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_tables_api.c

index dca5352bdf3d78e3708d80018fdd4741fd26076b..1a9d759d0a02667e231229f2667193cbcdfb9e8f 100644 (file)
@@ -5439,7 +5439,7 @@ static int nf_tables_getsetelem(struct sk_buff *skb,
        int rem, err = 0;
 
        table = nft_table_lookup(net, nla[NFTA_SET_ELEM_LIST_TABLE], family,
-                                genmask, NETLINK_CB(skb).portid);
+                                genmask, 0);
        if (IS_ERR(table)) {
                NL_SET_BAD_ATTR(extack, nla[NFTA_SET_ELEM_LIST_TABLE]);
                return PTR_ERR(table);