Patch "netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     netfilter-nf_tables-relax-nfta_set_elem_key_end-set-.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 64b8f0353c2fa874adbc023a3c2a25467f060825
Author: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Date:   Mon Oct 17 14:12:58 2022 +0200

    netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements
    
    [ Upstream commit 96df8360dbb435cc69f7c3c8db44bf8b1c24cd7b ]
    
    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: 88cccd908d51 ("netfilter: nf_tables: NFTA_SET_ELEM_KEY_END requires concat and interval flags")
    Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 63c70141b3e5..5897afd12466 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5865,8 +5865,9 @@ static bool nft_setelem_valid_key_end(const struct nft_set *set,
 			  (NFT_SET_CONCAT | NFT_SET_INTERVAL)) {
 		if (flags & NFT_SET_ELEM_INTERVAL_END)
 			return false;
-		if (!nla[NFTA_SET_ELEM_KEY_END] &&
-		    !(flags & NFT_SET_ELEM_CATCHALL))
+
+		if (nla[NFTA_SET_ELEM_KEY_END] &&
+		    flags & NFT_SET_ELEM_CATCHALL)
 			return false;
 	} else {
 		if (nla[NFTA_SET_ELEM_KEY_END])



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux