From: Ivan Kuten Date: Mon, 24 Nov 2008 20:17:54 +0000 (-0500) Subject: mac80211: fix unaligned access in ieee80211_wep_encrypt_data X-Git-Tag: v2.6.29-rc1~581^2~383^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=860c6e6a15c5082e1a1ff1faeb56cdf439380e87;p=karo-tx-linux.git mac80211: fix unaligned access in ieee80211_wep_encrypt_data Signed-off-by: Ivan Kuten Signed-off-by: John W. Linville --- diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 7bbb98e846a3..7043ddc75498 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "ieee80211_i.h" @@ -125,10 +126,10 @@ void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, { struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist sg; - __le32 *icv; + __le32 icv; - icv = (__le32 *)(data + data_len); - *icv = cpu_to_le32(~crc32_le(~0, data, data_len)); + icv = cpu_to_le32(~crc32_le(~0, data, data_len)); + put_unaligned(icv, (__le32 *)(data + data_len)); crypto_blkcipher_setkey(tfm, rc4key, klen); sg_init_one(&sg, data, data_len + WEP_ICV_LEN);