Jesper Dangaard Brouer e1b207dac1 netfilter: avoid race with exp->master ct
Preparation for disconnecting the nf_conntrack_lock from the
expectations code.  Once the nf_conntrack_lock is lifted, a race
condition is exposed.

The expectations master conntrack exp->master, can race with
delete operations, as the refcnt increment happens too late in
init_conntrack().  Race is against other CPUs invoking
->destroy() (destroy_conntrack()), or nf_ct_delete() (via timeout
or early_drop()).

Avoid this race in nf_ct_find_expectation() by using atomic_inc_not_zero(),
and checking if nf_ct_is_dying() (path via nf_ct_delete()).

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2014-03-07 11:40:47 +01:00
..
2014-01-30 16:48:17 -08:00
2014-02-13 18:33:38 -05:00
2014-02-16 23:45:00 -05:00
2014-01-21 18:13:05 -08:00
2014-02-18 18:14:09 -05:00
2014-02-19 11:41:25 +01:00
2014-02-12 19:26:32 -05:00
2014-02-13 18:33:38 -05:00
2013-09-23 16:52:45 -04:00
2013-10-19 19:36:19 -04:00
2014-01-28 18:04:18 -08:00
2013-11-21 13:09:42 -05:00
2014-02-13 18:33:38 -05:00
2014-02-13 18:15:10 -05:00