Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1617403 > unrolled thread
| Started by | Brian Norris <briannorris@chromium.org> |
|---|---|
| First post | 2017-04-06 00:30 +0200 |
| Last post | 2017-04-06 18:50 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] mwifiex: MAC randomization should not be persistent Brian Norris <briannorris@chromium.org> - 2017-04-06 00:30 +0200
Re: [PATCH] mwifiex: MAC randomization should not be persistent Kalle Valo <kvalo@codeaurora.org> - 2017-04-06 06:10 +0200
Re: [PATCH] mwifiex: MAC randomization should not be persistent Brian Norris <briannorris@chromium.org> - 2017-04-06 18:50 +0200
| From | Brian Norris <briannorris@chromium.org> |
|---|---|
| Date | 2017-04-06 00:30 +0200 |
| Subject | [PATCH] mwifiex: MAC randomization should not be persistent |
| Message-ID | <tt1B7-8sp-7@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Kalle Valo <kvalo@codeaurora.org> |
|---|---|
| Date | 2017-04-06 06:10 +0200 |
| Message-ID | <tt6U9-3vf-1@gated-at.bofh.it> |
| In reply to | #1617403 |
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
[toc] | [prev] | [next] | [standalone]
| From | Brian Norris <briannorris@chromium.org> |
|---|---|
| Date | 2017-04-06 18:50 +0200 |
| Message-ID | <ttiLE-3md-45@gated-at.bofh.it> |
| In reply to | #1617487 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web