Skip to content

Commit a499568

Browse files
shemmingerummakynes
authored andcommitted
netfilter: bridge: 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]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 2f99aa3 commit a499568

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/bridge/netfilter/ebt_stp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
161161
/* Make sure the match only receives stp frames */
162162
if (!par->nft_compat &&
163163
(!ether_addr_equal(e->destmac, eth_stp_addr) ||
164-
!is_broadcast_ether_addr(e->destmsk) ||
165-
!(e->bitmask & EBT_DESTMAC)))
164+
!(e->bitmask & EBT_DESTMAC) ||
165+
!is_broadcast_ether_addr(e->destmsk)))
166166
return -EINVAL;
167167

168168
return 0;

0 commit comments

Comments
 (0)