* Re: [PATCH NETFILTER] netfilter: gre: nf_ct_gre_keymap_flush() removal
[not found] <cb5dbf85-302d-386d-7b57-b043063cea06@virtuozzo.com>
@ 2021-06-30 9:54 ` Florian Westphal
0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2021-06-30 9:54 UTC (permalink / raw)
To: Vasily Averin
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
netfilter-devel, coreteam, linux-kernel
Vasily Averin <vvs@virtuozzo.com> wrote:
> nf_ct_gre_keymap_flush() is useless.
> It is called from nf_conntrack_cleanup_net_list() only and tries to remove
> nf_ct_gre_keymap entries from pernet gre keymap list. Though:
> a) at this point the list should already be empty, all its entries were
> deleted during the conntracks cleanup, because
> nf_conntrack_cleanup_net_list() executes nf_ct_iterate_cleanup(kill_all)
> before nf_conntrack_proto_pernet_fini():
> nf_conntrack_cleanup_net_list
> +- nf_ct_iterate_cleanup
> | nf_ct_put
> | nf_conntrack_put
> | nf_conntrack_destroy
> | destroy_conntrack
> | destroy_gre_conntrack
> | nf_ct_gre_keymap_destroy
> `- nf_conntrack_proto_pernet_fini
> nf_ct_gre_keymap_flush
>
> b) Let's say we find that the keymap list is not empty. This means netns
> still has a conntrack associated with gre, in which case we should not free
> its memory, because this will lead to a double free and related crashes.
> However I doubt it could have gone unnoticed for years, obviously
> this does not happen in real life. So I think we can remove
> both nf_ct_gre_keymap_flush() and nf_conntrack_proto_pernet_fini().
Acked-by: Florian Westphal <fw@strlen.de>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-30 9:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <cb5dbf85-302d-386d-7b57-b043063cea06@virtuozzo.com>
2021-06-30 9:54 ` [PATCH NETFILTER] netfilter: gre: nf_ct_gre_keymap_flush() removal Florian Westphal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).