netfilter: add list element test to br_netfilter_hooks
Subsystems (3)
PATCH 1/1 netfilter: add list element test to br_netfilter_hooks
The for-loop in the bridge hook entries assumes that the elements are always present. However, this assumption may not always be true.
Fixes 66cfc1dd07c7 ("netfilter: convert while loops to for loops")
Signed-off-by Aaron Conole <[email protected]>
--
Pablo, if possible could this be squashed into the commit instead? I only did a build test of this, but it should be correct.
net/bridge/br_netfilter_hooks.c +1 -1
@@ -1009,7 +1009,7 @@ int br_nf_hook_thresh(unsigned int hook, struct net *net,int ret;for (elem =rcu_dereference (net->nf.hooks[NFPROTO_BRIDGE ][hook]); -nf_hook_entry_priority (elem) <=NF_BR_PRI_BRNF ; + elem &&nf_hook_entry_priority (elem) <=NF_BR_PRI_BRNF ; elem =rcu_dereference (elem->next)) ;
--
2.5.0