~ubuntu-branches/ubuntu/precise/wpasupplicant/precise-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0002-pmkokc-Clear-WPA-and-EAPOL-state-machine-config-pointer-on-.patch

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2013-06-12 15:57:50 UTC
  • Revision ID: package-import@ubuntu.com-20130612155750-go9lgylcef8n3f2f
Tags: 0.7.3-6ubuntu2.2
* Multiple patches to reduce the number of disconnections for WPA Enterprise
  roaming and Opportunistic Key Caching. (LP: #1187524)
* In debian/patches:
  0001-sme-fix-retry-after-auth-assoc-timeout-failure.patch,
  0002-sme-optimize-recovery-from-common-load-balancing-mechanisms.patch,
  0003-sme-blacklist-bss-on-first-failure-if-only-a-*.patch,
  0004-sme-extend-load-balancing-optimization-in-bss-blacklisting.patch,
  0005-sme-optimize-recovery-from-association-command-failures.patch,
  0006-sme-add-timers-for-authentication-and-association.patch,
  0007-sme-nl80211-set-cipher-suites.patch:
  Cherry-pick patches fixing SME (Session Management Entity) for the nl80211
  driver, which works as a basis for the OKC patches.
* In debian/patches:
  0001-pmkokc-Set-portValid-TRUE-on-association-for-driver-based-4.patch,
  0002-pmkokc-Clear-WPA-and-EAPOL-state-machine-config-pointer-on-.patch,
  0003-pmkokc-Clear-driver-PMKSA-cache-entry-on-PMKSA-cache-expira.patch,
  0004-pmkokc-Flush-PMKSA-cache-entries-and-invalidate-EAP-state-o.patch,
  0005-pmkokc-Fix-proactive_key_caching-configuration-to-WPA-code.patch,
  0006-pmkokc-RSN-Add-a-debug-message-when-considing-addition-of-O.patch,
  0007-pmkokc-Clear-OKC-based-PMKSA-caching-entries-if-PMK-is-chan.patch,
  0008-pmkokc-Move-wpa_sm_remove_pmkid-call-to-PMKSA-cache-entry-f.patch,
  0009-pmkokc-Use-PMKSA-cache-entries-with-only-a-single-network-c.patch,
  0010-pmkokc-PMKSA-Do-not-evict-active-cache-entry-when-adding-ne.patch,
  0011-pmkokc-PMKSA-Set-cur_pmksa-pointer-during-initial-associati.patch,
  0012-pmkokc-PMKSA-make-deauthentication-due-to-cache-entry-remov.patch,
  0013-pmkokc-PMKSA-update-current-cache-entry-due-to-association-.patch:
  Cherry-pick patches to properly do OKC (Opportunistic Key Caching) which
  helps maintaining connectivity on networks secured with WPA Enterprise,
  especially on nl80211-based drivers -- these patches require SME, and add
  or fix key caching and handling of the cache entries.
* debian/patches/force-enable-okc.patch: force Opportunistic Key Caching to
  be enabled.
* debian/patches/less-aggressive-roaming.patch: use less aggressive roaming
  settings to avoid switching to another AP unnecessarily, when the actual
  signal level difference is small.
* debian/patches/wpa_supplicant-dbus-null-error.patch: Don't send NULL to
  dbus_message_new_error().
* debian/patches/0001-nl80211-Fix-UNSPEC-signal-quality-reporting.patch: fix
  marking qual as invalid rather than signal level.
* debian/patches/wpa_supplicant-squelch-driver-disconnect-spam.patch: recover
  cleanly from streams of disconnect messages (like on iwl3945).
* debian/patches/wpa_supplicant-assoc-timeout.patch: increase association
  timeouts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 20a0b03debef66cc57b0c34a05f8be5229be907c Mon Sep 17 00:00:00 2001
 
2
From: Jouni Malinen <jouni@qca.qualcomm.com>
 
3
Date: Mon, 27 Jun 2011 19:02:24 +0300
 
4
Subject: [PATCH] Clear WPA and EAPOL state machine config pointer on network
 
5
 removal
 
6
 
 
7
Make sure that the WPA and EAPOL state machines do not hold a pointer
 
8
to a network configuration that is about to be freed. This can fix
 
9
potential issues with references to freed memory.
 
10
---
 
11
 wpa_supplicant/ctrl_iface.c     |    4 ++++
 
12
 wpa_supplicant/p2p_supplicant.c |    7 ++++++-
 
13
 wpa_supplicant/wps_supplicant.c |   10 +++++++++-
 
14
 3 files changed, 19 insertions(+), 2 deletions(-)
 
15
 
 
16
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
 
17
index cbc6fef..730e607 100644
 
18
--- a/wpa_supplicant/ctrl_iface.c
 
19
+++ b/wpa_supplicant/ctrl_iface.c
 
20
@@ -1393,6 +1393,8 @@ static int wpa_supplicant_ctrl_iface_remove_network(
 
21
                }
 
22
                if (wpa_s->current_ssid) {
 
23
                        eapol_sm_invalidate_cached_session(wpa_s->eapol);
 
24
+                       wpa_sm_set_config(wpa_s->wpa, NULL);
 
25
+                       eapol_sm_notify_config(wpa_s->eapol, NULL, NULL);
 
26
                        wpa_supplicant_disassociate(wpa_s,
 
27
                                                    WLAN_REASON_DEAUTH_LEAVING);
 
28
                }
 
29
@@ -1416,6 +1418,8 @@ static int wpa_supplicant_ctrl_iface_remove_network(
 
30
                 * removed.
 
31
                 */
 
32
                eapol_sm_invalidate_cached_session(wpa_s->eapol);
 
33
+               wpa_sm_set_config(wpa_s->wpa, NULL);
 
34
+               eapol_sm_notify_config(wpa_s->eapol, NULL, NULL);
 
35
 
 
36
                wpa_supplicant_disassociate(wpa_s, WLAN_REASON_DEAUTH_LEAVING);
 
37
        }
 
38
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
 
39
index b75c6ef..e3388bd 100644
 
40
--- a/wpa_supplicant/wps_supplicant.c
 
41
+++ b/wpa_supplicant/wps_supplicant.c
 
42
@@ -24,6 +24,7 @@
 
43
 #include "common/wpa_ctrl.h"
 
44
 #include "eap_common/eap_wsc_common.h"
 
45
 #include "eap_peer/eap.h"
 
46
+#include "eapol_supp/eapol_supp_sm.h"
 
47
 #include "rsn_supp/wpa.h"
 
48
 #include "config.h"
 
49
 #include "wpa_supplicant_i.h"
 
50
@@ -673,7 +674,9 @@ enum wps_request_type wpas_wps_get_req_type(struct wpa_ssid *ssid)
 
51
 static void wpas_clear_wps(struct wpa_supplicant *wpa_s)
 
52
 {
 
53
        int id;
 
54
-       struct wpa_ssid *ssid, *remove_ssid = NULL;
 
55
+       struct wpa_ssid *ssid, *remove_ssid = NULL, *prev_current;
 
56
+
 
57
+       prev_current = wpa_s->current_ssid;
 
58
 
 
59
        eloop_cancel_timeout(wpas_wps_timeout, wpa_s, NULL);
 
60
 
 
61
@@ -692,6 +695,11 @@ static void wpas_clear_wps(struct wpa_supplicant *wpa_s)
 
62
                        id = -1;
 
63
                ssid = ssid->next;
 
64
                if (id >= 0) {
 
65
+                       if (prev_current == remove_ssid) {
 
66
+                               wpa_sm_set_config(wpa_s->wpa, NULL);
 
67
+                               eapol_sm_notify_config(wpa_s->eapol, NULL,
 
68
+                                                      NULL);
 
69
+                       }
 
70
                        wpas_notify_network_removed(wpa_s, remove_ssid);
 
71
                        wpa_config_remove_network(wpa_s->conf, id);
 
72
                }
 
73
-- 
 
74
1.7.7.6
 
75