Skip to content

Commit

Permalink
netfilter: nf_conntrack: fix early_drop with reliable event delivery
Browse files Browse the repository at this point in the history
If reliable event delivery is enabled and ctnetlink fails to deliver
the destroy event in early_drop, the conntrack subsystem cannot
drop any the candidate flow that was planned to be evicted.

Reported-by: Kerin Millar <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ummakynes authored and davem330 committed Mar 6, 2012
1 parent 739e450 commit 7413851
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions net/netfilter/nf_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,12 @@ static noinline int early_drop(struct net *net, unsigned int hash)

if (del_timer(&ct->timeout)) {
death_by_timeout((unsigned long)ct);
dropped = 1;
NF_CT_STAT_INC_ATOMIC(net, early_drop);
/* Check if we indeed killed this entry. Reliable event
delivery may have inserted it into the dying list. */
if (test_bit(IPS_DYING_BIT, &ct->status)) {
dropped = 1;
NF_CT_STAT_INC_ATOMIC(net, early_drop);
}
}
nf_ct_put(ct);
return dropped;
Expand Down

0 comments on commit 7413851

Please sign in to comment.