[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171215092258.755929284@linuxfoundation.org>
Date: Fri, 15 Dec 2017 10:51:59 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org,
Pablo Neira Ayuso <pablo@...filter.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Debabrata Banerjee <dbanerje@...mai.com>
Subject: [PATCH 4.9 16/27] Fix handling of verdicts after NF_QUEUE
4.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Debabrata Banerjee <dbanerje@...mai.com>
[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@...mai.com>
Acked-by: Pablo Neira Ayuso <pablo@...filter.org>
---
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;
}
Powered by blists - more mailing lists