linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: davem@davemloft.net, therbert@google.com,
	marcelo.leitner@gmail.com, nicolas.dichtel@6wind.com,
	tgraf@suug.ch, jiri@resnulli.us, jbenc@redhat.com,
	azhou@nicira.com, jesse@nicira.com, sowmini.varadhan@oracle.com
Subject: [PATCH v2 net-next] net/vxlan: Fix kernel unaligned access in __vxlan_find_mac
Date: Mon, 20 Jul 2015 09:54:50 +0200	[thread overview]
Message-ID: <20150720075450.GB20398@oracle.com> (raw)


__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 <sowmini.varadhan@oracle.com>
---
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


             reply	other threads:[~2015-07-20  7:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20  7:54 Sowmini Varadhan [this message]
2015-07-20  8:04 ` [PATCH v2 net-next] net/vxlan: Fix kernel unaligned access in __vxlan_find_mac Jiri Pirko
2015-07-20 14:07 ` Marcelo Ricardo Leitner
2015-07-21  7:12 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150720075450.GB20398@oracle.com \
    --to=sowmini.varadhan@oracle.com \
    --cc=azhou@nicira.com \
    --cc=davem@davemloft.net \
    --cc=jbenc@redhat.com \
    --cc=jesse@nicira.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=tgraf@suug.ch \
    --cc=therbert@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).