Patch "netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM" has been added to the 6.1-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: nfnetlink: skip error delivery on batch in case of ENOMEM

to the 6.1-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-nfnetlink-skip-error-delivery-on-batch-in-.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 127943de4f640e3896a4226f996253520ce09a05
Author: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Date:   Thu Jun 8 00:19:12 2023 +0200

    netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM
    
    [ Upstream commit a1a64a151dae8ac3581c1cbde44b672045cb658b ]
    
    If caller reports ENOMEM, then stop iterating over the batch and send a
    single netlink message to userspace to report OOM.
    
    Fixes: cbb8125eb40b ("netfilter: nfnetlink: deliver netlink errors on batch completion")
    Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index ae7146475d17a..c9fbe0f707b5f 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -533,7 +533,8 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
 			 * processed, this avoids that the same error is
 			 * reported several times when replaying the batch.
 			 */
-			if (nfnl_err_add(&err_list, nlh, err, &extack) < 0) {
+			if (err == -ENOMEM ||
+			    nfnl_err_add(&err_list, nlh, err, &extack) < 0) {
 				/* We failed to enqueue an error, reset the
 				 * list of errors and send OOM to userspace
 				 * pointing to the batch header.



[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