From: Felix Fietkau Date: Thu, 19 May 2016 15:34:38 +0000 (+0200) Subject: mac80211: fix fast_tx header alignment X-Git-Tag: firefly_0821_release~176^2~4^2~37^2~146 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9dcbb4d9fdae96d9320f5c794229a2c7e522cc5f;p=firefly-linux-kernel-4.4.55.git mac80211: fix fast_tx header alignment commit 6fe04128f158c5ad27e7504bfdf1b12e63331bc9 upstream. The header field is defined as u8[] but also accessed as struct ieee80211_hdr. Enforce an alignment of 2 to prevent unnecessary unaligned accesses, which can be very harmful for performance on many platforms. Fixes: e495c24731a2 ("mac80211: extend fast-xmit for more ciphers") Signed-off-by: Felix Fietkau Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 2cafb21b422f..15b0150283b6 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -269,7 +269,7 @@ struct ieee80211_fast_tx { u8 sa_offs, da_offs, pn_offs; u8 band; u8 hdr[30 + 2 + IEEE80211_FAST_XMIT_MAX_IV + - sizeof(rfc1042_header)]; + sizeof(rfc1042_header)] __aligned(2); struct rcu_head rcu_head; };