]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: conntrack: avoid use-after free on rmmod
authorFlorian Westphal <fw@strlen.de>
Fri, 3 Aug 2018 16:40:21 +0000 (18:40 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 3 Aug 2018 19:15:13 +0000 (21:15 +0200)
commitc2b21a7b9d03a1f90a979ff867369b3424c9f95a
treefb0bd60a7277c8c0445e67c6a9a8d914d2c9f39f
parent18e376726c3d183bd94dae184daeffcf2ab37d60
netfilter: conntrack: avoid use-after free on rmmod

When the conntrack module is removed, we call nf_ct_iterate_destroy via
nf_ct_l4proto_unregister().

Problem is that nf_conntrack_proto_fini() gets called after the
conntrack hash table has already been freed.

Just remove the l4proto unregister call, its unecessary as the
nf_ct_protos[] array gets free'd right after anyway.

v2: add comment wrt. missing unreg call.

Fixes: aedd95f67167d6 ("netfilter: conntrack: remove l3proto abstraction")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_proto.c