Patch "Fix handling of verdicts after NF_QUEUE" has been added to the 4.9-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

    Fix handling of verdicts after NF_QUEUE

to the 4.9-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:
     fix-handling-of-verdicts-after-nf_queue.patch
and it can be found in the queue-4.9 subdirectory.

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


>From dbanerje@xxxxxxxxxx  Thu Dec 14 18:38:57 2017
From: Debabrata Banerjee <dbanerje@xxxxxxxxxx>
Date: Wed, 13 Dec 2017 15:33:37 -0500
Subject: Fix handling of verdicts after NF_QUEUE
To: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>, netfilter-devel@xxxxxxxxxxxxxxx, coreteam@xxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, stable@xxxxxxxxxxxxxxx, dbanerje@xxxxxxxxxx
Message-ID: <20171213203337.314-1-dbanerje@xxxxxxxxxx>

From: Debabrata Banerjee <dbanerje@xxxxxxxxxx>

[This fix is only needed for v4.9 stable since v4.10+ does not have the issue]

A verdict of NF_STOLEN after NF_QUEUE will cause an incorrect return value
and a potential kernel panic via double free of skb's

This was broken by commit 7034b566a4e7 ("netfilter: fix nf_queue handling")
and subsequently fixed in v4.10 by commit c63cbc460419 ("netfilter:
use switch() to handle verdict cases from nf_hook_slow()"). However that
commit cannot be cleanly cherry-picked to v4.9

Signed-off-by: Debabrata Banerjee <dbanerje@xxxxxxxxxx>
Acked-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>

---
 net/netfilter/core.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -364,6 +364,11 @@ next_hook:
 		ret = nf_queue(skb, state, &entry, verdict);
 		if (ret == 1 && entry)
 			goto next_hook;
+	} else {
+		/* Implicit handling for NF_STOLEN, as well as any other
+		 * non conventional verdicts.
+		 */
+		ret = 0;
 	}
 	return ret;
 }


Patches currently in stable-queue which might be from dbanerje@xxxxxxxxxx are

queue-4.9/fix-handling-of-verdicts-after-nf_queue.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]