2015-07-20 07:55:09

by Sowmini Varadhan

[permalink] [raw]
Subject: [PATCH v2 net-next] net/vxlan: Fix kernel unaligned access in __vxlan_find_mac


__vxlan_find_mac invokes ether_addr_equal on the eth_addr field,
which triggers unaligned access messages, so rearrange vxlan_fdb
to avoid this in the most non-intrusive way.

Signed-off-by: Sowmini Varadhan <[email protected]>
---
v2: Alexander Duyck comments: place eth_addr[] to be 64b aligned

drivers/net/vxlan.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 34c519e..ec86a11 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -106,9 +106,9 @@ struct vxlan_fdb {
unsigned long updated; /* jiffies */
unsigned long used;
struct list_head remotes;
+ u8 eth_addr[ETH_ALEN];
u16 state; /* see ndm_state */
u8 flags; /* see ndm_flags */
- u8 eth_addr[ETH_ALEN];
};

/* Pseudo network device */
--
1.7.1


2015-07-20 08:04:46

by Jiri Pirko

[permalink] [raw]
Subject: Re: [PATCH v2 net-next] net/vxlan: Fix kernel unaligned access in __vxlan_find_mac

Mon, Jul 20, 2015 at 09:54:50AM CEST, [email protected] wrote:
>
>__vxlan_find_mac invokes ether_addr_equal on the eth_addr field,
>which triggers unaligned access messages, so rearrange vxlan_fdb
>to avoid this in the most non-intrusive way.
>
>Signed-off-by: Sowmini Varadhan <[email protected]>

Reviewed-by: Jiri Pirko <[email protected]>

2015-07-20 14:07:41

by Marcelo Ricardo Leitner

[permalink] [raw]
Subject: Re: [PATCH v2 net-next] net/vxlan: Fix kernel unaligned access in __vxlan_find_mac

On Mon, Jul 20, 2015 at 09:54:50AM +0200, Sowmini Varadhan wrote:
>
> __vxlan_find_mac invokes ether_addr_equal on the eth_addr field,
> which triggers unaligned access messages, so rearrange vxlan_fdb
> to avoid this in the most non-intrusive way.
>
> Signed-off-by: Sowmini Varadhan <[email protected]>

Reviewed-by: Marcelo Ricardo Leitner <[email protected]>

2015-07-21 07:12:59

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v2 net-next] net/vxlan: Fix kernel unaligned access in __vxlan_find_mac

From: Sowmini Varadhan <[email protected]>
Date: Mon, 20 Jul 2015 09:54:50 +0200

>
> __vxlan_find_mac invokes ether_addr_equal on the eth_addr field,
> which triggers unaligned access messages, so rearrange vxlan_fdb
> to avoid this in the most non-intrusive way.
>
> Signed-off-by: Sowmini Varadhan <[email protected]>
> ---
> v2: Alexander Duyck comments: place eth_addr[] to be 64b aligned

Applied, thanks.