Re: [Patch net 3/3] team: use a larger struct for mac address

2017-04-26 Thread Jarod Wilson
On 2017-04-26 1:28 PM, Cong Wang wrote: On Wed, Apr 26, 2017 at 9:46 AM, Jarod Wilson wrote: On 2017-04-26 12:11 PM, Cong Wang wrote: On Wed, Apr 26, 2017 at 8:55 AM, Jarod Wilson wrote: We already have struct sockaddr_storage that could be used throughout this set as well. We just conver

Re: [Patch net 3/3] team: use a larger struct for mac address

2017-04-26 Thread Cong Wang
On Wed, Apr 26, 2017 at 9:46 AM, Jarod Wilson wrote: > On 2017-04-26 12:11 PM, Cong Wang wrote: >> >> On Wed, Apr 26, 2017 at 8:55 AM, Jarod Wilson wrote: >>> >>> >>> We already have struct sockaddr_storage that could be used throughout >>> this >>> set as well. We just converted a few pieces of

Re: [Patch net 3/3] team: use a larger struct for mac address

2017-04-26 Thread Jarod Wilson
On 2017-04-26 12:11 PM, Cong Wang wrote: On Wed, Apr 26, 2017 at 8:55 AM, Jarod Wilson wrote: We already have struct sockaddr_storage that could be used throughout this set as well. We just converted a few pieces of the bonding driver over to using it for better support of ipoib bonds, via com

Re: [Patch net 3/3] team: use a larger struct for mac address

2017-04-26 Thread Cong Wang
On Wed, Apr 26, 2017 at 8:55 AM, Jarod Wilson wrote: > > We already have struct sockaddr_storage that could be used throughout this > set as well. We just converted a few pieces of the bonding driver over to > using it for better support of ipoib bonds, via commit > faeeb317a5615076dff1ff44b51e862

Re: [Patch net 3/3] team: use a larger struct for mac address

2017-04-26 Thread Cong Wang
On Tue, Apr 25, 2017 at 10:40 PM, Jiri Pirko wrote: > Wed, Apr 26, 2017 at 07:03:23AM CEST, xiyou.wangc...@gmail.com wrote: >>IPv6 tunnels use sizeof(struct in6_addr) as dev->addr_len, >>but in many places especially bonding, we use struct sockaddr >>to copy and set mac addr, this could lead to st

Re: [Patch net 3/3] team: use a larger struct for mac address

2017-04-26 Thread Jarod Wilson
On 2017-04-26 1:40 AM, Jiri Pirko wrote: Wed, Apr 26, 2017 at 07:03:23AM CEST, xiyou.wangc...@gmail.com wrote: IPv6 tunnels use sizeof(struct in6_addr) as dev->addr_len, but in many places especially bonding, we use struct sockaddr to copy and set mac addr, this could lead to stack out-of-bounds

Re: [Patch net 3/3] team: use a larger struct for mac address

2017-04-25 Thread Jiri Pirko
Wed, Apr 26, 2017 at 07:03:23AM CEST, xiyou.wangc...@gmail.com wrote: >IPv6 tunnels use sizeof(struct in6_addr) as dev->addr_len, >but in many places especially bonding, we use struct sockaddr >to copy and set mac addr, this could lead to stack out-of-bounds >access. > >Fix it by using a larger add

[Patch net 3/3] team: use a larger struct for mac address

2017-04-25 Thread Cong Wang
IPv6 tunnels use sizeof(struct in6_addr) as dev->addr_len, but in many places especially bonding, we use struct sockaddr to copy and set mac addr, this could lead to stack out-of-bounds access. Fix it by using a larger address storage. Reported-by: Andrey Konovalov Cc: Jiri Pirko Signed-off-by: