Skip to content

Commit 96df836

Browse files
committed
netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements
Otherwise EINVAL is bogusly reported to userspace when deleting a set element. NFTA_SET_ELEM_KEY_END does not need to be set in case of: - insertion: if not present, start key is used as end key. - deletion: only start key needs to be specified, end key is ignored. Hence, relax the sanity check. Fixes: 88cccd9 ("netfilter: nf_tables: NFTA_SET_ELEM_KEY_END requires concat and interval flags") Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 1fcc064 commit 96df836

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5865,8 +5865,9 @@ static bool nft_setelem_valid_key_end(const struct nft_set *set,
58655865
(NFT_SET_CONCAT | NFT_SET_INTERVAL)) {
58665866
if (flags & NFT_SET_ELEM_INTERVAL_END)
58675867
return false;
5868-
if (!nla[NFTA_SET_ELEM_KEY_END] &&
5869-
!(flags & NFT_SET_ELEM_CATCHALL))
5868+
5869+
if (nla[NFTA_SET_ELEM_KEY_END] &&
5870+
flags & NFT_SET_ELEM_CATCHALL)
58705871
return false;
58715872
} else {
58725873
if (nla[NFTA_SET_ELEM_KEY_END])

0 commit comments

Comments
 (0)