Patch "netfilter: nf_tables: bogus ENOENT when destroying element which does not exist" has been added to the 6.5-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: bogus ENOENT when destroying element which does not exist

to the 6.5-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-bogus-enoent-when-destroying-ele.patch
and it can be found in the queue-6.5 subdirectory.

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



commit 624364678b6d30a15efac83a5a682e75ab93d483
Author: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Date:   Mon Nov 13 20:34:56 2023 +0100

    netfilter: nf_tables: bogus ENOENT when destroying element which does not exist
    
    [ Upstream commit a7d5a955bfa854ac6b0c53aaf933394b4e6139e4 ]
    
    destroy element command bogusly reports ENOENT in case a set element
    does not exist. ENOENT errors are skipped, however, err is still set
    and propagated to userspace.
    
     # nft destroy element ip raw BLACKLIST { 1.2.3.4 }
     Error: Could not process rule: No such file or directory
     destroy element ip raw BLACKLIST { 1.2.3.4 }
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    Fixes: f80a612dd77c ("netfilter: nf_tables: add support to destroy operation")
    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 8776266ba1532..398a1bcc6ea61 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -7202,10 +7202,11 @@ static int nf_tables_delsetelem(struct sk_buff *skb,
 
 		if (err < 0) {
 			NL_SET_BAD_ATTR(extack, attr);
-			break;
+			return err;
 		}
 	}
-	return err;
+
+	return 0;
 }
 
 /*



[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