stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: dbanerje@akamai.com, davem@davemloft.net,
	gregkh@linuxfoundation.org, pablo@netfilter.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "Fix handling of verdicts after NF_QUEUE" has been added to the 4.9-stable tree
Date: Thu, 14 Dec 2017 18:43:04 +0100	[thread overview]
Message-ID: <151327338481192@kroah.com> (raw)
In-Reply-To: <20171213203337.314-1-dbanerje@akamai.com>


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@vger.kernel.org> know about it.


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

From: Debabrata Banerjee <dbanerje@akamai.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@akamai.com>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.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;
 }


Patches currently in stable-queue which might be from dbanerje@akamai.com are

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

      parent reply	other threads:[~2017-12-14 17:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 20:33 [PATCH] Fix handling of verdicts after NF_QUEUE Debabrata Banerjee
2017-12-14 12:30 ` Pablo Neira Ayuso
2017-12-14 17:39   ` Greg Kroah-Hartman
2017-12-14 17:43 ` gregkh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151327338481192@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=dbanerje@akamai.com \
    --cc=pablo@netfilter.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).