bridge: netfilter stp fix reference to uninitialized data
Subsystems (4)
PATCH 1/1 bridge: netfilter stp fix reference to uninitialized data
The destination mac (destmac) is only valid if EBT_DESTMAC flag is set. Fix by changing the order of the comparison to look for the flag first.
Reported-by [email protected]
Signed-off-by Stephen Hemminger <[email protected]>
---
Note: no fixes since this bug goes back to pre-git days. Should go to stable as well.
net/bridge/netfilter/ebt_stp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bridge/netfilter/ebt_stp.c +2 -2
@@ -161,8 +161,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par)/* Make sure the match only receives stp frames */ if (!par->nft_compat && (!ether_addr_equal (e->destmac, eth_stp_addr) || - !is_broadcast_ether_addr (e->destmsk) || - !(e->bitmask &EBT_DESTMAC ))) + !(e->bitmask &EBT_DESTMAC ) || + !is_broadcast_ether_addr (e->destmsk)))return -EINVAL ;return 0 ;
Signature · 1 line
2.17.0
Quoted 3 lines · Stephen Hemminger
The destination mac (destmac) is only valid if
EBT_DESTMACflag is set. Fix by changing the order of the comparison to look for the flag first.
Applied, thanks Stephen.