Skip to content

Commit

Permalink
netfilter: nf_tables: skip netlink portID validation if zero
Browse files Browse the repository at this point in the history
[ Upstream commit 5347990 ]

nft_table_lookup() allows us to obtain the table object by the name and
the family. The netlink portID validation needs to be skipped for the
dump path, since the ownership only applies to commands to update the
given table. Skip validation if the specified netlink PortID is zero
when calling nft_table_lookup().

Fixes: 6001a93 ("netfilter: nftables: introduce table ownership")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ummakynes authored and gregkh committed Jul 14, 2021
1 parent 64811dd commit 5085187
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ static struct nft_table *nft_table_lookup(const struct net *net,
table->family == family &&
nft_active_genmask(table, genmask)) {
if (nft_table_has_owner(table) &&
table->nlpid != nlpid)
nlpid && table->nlpid != nlpid)
return ERR_PTR(-EPERM);

return table;
Expand Down

0 comments on commit 5085187

Please sign in to comment.