aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2014-03-27 08:58:30 +0200
committerSteve Kondik <shade@chemlab.org>2014-10-13 19:52:49 -0700
commit699897d2b0cdc8ff3e4cfcbb1b640135825af924 (patch)
treeda1bac4aba941d161ad86ddcdf83d82d53cb5ad5
parent34633459ab748a7e12224e47c30d673ac74b97c3 (diff)
downloadandroid_external_wpa_supplicant_8-699897d2b0cdc8ff3e4cfcbb1b640135825af924.tar.gz
android_external_wpa_supplicant_8-699897d2b0cdc8ff3e4cfcbb1b640135825af924.tar.bz2
android_external_wpa_supplicant_8-699897d2b0cdc8ff3e4cfcbb1b640135825af924.zip
P2P: Fix segfault when PBC overlap is detected
If a separate P2P group interface is used, PBC overlap during group formation causes the group interface to be removed, which ends up with the interface context becoming invalid. Fix this by scheduling a timeout to process the PBC overlap and interface removal instead of removing the interface directly before the connection operation has returned. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Git-commit: ace0fbdb69b492a3aa6f24d07f0d6d4dffc4b7dc Git-repo : git://w1.fi/srv/git/hostap.git Change-Id: Iee452eb1ea731c7e216e0ec25a7c7235756589ac CRs-fixed: 670339
-rw-r--r--wpa_supplicant/events.c6
-rw-r--r--wpa_supplicant/p2p_supplicant.c7
-rw-r--r--wpa_supplicant/p2p_supplicant.h1
-rw-r--r--wpa_supplicant/wps_supplicant.c11
4 files changed, 14 insertions, 11 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index cfeb8e8e..eb8e7c5b 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -974,8 +974,12 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_OVERLAP
"PBC session overlap");
#ifdef CONFIG_P2P
- if (wpas_p2p_notif_pbc_overlap(wpa_s) == 1)
+ if (wpa_s->p2p_group_interface == P2P_GROUP_INTERFACE_CLIENT ||
+ wpa_s->p2p_in_provisioning) {
+ eloop_register_timeout(0, 0, wpas_p2p_pbc_overlap_cb,
+ wpa_s, NULL);
return -1;
+ }
#endif /* CONFIG_P2P */
#ifdef CONFIG_WPS
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index a41b3d86..dddd4316 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -5891,6 +5891,13 @@ int wpas_p2p_notif_pbc_overlap(struct wpa_supplicant *wpa_s)
}
+void wpas_p2p_pbc_overlap_cb(void *eloop_ctx, void *timeout_ctx)
+{
+ struct wpa_supplicant *wpa_s = eloop_ctx;
+ wpas_p2p_notif_pbc_overlap(wpa_s);
+}
+
+
void wpas_p2p_update_channel_list(struct wpa_supplicant *wpa_s)
{
struct p2p_channels chan;
diff --git a/wpa_supplicant/p2p_supplicant.h b/wpa_supplicant/p2p_supplicant.h
index 64c5857c..e558edd9 100644
--- a/wpa_supplicant/p2p_supplicant.h
+++ b/wpa_supplicant/p2p_supplicant.h
@@ -162,6 +162,7 @@ void wpas_p2p_new_psk_cb(struct wpa_supplicant *wpa_s, const u8 *mac_addr,
const u8 *psk, size_t psk_len);
void wpas_p2p_remove_client(struct wpa_supplicant *wpa_s, const u8 *peer,
int iface_addr);
+void wpas_p2p_pbc_overlap_cb(void *eloop_ctx, void *timeout_ctx);
#ifdef CONFIG_P2P
void wpas_p2p_continue_after_scan(struct wpa_supplicant *wpa_s);
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index fca69254..12ebd234 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -508,15 +508,6 @@ static int wpa_supplicant_wps_cred(void *ctx,
}
-#ifdef CONFIG_P2P
-static void wpas_wps_pbc_overlap_cb(void *eloop_ctx, void *timeout_ctx)
-{
- struct wpa_supplicant *wpa_s = eloop_ctx;
- wpas_p2p_notif_pbc_overlap(wpa_s);
-}
-#endif /* CONFIG_P2P */
-
-
static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
struct wps_event_m2d *m2d)
{
@@ -535,7 +526,7 @@ static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
* Notify P2P from eloop timeout to avoid issues with the
* interface getting removed while processing a message.
*/
- eloop_register_timeout(0, 0, wpas_wps_pbc_overlap_cb, wpa_s,
+ eloop_register_timeout(0, 0, wpas_p2p_pbc_overlap_cb, wpa_s,
NULL);
}
#endif /* CONFIG_P2P */