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-next>] [day] [month] [year] [list]
Date:   Mon,  9 Dec 2019 15:51:16 -0800
From:   Brian Norris <briannorris@...omium.org>
To:     linux-wireless@...r.kernel.org
Cc:     <linux-kernel@...r.kernel.org>,
        Ganapathi Bhat <ganapathi.bhat@....com>,
        Nishant Sarmukadam <nishants@...vell.com>,
        Amitkumar Karwar <amitkarwar@...il.com>,
        Xinming Hu <huxinming820@...il.com>,
        Brian Norris <briannorris@...omium.org>
Subject: [PATCH] mwifiex: start out with BSS type ANY, not STA

mwifiex starts out by setting up 3 possible interfaces, but usually only
1 of them gets initialized later. Currently, we leave the
"uninitialized" interfaces with bss_type==0, which means
MWIFIEX_BSS_TYPE_STA. This gives misleading results for things like
mwifiex_get_intf_num(..., MWIFIEX_BSS_TYPE_STA), giving the answer "3"
even when we only have 1 initialized STA.

This bug doesn't affect functions like mwifiex_get_unused_bss_num(),
which are looking at the bss_mode field instead (to see
NL80211_IFTYPE_UNSPECIFIED, which happens to be 0...) for finding
uninitialized interfaces.

Let's make mwifiex_get_intf_num() give a proper answer, by making its
initial value the proper uninitialized value -- ANY.

Signed-off-by: Brian Norris <briannorris@...omium.org>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index a9657ae6d782..a9063411d243 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -97,6 +97,8 @@ static int mwifiex_register(void *card, struct device *dev,
 
 		adapter->priv[i]->adapter = adapter;
 		adapter->priv_num++;
+		/* Start out as uninitialized. */
+		adapter->priv[i]->bss_type = MWIFIEX_BSS_TYPE_ANY;
 	}
 	mwifiex_init_lock_list(adapter);
 
-- 
2.24.0.393.g34dc348eaf-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ