* [PATCH] mwifiex: MAC randomization should not be persistent
@ 2017-04-05 22:26 Brian Norris
2017-04-06 4:02 ` Kalle Valo
2017-04-20 7:17 ` Kalle Valo
0 siblings, 2 replies; 5+ messages in thread
From: Brian Norris @ 2017-04-05 22:26 UTC (permalink / raw)
To: Nishant Sarmukadam, Ganapathi Bhat, Xinming Hu
Cc: linux-kernel, Kalle Valo, Dmitry Torokhov, netdev,
linux-wireless, Brian Norris
nl80211 provides the NL80211_SCAN_FLAG_RANDOM_ADDR for every scan
request that should be randomized; the absence of such a flag means we
should not randomize. However, mwifiex was stashing the latest
randomization request and *always* using it for future scans, even those
that didn't set the flag.
Let's zero out the randomization info whenever we get a scan request
without NL80211_SCAN_FLAG_RANDOM_ADDR. I'd prefer to remove
priv->random_mac entirely (and plumb the randomization MAC properly
through the call sequence), but the spaghetti is a little difficult to
unravel here for me.
Fixes: c2a8f0ff9c6c ("mwifiex: support random MAC address for scanning")
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
Should this be tagged for -stable?
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 1e3bd435a694..2d7e8a372bf1 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -2528,9 +2528,11 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy,
priv->random_mac[i] |= get_random_int() &
~(request->mac_addr_mask[i]);
}
+ ether_addr_copy(user_scan_cfg->random_mac, priv->random_mac);
+ } else {
+ eth_zero_addr(priv->random_mac);
}
- ether_addr_copy(user_scan_cfg->random_mac, priv->random_mac);
user_scan_cfg->num_ssids = request->n_ssids;
user_scan_cfg->ssid_list = request->ssids;
--
2.12.2.715.g7642488e1d-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mwifiex: MAC randomization should not be persistent
2017-04-05 22:26 [PATCH] mwifiex: MAC randomization should not be persistent Brian Norris
@ 2017-04-06 4:02 ` Kalle Valo
2017-04-06 16:48 ` Brian Norris
2017-04-20 7:17 ` Kalle Valo
1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2017-04-06 4:02 UTC (permalink / raw)
To: Brian Norris
Cc: Nishant Sarmukadam, Ganapathi Bhat, Xinming Hu, linux-kernel,
Dmitry Torokhov, netdev, linux-wireless
Brian Norris <briannorris@chromium.org> writes:
> nl80211 provides the NL80211_SCAN_FLAG_RANDOM_ADDR for every scan
> request that should be randomized; the absence of such a flag means we
> should not randomize. However, mwifiex was stashing the latest
> randomization request and *always* using it for future scans, even those
> that didn't set the flag.
>
> Let's zero out the randomization info whenever we get a scan request
> without NL80211_SCAN_FLAG_RANDOM_ADDR. I'd prefer to remove
> priv->random_mac entirely (and plumb the randomization MAC properly
> through the call sequence), but the spaghetti is a little difficult to
> unravel here for me.
>
> Fixes: c2a8f0ff9c6c ("mwifiex: support random MAC address for scanning")
So the first release with this was v4.9.
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> Should this be tagged for -stable?
IMHO yes.
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mwifiex: MAC randomization should not be persistent
2017-04-06 4:02 ` Kalle Valo
@ 2017-04-06 16:48 ` Brian Norris
2017-04-13 13:13 ` Kalle Valo
0 siblings, 1 reply; 5+ messages in thread
From: Brian Norris @ 2017-04-06 16:48 UTC (permalink / raw)
To: Kalle Valo
Cc: Nishant Sarmukadam, Ganapathi Bhat, Xinming Hu, linux-kernel,
Dmitry Torokhov, netdev, linux-wireless
On Thu, Apr 06, 2017 at 07:02:15AM +0300, Kalle Valo wrote:
> Brian Norris <briannorris@chromium.org> writes:
>
> > nl80211 provides the NL80211_SCAN_FLAG_RANDOM_ADDR for every scan
> > request that should be randomized; the absence of such a flag means we
> > should not randomize. However, mwifiex was stashing the latest
> > randomization request and *always* using it for future scans, even those
> > that didn't set the flag.
> >
> > Let's zero out the randomization info whenever we get a scan request
> > without NL80211_SCAN_FLAG_RANDOM_ADDR. I'd prefer to remove
> > priv->random_mac entirely (and plumb the randomization MAC properly
> > through the call sequence), but the spaghetti is a little difficult to
> > unravel here for me.
> >
> > Fixes: c2a8f0ff9c6c ("mwifiex: support random MAC address for scanning")
>
> So the first release with this was v4.9.
>
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > ---
> > Should this be tagged for -stable?
>
> IMHO yes.
Sounds fine to me. I suppose you'll do this when applying? Or I can
resend...
Brian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mwifiex: MAC randomization should not be persistent
2017-04-06 16:48 ` Brian Norris
@ 2017-04-13 13:13 ` Kalle Valo
0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2017-04-13 13:13 UTC (permalink / raw)
To: Brian Norris
Cc: Nishant Sarmukadam, Ganapathi Bhat, Xinming Hu, linux-kernel,
Dmitry Torokhov, netdev, linux-wireless
Brian Norris <briannorris@chromium.org> writes:
> On Thu, Apr 06, 2017 at 07:02:15AM +0300, Kalle Valo wrote:
>> Brian Norris <briannorris@chromium.org> writes:
>>
>> > nl80211 provides the NL80211_SCAN_FLAG_RANDOM_ADDR for every scan
>> > request that should be randomized; the absence of such a flag means we
>> > should not randomize. However, mwifiex was stashing the latest
>> > randomization request and *always* using it for future scans, even those
>> > that didn't set the flag.
>> >
>> > Let's zero out the randomization info whenever we get a scan request
>> > without NL80211_SCAN_FLAG_RANDOM_ADDR. I'd prefer to remove
>> > priv->random_mac entirely (and plumb the randomization MAC properly
>> > through the call sequence), but the spaghetti is a little difficult to
>> > unravel here for me.
>> >
>> > Fixes: c2a8f0ff9c6c ("mwifiex: support random MAC address for scanning")
>>
>> So the first release with this was v4.9.
>>
>> > Signed-off-by: Brian Norris <briannorris@chromium.org>
>> > ---
>> > Should this be tagged for -stable?
>>
>> IMHO yes.
>
> Sounds fine to me. I suppose you'll do this when applying? Or I can
> resend...
I can add this:
Cc: <stable@vger.kernel.org> # 4.9+
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mwifiex: MAC randomization should not be persistent
2017-04-05 22:26 [PATCH] mwifiex: MAC randomization should not be persistent Brian Norris
2017-04-06 4:02 ` Kalle Valo
@ 2017-04-20 7:17 ` Kalle Valo
1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2017-04-20 7:17 UTC (permalink / raw)
To: Brian Norris
Cc: Nishant Sarmukadam, Ganapathi Bhat, Xinming Hu, linux-kernel,
Dmitry Torokhov, netdev, linux-wireless, Brian Norris
Brian Norris <briannorris@chromium.org> wrote:
> nl80211 provides the NL80211_SCAN_FLAG_RANDOM_ADDR for every scan
> request that should be randomized; the absence of such a flag means we
> should not randomize. However, mwifiex was stashing the latest
> randomization request and *always* using it for future scans, even those
> that didn't set the flag.
>
> Let's zero out the randomization info whenever we get a scan request
> without NL80211_SCAN_FLAG_RANDOM_ADDR. I'd prefer to remove
> priv->random_mac entirely (and plumb the randomization MAC properly
> through the call sequence), but the spaghetti is a little difficult to
> unravel here for me.
>
> Fixes: c2a8f0ff9c6c ("mwifiex: support random MAC address for scanning")
> Cc: <stable@vger.kernel.org> # 4.9+
> Signed-off-by: Brian Norris <briannorris@chromium.org>
Patch applied to wireless-drivers-next.git, thanks.
7e2f18f06408 mwifiex: MAC randomization should not be persistent
--
https://patchwork.kernel.org/patch/9665813/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-04-20 7:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-05 22:26 [PATCH] mwifiex: MAC randomization should not be persistent Brian Norris
2017-04-06 4:02 ` Kalle Valo
2017-04-06 16:48 ` Brian Norris
2017-04-13 13:13 ` Kalle Valo
2017-04-20 7:17 ` Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.