Skip to content

Commit

Permalink
mac80211: fix fast_tx header alignment
Browse files Browse the repository at this point in the history
commit 6fe0412 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: e495c24 ("mac80211: extend fast-xmit for more ciphers")
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
nbd168 authored and gregkh committed Jul 27, 2016
1 parent 35467dc commit 9dcbb4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac80211/sta_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 9dcbb4d

Please sign in to comment.