summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDebabrata Banerjee <dbanerje@akamai.com>2017-12-13 15:33:37 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-16 16:25:46 +0100
commit0cab694ab7bca62eb42dbfae209c08edc8d229c4 (patch)
tree01646943cccecf4c3ca48167da871276ddfa23ac /net
parentcf00fd3d526cdabaf558e911d71d0a2c303cf0e7 (diff)
downloadlinux-stable-0cab694ab7bca62eb42dbfae209c08edc8d229c4.tar.gz
linux-stable-0cab694ab7bca62eb42dbfae209c08edc8d229c4.tar.bz2
linux-stable-0cab694ab7bca62eb42dbfae209c08edc8d229c4.zip
Fix handling of verdicts after NF_QUEUE
[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@akamai.com> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 004af030ef1a..d869ea50623e 100644
--- 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;
}