netfilter: ebtables: fix race condition in frame_filter_net_init()
authorArtem Savkov <asavkov@redhat.com>
Tue, 26 Sep 2017 16:35:45 +0000 (18:35 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 29 Sep 2017 11:36:06 +0000 (13:36 +0200)
commite6b72ee88a56bcfe63f72e9c30766484c45bec72
tree6b3cafcc56342070fa0da916ddbb9672138411f1
parent0d18779be13766b33c69cbc26df38383598da373
netfilter: ebtables: fix race condition in frame_filter_net_init()

It is possible for ebt_in_hook to be triggered before ebt_table is assigned
resulting in a NULL-pointer dereference. Make sure hooks are
registered as the last step.

Fixes: aee12a0a3727 ("ebtables: remove nf_hook_register usage")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter_bridge/ebtables.h
net/bridge/netfilter/ebtable_broute.c
net/bridge/netfilter/ebtable_filter.c
net/bridge/netfilter/ebtable_nat.c
net/bridge/netfilter/ebtables.c