From: Jiri Pirko <redacted>
When team is in bridge and LACP is utilized, LACPDU packets are pushed
to userspace using raw socket and there they are processed. However,
since 8626c56c8279b, LACPDU skbs are dropped by bridge rx_handler so
they never reach packet handlers in rx path. Fix this by explicity treat
LACPDUs to be pushed to exact delivery in team rx_handler.
Reported-by: Ido Schimmel <redacted>
Fixes: 8626c56c8279b ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Jiri Pirko <redacted>
---
drivers/net/team/team_mode_loadbalance.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -17,6 +17,19 @@#include<linux/filter.h>#include<linux/if_team.h>+staticrx_handler_result_tlb_receive(structteam*team,structteam_port*port,+structsk_buff*skb)+{+if(unlikely(skb->protocol==htons(ETH_P_SLOW))){+/* LACPDU packets should go to exact delivery */+constunsignedchar*dest=eth_hdr(skb)->h_dest;++if(is_link_local_ether_addr(dest)&&dest[5]==0x02)+returnRX_HANDLER_EXACT;+}+returnRX_HANDLER_ANOTHER;+}+structlb_priv;typedefstructteam_port*lb_select_tx_port_func_t(structteam*,
Thu, Aug 25, 2016 at 06:23:34PM CEST, jiri@resnulli.us wrote:
quoted hunk
From: Jiri Pirko <redacted>
When team is in bridge and LACP is utilized, LACPDU packets are pushed
to userspace using raw socket and there they are processed. However,
since 8626c56c8279b, LACPDU skbs are dropped by bridge rx_handler so
they never reach packet handlers in rx path. Fix this by explicity treat
LACPDUs to be pushed to exact delivery in team rx_handler.
Reported-by: Ido Schimmel <redacted>
Fixes: 8626c56c8279b ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Jiri Pirko <redacted>
---
drivers/net/team/team_mode_loadbalance.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Thu, Aug 25, 2016 at 06:37:35PM CEST, maheshb@google.com wrote:
On Thu, Aug 25, 2016 at 9:23 AM, Jiri Pirko [off-list ref] wrote:
quoted
From: Jiri Pirko <redacted>
When team is in bridge and LACP is utilized, LACPDU packets are pushed
to userspace using raw socket and there they are processed. However,
since 8626c56c8279b, LACPDU skbs are dropped by bridge rx_handler so
they never reach packet handlers in rx path. Fix this by explicity treat
LACPDUs to be pushed to exact delivery in team rx_handler.
Reported-by: Ido Schimmel <redacted>
Fixes: 8626c56c8279b ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Jiri Pirko <redacted>
---
drivers/net/team/team_mode_loadbalance.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -17,6 +17,19 @@#include<linux/filter.h>#include<linux/if_team.h>+staticrx_handler_result_tlb_receive(structteam*team,structteam_port*port,+structsk_buff*skb)+{+if(unlikely(skb->protocol==htons(ETH_P_SLOW))){+/* LACPDU packets should go to exact delivery */+constunsignedchar*dest=eth_hdr(skb)->h_dest;++if(is_link_local_ether_addr(dest)&&dest[5]==0x02)+returnRX_HANDLER_EXACT;
I believe every link-local-frame should get this treatment whether
it's 802.3ad or otherwise (e.g. LLDP etc.), no?
BTW same should be true for bonding too (of course except LACP since
it handles/consumes it!)
I think so as well, but stayed more conservative for this fix. LLDP case
is handled in bridge rx_handler though...
drivers/net/team/team_mode_loadbalance.c:27:7: error: implicit declaration of function 'is_link_local_ether_addr' [-Werror=implicit-function-declaration]
if (is_link_local_ether_addr(dest) && dest[5] == 0x02)
^
cc1: some warnings being treated as errors
vim +/is_link_local_ether_addr +27 drivers/net/team/team_mode_loadbalance.c
21 struct sk_buff *skb)
22 {
23 if (unlikely(skb->protocol == htons(ETH_P_SLOW))) {
24 /* LACPDU packets should go to exact delivery */
25 const unsigned char *dest = eth_hdr(skb)->h_dest;
26
> 27 if (is_link_local_ether_addr(dest) && dest[5] == 0x02)
28 return RX_HANDLER_EXACT;
29 }
30 return RX_HANDLER_ANOTHER;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
On Thu, Aug 25, 2016 at 9:46 AM, Jiri Pirko [off-list ref] wrote:
Thu, Aug 25, 2016 at 06:37:35PM CEST, maheshb@google.com wrote:
quoted
On Thu, Aug 25, 2016 at 9:23 AM, Jiri Pirko [off-list ref] wrote:
quoted
From: Jiri Pirko <redacted>
When team is in bridge and LACP is utilized, LACPDU packets are pushed
to userspace using raw socket and there they are processed. However,
since 8626c56c8279b, LACPDU skbs are dropped by bridge rx_handler so
they never reach packet handlers in rx path. Fix this by explicity treat
LACPDUs to be pushed to exact delivery in team rx_handler.
Reported-by: Ido Schimmel <redacted>
Fixes: 8626c56c8279b ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Jiri Pirko <redacted>
---
drivers/net/team/team_mode_loadbalance.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -17,6 +17,19 @@#include<linux/filter.h>#include<linux/if_team.h>+staticrx_handler_result_tlb_receive(structteam*team,structteam_port*port,+structsk_buff*skb)+{+if(unlikely(skb->protocol==htons(ETH_P_SLOW))){+/* LACPDU packets should go to exact delivery */+constunsignedchar*dest=eth_hdr(skb)->h_dest;++if(is_link_local_ether_addr(dest)&&dest[5]==0x02)+returnRX_HANDLER_EXACT;
I believe every link-local-frame should get this treatment whether
it's 802.3ad or otherwise (e.g. LLDP etc.), no?
BTW same should be true for bonding too (of course except LACP since
it handles/consumes it!)
I think so as well, but stayed more conservative for this fix. LLDP case
is handled in bridge rx_handler though...
bridge rx_handler when team is in bridge, otherwise these link-local
frames will be appear on master. So I guess it's a choice between
being conservative (and fix only LACP case as this fix does) or fix a
generic case.
On Thu, Aug 25, 2016 at 9:23 AM, Jiri Pirko [off-list ref] wrote:
quoted hunk
From: Jiri Pirko <redacted>
When team is in bridge and LACP is utilized, LACPDU packets are pushed
to userspace using raw socket and there they are processed. However,
since 8626c56c8279b, LACPDU skbs are dropped by bridge rx_handler so
they never reach packet handlers in rx path. Fix this by explicity treat
LACPDUs to be pushed to exact delivery in team rx_handler.
Reported-by: Ido Schimmel <redacted>
Fixes: 8626c56c8279b ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Jiri Pirko <redacted>
---
drivers/net/team/team_mode_loadbalance.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -17,6 +17,19 @@#include<linux/filter.h>#include<linux/if_team.h>+staticrx_handler_result_tlb_receive(structteam*team,structteam_port*port,+structsk_buff*skb)+{+if(unlikely(skb->protocol==htons(ETH_P_SLOW))){+/* LACPDU packets should go to exact delivery */+constunsignedchar*dest=eth_hdr(skb)->h_dest;++if(is_link_local_ether_addr(dest)&&dest[5]==0x02)+returnRX_HANDLER_EXACT;
I believe every link-local-frame should get this treatment whether
it's 802.3ad or otherwise (e.g. LLDP etc.), no?
BTW same should be true for bonding too (of course except LACP since
it handles/consumes it!)
Thu, Aug 25, 2016 at 07:35:27PM CEST, maheshb@google.com wrote:
On Thu, Aug 25, 2016 at 9:46 AM, Jiri Pirko [off-list ref] wrote:
quoted
Thu, Aug 25, 2016 at 06:37:35PM CEST, maheshb@google.com wrote:
quoted
On Thu, Aug 25, 2016 at 9:23 AM, Jiri Pirko [off-list ref] wrote:
quoted
From: Jiri Pirko <redacted>
When team is in bridge and LACP is utilized, LACPDU packets are pushed
to userspace using raw socket and there they are processed. However,
since 8626c56c8279b, LACPDU skbs are dropped by bridge rx_handler so
they never reach packet handlers in rx path. Fix this by explicity treat
LACPDUs to be pushed to exact delivery in team rx_handler.
Reported-by: Ido Schimmel <redacted>
Fixes: 8626c56c8279b ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
Signed-off-by: Jiri Pirko <redacted>
---
drivers/net/team/team_mode_loadbalance.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
@@ -17,6 +17,19 @@#include<linux/filter.h>#include<linux/if_team.h>+staticrx_handler_result_tlb_receive(structteam*team,structteam_port*port,+structsk_buff*skb)+{+if(unlikely(skb->protocol==htons(ETH_P_SLOW))){+/* LACPDU packets should go to exact delivery */+constunsignedchar*dest=eth_hdr(skb)->h_dest;++if(is_link_local_ether_addr(dest)&&dest[5]==0x02)+returnRX_HANDLER_EXACT;
I believe every link-local-frame should get this treatment whether
it's 802.3ad or otherwise (e.g. LLDP etc.), no?
BTW same should be true for bonding too (of course except LACP since
it handles/consumes it!)
I think so as well, but stayed more conservative for this fix. LLDP case
is handled in bridge rx_handler though...
bridge rx_handler when team is in bridge, otherwise these link-local
frames will be appear on master. So I guess it's a choice between
being conservative (and fix only LACP case as this fix does) or fix a
generic case.
Let's be conservative in -net and possibly fix change this as a
follow-up in net-next