]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/vxlan: Fix kernel unaligned access in __vxlan_find_mac
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Fri, 23 Sep 2016 17:49:19 +0000 (10:49 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 27 Nov 2016 20:32:52 +0000 (12:32 -0800)
Orabug: 24593619

Backport of upstream commit 7177a3b037c7 ("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.

Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit aa51c7b55e350240c2ed5a8a217688d5bfd13424)
Signed-off-by: Allen Pais <allen.pais@oracle.com>
drivers/net/vxlan.c

index 21a0fbf1ed947a83506de920f7f61501457bfe68..b6a1530a5c0a13bd5b4cf2e14cf436c15c38f367 100644 (file)
@@ -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 */