• F
    netfilter: nf_tables: fix module unload race · 71ad00c5
    Florian Westphal 提交于
    We must first remove the nfnetlink protocol handler when nf_tables module
    is unloaded -- we don't want userspace to submit new change requests once
    we've started to tear down nft state.
    
    Furthermore, nfnetlink must not call any subsystem function after
    call_batch returned -EAGAIN.
    
    EAGAIN means the subsys mutex was dropped, so its unlikely but possible that
    nf_tables subsystem was removed due to 'rmmod nf_tables' on another cpu.
    
    Therefore, we must abort batch completely and not move on to next part of
    the batch.
    
    Last, we can't invoke ->abort unless we've checked that the subsystem is
    still registered.
    
    Change netns exit path of nf_tables to make sure any incompleted
    transaction gets removed on exit.
    Signed-off-by: NFlorian Westphal <fw@strlen.de>
    Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
    71ad00c5
nfnetlink.c 15.1 KB