Skip to contentSkip to conversation

PATCH: ieee80211_wep_encrypt_data_fix_unaligned_access.patch

PATCH Ivan Kuten 1 participant 1 message Nov 24, 2008 mac80211

lore
Share & tools
lore

Ivan Kuten

author
#0 lore raw

The patch fixes possible unaligned access in ieee80211_wep_encrypt_data function.

net/mac80211/wep.c 2008-11-22 00:37:53.000000000 -0500 renamed from net/mac80211/wep.c 2008-11-20 00:04:58.000000000 -0500 +3 -3
@@ -123,10 +123,10 @@
 {
        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);

---

Best regards,
Ivan