From patchwork Tue May 29 10:01:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neeraj Garg X-Patchwork-Id: 161724 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id EB3C6B6FB7 for ; Tue, 29 May 2012 20:02:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 06CA59D20C; Tue, 29 May 2012 06:02:06 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d1WuQR+ehB4T; Tue, 29 May 2012 06:02:05 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DDECD9D219; Tue, 29 May 2012 06:02:01 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A9FF49D219 for ; Tue, 29 May 2012 06:02:00 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5bghZNORVKzJ for ; Tue, 29 May 2012 06:01:55 -0400 (EDT) Received: from MMS3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 828129D20C for ; Tue, 29 May 2012 06:01:55 -0400 (EDT) Received: from [10.16.192.232] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Tue, 29 May 2012 03:02:22 -0700 X-Server-Uuid: B730DE51-FC43-4C83-941F-F1F78A914BDD Received: from SJEXCHCAS05.corp.ad.broadcom.com (10.16.203.13) by SJEXCHHUB02.corp.ad.broadcom.com (10.16.192.232) with Microsoft SMTP Server (TLS) id 8.2.247.2; Tue, 29 May 2012 03:01:42 -0700 Received: from SJEXCHMB12.corp.ad.broadcom.com ( [fe80::bc15:c1e1:c29a:36f7]) by SJEXCHCAS05.corp.ad.broadcom.com ( [::1]) with mapi id 14.01.0355.002; Tue, 29 May 2012 03:01:21 -0700 From: "Neeraj Kumar Garg" To: "hostap@lists.shmoo.com" Subject: [PATCH] P2P:Fixing the supplicant crash if a group interface has been removed in the event handler itself Thread-Topic: [PATCH] P2P:Fixing the supplicant crash if a group interface has been removed in the event handler itself Thread-Index: Ac09gfa2DahPcDzxSguKW1w9jS/lEg== Date: Tue, 29 May 2012 10:01:19 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.71.78] MIME-Version: 1.0 X-WSS-ID: 63DA41243E039696872-01-01 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com We hit a scenario where a PBC overlap was detected in the context of EVENT_SCAN_RESULTS. When in the event handler of do_process_drv_event, an overlap is detected, it will cause GROUP-FORMATION-FAILURE and that will remove the group interface and then corresponding drv pointer from the list global->interfaces will also get removed. (code path wpas_p2p_group_delete->wpa_supplicant_remove_iface -> wpa_supplicant_deinit_iface -> wpa_drv_deinit ->wpa_driver_nl80211_deinit) In my opinion it is safe to do break, as the event had an ifidx no. and once that has been found, event is completed. There is no need to go for checking other interfaces. Plz let me know if my understanding is wrong. From 01b4bf60d99f3b3fa41b057e7bae184db08f5707 Mon Sep 17 00:00:00 2001 From: Neeraj Garg Date: Tue, 29 May 2012 15:23:51 +0530 Subject: [PATCH] P2P:Fixing the supplicant crash if a group interface has been removed in the event handler itself Signed-off-by: Neeraj Garg --- src/drivers/driver_nl80211.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 693a885..a6cb0b8 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2210,8 +2210,10 @@ static int process_global_event(struct nl_msg *msg, void *arg) dl_list_for_each(drv, &global->interfaces, struct wpa_driver_nl80211_data, list) { if (ifidx == -1 || ifidx == drv->ifindex || - have_ifidx(drv, ifidx)) + have_ifidx(drv, ifidx)) { do_process_drv_event(drv, gnlh->cmd, tb); + break; + } } return NL_SKIP;