]> git.baikalelectronics.ru Git - kernel.git/commit
inet: frags: call inet_frags_fini() after unregister_pernet_subsys()
authorEric Dumazet <edumazet@google.com>
Mon, 27 May 2019 23:56:48 +0000 (16:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 May 2019 00:22:15 +0000 (17:22 -0700)
commit6121bd878b5ac02b0ce7fb8ea4e510a6a3b09862
tree9e0f7e4476b524263e403ff8be2acb6a9746cddb
parentc0d7a2d94edd7a4715be592cbb1f7c718d87255f
inet: frags: call inet_frags_fini() after unregister_pernet_subsys()

Both IPv6 and 6lowpan are calling inet_frags_fini() too soon.

inet_frags_fini() is dismantling a kmem_cache, that might be needed
later when unregister_pernet_subsys() eventually has to remove
frags queues from hash tables and free them.

This fixes potential use-after-free, and is a prereq for the following patch.

Fixes: fa791504aea9 ("inet: frags: use kmem_cache for inet_frag_queue")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/6lowpan/reassembly.c
net/ipv6/reassembly.c