linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: ieee80211_wep_encrypt_data_fix_unaligned_access.patch
@ 2008-11-24 20:17 Ivan Kuten
  0 siblings, 0 replies; only message in thread
From: Ivan Kuten @ 2008-11-24 20:17 UTC (permalink / raw)
  To: linux-wireless

The patch fixes possible unaligned access in ieee80211_wep_encrypt_data function.

Signed-off-by: Ivan Kuten <ivan.kuten@promwad.com>

--- linux-2.6.28-rc3/net/mac80211/wep.c 2008-11-20 00:04:58.000000000 -0500
+++ linux-2.6.86-rc3.new/net/mac80211/wep.c     2008-11-22 00:37:53.000000000 -0500
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-24 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-24 20:17 PATCH: ieee80211_wep_encrypt_data_fix_unaligned_access.patch Ivan Kuten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).