lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191216170302.29543-53-Jerome.Pouiller@silabs.com>
Date:   Mon, 16 Dec 2019 17:03:59 +0000
From:   Jérôme Pouiller <Jerome.Pouiller@...abs.com>
To:     "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jérôme Pouiller <Jerome.Pouiller@...abs.com>
Subject: [PATCH 52/55] staging: wfx: delayed_unjoin cannot happen

From: Jérôme Pouiller <jerome.pouiller@...abs.com>

Original code allows to detect an unjoin request during a scan and
delaying the unjoin request. However, it is far easier to just block the
unjoin request until the end of the scan request.

In fact, it is already the case since scan and unjoin are protected by
conf_mutex. So, currently, the handling of delayed_unjoin is just dead
code.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
---
 drivers/staging/wfx/scan.c |  7 +------
 drivers/staging/wfx/sta.c  | 14 --------------
 drivers/staging/wfx/wfx.h  |  1 -
 3 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index 540009b72240..bdbce6926e91 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -95,12 +95,7 @@ void wfx_hw_scan_work(struct work_struct *work)
 	mutex_unlock(&wvif->wdev->conf_mutex);
 	mutex_unlock(&wvif->scan_lock);
 	__ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0);
-	if (wvif->delayed_unjoin) {
-		wvif->delayed_unjoin = false;
-		wfx_tx_lock(wvif->wdev);
-		if (!schedule_work(&wvif->unjoin_work))
-			wfx_tx_unlock(wvif->wdev);
-	} else if (wvif->delayed_link_loss) {
+	if (wvif->delayed_link_loss) {
 		wvif->delayed_link_loss = false;
 		wfx_cqm_bssloss_sm(wvif, 1, 0, 0);
 	}
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 4354bb8081c5..7ae763e96455 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -66,10 +66,6 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad)
 	wvif->delayed_link_loss = 0;
 	cancel_work_sync(&wvif->bss_params_work);
 
-	/* If we have a pending unjoin */
-	if (wvif->delayed_unjoin)
-		goto end;
-
 	if (init) {
 		schedule_delayed_work(&wvif->bss_loss_work, HZ);
 		wvif->bss_loss_state = 0;
@@ -501,16 +497,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif)
 {
 	mutex_lock(&wvif->wdev->conf_mutex);
 
-	if (!mutex_trylock(&wvif->scan_lock)) {
-		if (wvif->delayed_unjoin)
-			dev_dbg(wvif->wdev->dev,
-				"delayed unjoin is already scheduled\n");
-		else
-			wvif->delayed_unjoin = true;
-		goto done;
-	}
-	mutex_unlock(&wvif->scan_lock);
-
 	wvif->delayed_link_loss = false;
 
 	if (!wvif->state)
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index b5f763c3fac7..5e7c911db024 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -122,7 +122,6 @@ struct wfx_vif {
 	struct work_struct	set_cts_work;
 
 	int			join_complete_status;
-	bool			delayed_unjoin;
 	struct work_struct	unjoin_work;
 
 	/* avoid some operations in parallel with scan */
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ