Skip to content

Commit 48bd0d6

Browse files
LeoBrasummakynes
authored andcommitted
netfilter: bridge: Drops IPv6 packets if IPv6 module is not loaded
A kernel panic can happen if a host has disabled IPv6 on boot and have to process guest packets (coming from a bridge) using it's ip6tables. IPv6 packets need to be dropped if the IPv6 module is not loaded, and the host ip6tables will be used. Signed-off-by: Leonardo Bras <[email protected]> Acked-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent e33b432 commit 48bd0d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/bridge/br_netfilter_hooks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,10 @@ static unsigned int br_nf_pre_routing(void *priv,
496496
if (!brnet->call_ip6tables &&
497497
!br_opt_get(br, BROPT_NF_CALL_IP6TABLES))
498498
return NF_ACCEPT;
499+
if (!ipv6_mod_enabled()) {
500+
pr_warn_once("Module ipv6 is disabled, so call_ip6tables is not supported.");
501+
return NF_DROP;
502+
}
499503

500504
nf_bridge_pull_encap_header_rcsum(skb);
501505
return br_nf_pre_routing_ipv6(priv, skb, state);

0 commit comments

Comments
 (0)