All of lore.kernel.org
 help / color / mirror / Atom feed
From: matthieu castet <castet.matthieu@free.fr>
To: linux-wireless@vger.kernel.org
Subject: mac80211 : fix unaligned rx skb
Date: Thu, 04 Jun 2009 22:16:18 +0200	[thread overview]
Message-ID: <4A282B92.70609@free.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: mac80211_alignement.diff --]
[-- Type: text/x-diff, Size: 764 bytes --]

mac80211 is checking is the skb is aligned on 32 bit boundary.
But it is checking against ethernet header, whereas Linux expect IP
header aligned.
And ethernet ether size is 6*2+2=14, so aligning ethernet header make IP header unaligned.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 9776f73..0845fb3 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1397,7 +1397,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
 		 * mac80211. That also explains the __skb_push()
 		 * below.
 		 */
-		align = (unsigned long)skb->data & 3;
+		align = ((unsigned long)(skb->data + sizeof(struct ethhdr))) & 3;
 		if (align) {
 			if (WARN_ON(skb_headroom(skb) < 3)) {
 				dev_kfree_skb(skb);

             reply	other threads:[~2009-06-04 20:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 20:16 matthieu castet [this message]
2009-06-04 20:53 ` mac80211 : fix unaligned rx skb Luis R. Rodriguez
2009-06-04 21:16   ` Georgy Berdyshev
2009-06-04 21:40     ` Michael Buesch
2009-06-05  5:57       ` matthieu castet
2009-06-07  9:24         ` matthieu castet
2009-06-07  9:26           ` Michael Buesch
2009-06-07 15:18             ` John W. Linville

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=4A282B92.70609@free.fr \
    --to=castet.matthieu@free.fr \
    --cc=linux-wireless@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.