mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
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: syzbot+5c06e318fc558cc27823@syzkaller.appspotmail.com Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
2f99aa31cd
commit
a4995684a9
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue