netfilter: ipset: pernet ops must be unregistered last
commite23ed762db7ed1950a6408c3be80bc56909ab3d4
authorFlorian Westphal <fw@strlen.de>
Tue, 26 Sep 2017 09:57:54 +0000 (26 11:57 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 26 Sep 2017 18:15:17 +0000 (26 20:15 +0200)
tree1cb49a23e81377df67a3909cf45d139c7a197b82
parent48596a8ddc46f96afb6a2cd72787cb15d6bb01fc
netfilter: ipset: pernet ops must be unregistered last

Removing the ipset module leaves a small window where one cpu performs
module removal while another runs a command like 'ipset flush'.

ipset uses net_generic(), unregistering the pernet ops frees this
storage area.

Fix it by first removing the user-visible api handlers and the pernet
ops last.

Fixes: 1785e8f473082 ("netfiler: ipset: Add net namespace for ipset")
Reported-by: Li Shuang <shuali@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_core.c