Skip to content

Commit 223b02d

Browse files
avaginummakynes
authored andcommitted
netfilter: nf_conntrack: reserve two bytes for nf_ct_ext->len
"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: 5b423f6 (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>
1 parent b8ddd9e commit 223b02d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/net/netfilter/nf_conntrack_extend.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ enum nf_ct_ext_id {
4747
/* Extensions: optional stuff which isn't permanently in struct. */
4848
struct nf_ct_ext {
4949
struct rcu_head rcu;
50-
u8 offset[NF_CT_EXT_NUM];
51-
u8 len;
50+
u16 offset[NF_CT_EXT_NUM];
51+
u16 len;
5252
char data[0];
5353
};
5454

0 commit comments

Comments
 (0)