]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: cttimeout: unlink timeout obj again when hash resize happen
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sun, 3 Jul 2016 05:18:44 +0000 (13:18 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 11 Jul 2016 09:39:08 +0000 (11:39 +0200)
commite8b6189e1104e99a47d1f99a179aff355f5b8de5
tree06b92dc5efae3320479d1aefa02fd022733d6904
parentdbea16170939e3c89200d2351201f8e291bcb673
netfilter: cttimeout: unlink timeout obj again when hash resize happen

Imagine such situation, nf_conntrack_htable_size now is 4096, we are doing
ctnl_untimeout, and iterate on 3000# bucket.

Meanwhile, another user try to reduce hash size to 2048, then all nf_conn
are removed to the new hashtable. When this hash resize operation finished,
we still try to itreate ct begin from 3000# bucket, find nothing to do and
just return.

We may miss unlinking some timeout objects. And later we will end up with
invalid references to timeout object that are already gone.

So when we find that hash resize happened, try to unlink timeout objects
from the 0# bucket again.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink_cttimeout.c