linux/include
Vasily Averin a23f89a999 netfilter: conntrack: nf_ct_gre_keymap_flush() removal
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().

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2021-07-02 02:07:01 +02:00
..
acpi Device properties framework updates for 5.14-rc1 2021-06-29 14:04:37 -07:00
asm-generic Networking changes for 5.14. 2021-06-30 15:51:09 -07:00
clocksource
crypto crypto: api - Move crypto attr definitions out of crypto.h 2021-06-24 14:51:35 +08:00
drm
dt-bindings
keys
kunit kunit: make test->lock irq safe 2021-06-29 10:53:46 -07:00
kvm
linux ptp: add kernel API ptp_convert_timestamp() 2021-07-01 13:08:18 -07:00
math-emu
media media: Fix Media Controller API config checks 2021-06-24 14:26:00 +02:00
memory
misc
net netfilter: conntrack: nf_ct_gre_keymap_flush() removal 2021-07-02 02:07:01 +02:00
pcmcia
ras
rdma
scsi
soc mbox: add polarfire soc system controller mailbox 2021-06-26 12:06:48 -05:00
sound
target
trace Networking changes for 5.14. 2021-06-30 15:51:09 -07:00
uapi net: sock: extend SO_TIMESTAMPING for PHC binding 2021-07-01 13:08:18 -07:00
vdso
video
xen