diff options
author | Patrick McHardy <kaber@trash.net> | 2008-04-14 11:15:51 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-04-14 11:15:51 +0200 |
commit | 55871d04793d9c069ee277b1e98794b88d92ed80 (patch) | |
tree | 7e06b1ae438b45e9d5b5da8146ba197222d875f4 /net/netfilter | |
parent | 8c87238b726e543f8af4bdb4296020a328df4744 (diff) | |
download | kernel_samsung_smdk4412-55871d04793d9c069ee277b1e98794b88d92ed80.zip kernel_samsung_smdk4412-55871d04793d9c069ee277b1e98794b88d92ed80.tar.gz kernel_samsung_smdk4412-55871d04793d9c069ee277b1e98794b88d92ed80.tar.bz2 |
[NETFILTER]: nf_conntrack_extend: warn on confirmed conntracks
New extensions may only be added to unconfirmed conntracks to avoid races
when reallocating the storage.
Also change NF_CT_ASSERT to use WARN_ON to get backtraces.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_extend.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c index 2bd9963..bcc19fa 100644 --- a/net/netfilter/nf_conntrack_extend.c +++ b/net/netfilter/nf_conntrack_extend.c @@ -71,6 +71,9 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp) int i, newlen, newoff; struct nf_ct_ext_type *t; + /* Conntrack must not be confirmed to avoid races on reallocation. */ + NF_CT_ASSERT(!nf_ct_is_confirmed(ct)); + if (!ct->ext) return nf_ct_ext_create(&ct->ext, id, gfp); |