compat-drivers: remove ksize() ifdef on scan.c
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Wed, 12 Dec 2012 00:27:42 +0000 (16:27 -0800)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Wed, 12 Dec 2012 00:27:42 +0000 (16:27 -0800)
The patch bellow remove the usage of ksize() so just
remove that hunk.

commit 9caf03640279e64d0ba36539b42daa1b43a49486
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Nov 29 01:25:20 2012 +0100

    cfg80211: fix BSS struct IE access races

    When a BSS struct is updated, the IEs are currently
    overwritten or freed. This can lead to races if some
    other CPU is accessing the BSS struct and using the
    IEs concurrently.

    Fix this by always allocating the IEs in a new struct
    that holds the data and length and protecting access
    to this new struct with RCU.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
patches/collateral-evolutions/network/02-ksize.patch

index b54cb234ac4fe9efa363ee729b5b4085333c17e4..934e2fae154f64529d7219474ca202e1d2e4eb9e 100644 (file)
@@ -35,35 +35,3 @@ of the situation.
  
        if (key_len) {
                priv->keys[index].key = kzalloc(key_len, GFP_ATOMIC);
---- a/net/wireless/scan.c
-+++ b/net/wireless/scan.c
-@@ -673,9 +673,14 @@ cfg80211_bss_update(struct cfg80211_regi
-                       size_t used = dev->wiphy.bss_priv_size + sizeof(*res);
-                       size_t ielen = res->pub.len_proberesp_ies;
-+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28)
-+                      if (0) {
-+                              used = 0; /* just to shut up the compiler */
-+#else
-                       if (found->pub.proberesp_ies &&
-                           !found->proberesp_ies_allocated &&
-                           ksize(found) >= used + ielen) {
-+#endif
-                               memcpy(found->pub.proberesp_ies,
-                                      res->pub.proberesp_ies, ielen);
-                               found->pub.len_proberesp_ies = ielen;
-@@ -709,9 +714,14 @@ cfg80211_bss_update(struct cfg80211_regi
-                               (found->pub.information_elements ==
-                                found->pub.beacon_ies);
-+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28)
-+                      if (0) {
-+                              used = 0; /* just to shut up the compiler */
-+#else
-                       if (found->pub.beacon_ies &&
-                           !found->beacon_ies_allocated &&
-                           ksize(found) >= used + ielen) {
-+#endif
-                               memcpy(found->pub.beacon_ies,
-                                      res->pub.beacon_ies, ielen);
-                               found->pub.len_beacon_ies = ielen;