netfilter: conntrack: fix error path in nf_conntrack_pernet_init()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 23 Jan 2019 20:58:57 +0000 (12:58 -0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 28 Jan 2019 10:32:55 +0000 (11:32 +0100)
commitac088a88b5d544b7b82f00214b1588b3c88a7fc6
tree376ec6e5c96065f354f2234e84fdf1f06dcf3c9d
parentdd03b1ad26c40195f410a4828fdac9c0b734c1ac
netfilter: conntrack: fix error path in nf_conntrack_pernet_init()

When nf_ct_netns_get() fails, it should clean up itself,
its caller doesn't need to call nf_conntrack_fini_net().

nf_conntrack_init_net() is called after registering sysctl
and proc, so its cleanup function should be called before
unregistering sysctl and proc.

Fixes: ba3fbe663635 ("netfilter: nf_conntrack: provide modparam to always register conntrack hooks")
Fixes: b884fa461776 ("netfilter: conntrack: unify sysctl handling")
Reported-and-tested-by: syzbot+fcee88b2d87f0539dfe9@syzkaller.appspotmail.com
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_standalone.c