• Liping Zhang's avatar
    netfilter: cttimeout: unlink timeout obj again when hash resize happen · 474803d3
    Liping Zhang authored
    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: default avatarLiping Zhang <liping.zhang@spreadtrum.com>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    474803d3
nfnetlink_cttimeout.c 15.9 KB