* [PATCH net] bridge: netfilter stp fix reference to uninitialized data
@ 2018-04-27 18:16 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-04-27 18:16 UTC (permalink / raw)
To: pablo, kadlec, fw, davem
Cc: netfilter-devel, bridge, netdev, Stephen Hemminger, Stephen Hemminger
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>
---
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(-)
diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
index 47ba98db145d..46c1fe7637ea 100644
--- a/net/bridge/netfilter/ebt_stp.c
+++ b/net/bridge/netfilter/ebt_stp.c
@@ -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;
--
2.17.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Bridge] [PATCH net] bridge: netfilter stp fix reference to uninitialized data
@ 2018-04-27 18:16 ` Stephen Hemminger
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-04-27 18:16 UTC (permalink / raw)
To: pablo, kadlec, fw, davem
Cc: netdev, Stephen Hemminger, bridge, netfilter-devel
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>
---
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(-)
diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
index 47ba98db145d..46c1fe7637ea 100644
--- a/net/bridge/netfilter/ebt_stp.c
+++ b/net/bridge/netfilter/ebt_stp.c
@@ -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;
--
2.17.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] bridge: netfilter stp fix reference to uninitialized data
2018-04-27 18:16 ` [Bridge] " Stephen Hemminger
@ 2018-05-08 12:17 ` Pablo Neira Ayuso
-1 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2018-05-08 12:17 UTC (permalink / raw)
To: Stephen Hemminger
Cc: kadlec, fw, davem, netfilter-devel, bridge, netdev, Stephen Hemminger
On Fri, Apr 27, 2018 at 11:16:09AM -0700, Stephen Hemminger wrote:
> 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.
Applied, thanks Stephen.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bridge] [PATCH net] bridge: netfilter stp fix reference to uninitialized data
@ 2018-05-08 12:17 ` Pablo Neira Ayuso
0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2018-05-08 12:17 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Stephen Hemminger, netdev, bridge, fw, netfilter-devel, kadlec, davem
On Fri, Apr 27, 2018 at 11:16:09AM -0700, Stephen Hemminger wrote:
> 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.
Applied, thanks Stephen.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-08 12:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27 18:16 [PATCH net] bridge: netfilter stp fix reference to uninitialized data Stephen Hemminger
2018-04-27 18:16 ` [Bridge] " Stephen Hemminger
2018-05-08 12:17 ` Pablo Neira Ayuso
2018-05-08 12:17 ` [Bridge] " Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.