stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Pablo Neira Ayuso <pablo@netfilter.org>,
	Patrick McHardy <kaber@trash.net>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	"David S. Miller" <davem@davemloft.net>,
	Andrey Vagin <avagin@openvz.org>
Subject: [PATCH 3.4 4/9] netfilter: nf_conntrack: reserve two bytes for nf_ct_ext->len
Date: Fri, 16 May 2014 15:55:27 -0700	[thread overview]
Message-ID: <20140516225458.777837218@linuxfoundation.org> (raw)
In-Reply-To: <20140516225458.512693003@linuxfoundation.org>

3.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrey Vagin <avagin@openvz.org>

commit 223b02d923ecd7c84cf9780bb3686f455d279279 upstream.

"len" contains sizeof(nf_ct_ext) and size of extensions. In a worst
case it can contain all extensions. Bellow you can find sizes for all
types of extensions. Their sum is definitely bigger than 256.

nf_ct_ext_types[0]->len = 24
nf_ct_ext_types[1]->len = 32
nf_ct_ext_types[2]->len = 24
nf_ct_ext_types[3]->len = 32
nf_ct_ext_types[4]->len = 152
nf_ct_ext_types[5]->len = 2
nf_ct_ext_types[6]->len = 16
nf_ct_ext_types[7]->len = 8

I have seen "len" up to 280 and my host has crashes w/o this patch.

The right way to fix this problem is reducing the size of the ecache
extension (4) and Florian is going to do this, but these changes will
be quite large to be appropriate for a stable tree.

Fixes: 5b423f6a40a0 (netfilter: nf_conntrack: fix racy timer handling with reliable)
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/net/netfilter/nf_conntrack_extend.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -37,8 +37,8 @@ enum nf_ct_ext_id {
 /* Extensions: optional stuff which isn't permanently in struct. */
 struct nf_ct_ext {
 	struct rcu_head rcu;
-	u8 offset[NF_CT_EXT_NUM];
-	u8 len;
+	u16 offset[NF_CT_EXT_NUM];
+	u16 len;
 	char data[0];
 };
 



  parent reply	other threads:[~2014-05-16 22:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16 22:55 [PATCH 3.4 0/9] 3.4.91-stable review Greg Kroah-Hartman
2014-05-16 22:55 ` [PATCH 3.4 1/9] SCSI: megaraid: missing bounds check in mimd_to_kioc() Greg Kroah-Hartman
2014-05-16 22:55 ` [PATCH 3.4 2/9] n_tty: Fix n_tty_write crash when echoing in raw mode Greg Kroah-Hartman
2014-05-16 22:55 ` [PATCH 3.4 3/9] blktrace: fix accounting of partially completed requests Greg Kroah-Hartman
2014-05-16 22:55 ` Greg Kroah-Hartman [this message]
2014-05-16 22:55 ` [PATCH 3.4 5/9] net: Add net_ratelimited_function and net_<level>_ratelimited macros Greg Kroah-Hartman
2014-05-16 22:55 ` [PATCH 3.4 6/9] netfilter: Cant fail and free after table replacement Greg Kroah-Hartman
2014-05-16 22:55 ` [PATCH 3.4 7/9] tracepoint: Do not waste memory on mods with no tracepoints Greg Kroah-Hartman
2014-05-16 22:55 ` [PATCH 3.4 8/9] powerpc: Add vr save/restore functions Greg Kroah-Hartman
2014-05-16 22:55 ` [PATCH 3.4 9/9] tgafb: fix mode setting with fbset Greg Kroah-Hartman
2014-05-17 15:44 ` [PATCH 3.4 0/9] 3.4.91-stable review Guenter Roeck
2014-05-17 17:25   ` Greg Kroah-Hartman
2014-05-18 10:09   ` Satoru Takeuchi
2014-05-18 12:23     ` Greg Kroah-Hartman

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=20140516225458.777837218@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=avagin@openvz.org \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pablo@netfilter.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).