linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Francesco Dolcini <francesco@dolcini.it>,
	Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	David Lin <yu-hao.lin@nxp.com>,
	kernel@pengutronix.de, stable@vger.kernel.org
Subject: Re: [PATCH v2 02/12] wifi: mwifiex: fix MAC address handling
Date: Fri, 4 Oct 2024 16:15:32 -0700	[thread overview]
Message-ID: <ZwB3FCdpL85yA2Si@google.com> (raw)
In-Reply-To: <20240918-mwifiex-cleanup-1-v2-2-2d0597187d3c@pengutronix.de>

Hi Sascha,

Sorry for being a bit slow here. And even now, I probably don't have
enough time to review this whole series today.

But I'll still share some initial thoughts, in case you can help address
them before I next look at this:

On Wed, Sep 18, 2024 at 01:10:27PM +0200, Sascha Hauer wrote:
> The mwifiex driver tries to derive the MAC addresses of the virtual
> interfaces from the permanent address by adding the bss_num of the
> particular interface used. It does so each time the virtual interface
> is changed from AP to station or the other way round. This means that
> the devices MAC address changes during a change_virtual_intf call which
> is pretty unexpected by userspace.

Ack, the "change_virtual_intf" part looks wrong.

> Furthermore the driver doesn't use the permanent address to add the
> bss_num to, but instead the current MAC address increases each time
> we do a change_virtual_intf.
> 
> Fix this by initializing the MAC address once from the permanent MAC
> address during creation of the virtual interface and never touch it
> again. This also means that userspace can set a different MAC address
> which then stays like this forever and is not unexpectedly changed
> by the driver.
> 
> It is not clear how many (if any) MAC addresses after the permanent MAC
> address are reserved for a device, so set the locally admistered
> bit for all MAC addresses derived from the permanent address.

I think I'm generally supportive of the direction this changes things,
but I'm a bit hesitant about two things:
1. the potential user-visible changes and
2. the linux-stable backport (Cc stable below)

For 1: MAC addresses are important in some contexts, and this might
significantly change the addresses that devices get in practice. Such
users might not really care about the weird details of when the address
incremented; but they *probably* care that a certain sequence of "boot
device; run hostapd with <foo> config file" produces the same address.

Also, I'm not sure I know enough of the implications of potential
over-use of the locally administered bit. Are there significant
downsides to it (aside from the simple fact that it's a different
address)?

And I see that you rightly don't know how many addresses are actually
reserved, but I have an educated guess that it's not just 1. For one,
this driver used to default-create 3 interfaces:
1211c961170c mwifiex: do not create AP and P2P interfaces upon driver loading

and when we stopped doing that, we still kept support for a module
parameter for the old way:
0013c7cebed6 mwifiex: module load parameter for interface creation

Perhaps these "initial" interfaces should at least be allowed permanent
addresses?

So anyway, I don't really know for sure the right answer, but I want to
log my concerns, in case you had more thoughts on backward
compatibility.

And given all the uncertainty above, I'm extra hesitant about
backporting likely-user-visible changes to stable (#2).

> With this patch MWIFIEX_BSS_TYPE_ANY becomes unused, so it's removed.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: stable@vger.kernel.org

Regards,
Brian

  reply	other threads:[~2024-10-04 23:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 11:10 [PATCH v2 00/12] mwifiex: two fixes and cleanup Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 01/12] wifi: mwifiex: add missing locking Sascha Hauer
2024-10-04 22:56   ` Brian Norris
2024-10-17 16:45   ` [v2,01/12] wifi: mwifiex: add missing locking for cfg80211 calls Kalle Valo
2024-09-18 11:10 ` [PATCH v2 02/12] wifi: mwifiex: fix MAC address handling Sascha Hauer
2024-10-04 23:15   ` Brian Norris [this message]
2024-10-05  8:55     ` Francesco Dolcini
2024-11-13 14:44     ` Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 03/12] wifi: mwifiex: deduplicate code in mwifiex_cmd_tx_rate_cfg() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 04/12] wifi: mwifiex: use adapter as context pointer for mwifiex_hs_activated_event() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 05/12] wifi: mwifiex: drop unnecessary initialization Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 06/12] wifi: mwifiex: make region_code_mapping_t const Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 07/12] wifi: mwifiex: pass adapter to mwifiex_dnld_cmd_to_fw() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 08/12] wifi: mwifiex: simplify mwifiex_setup_ht_caps() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 09/12] wifi: mwifiex: fix indention Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 10/12] wifi: mwifiex: make locally used function static Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 11/12] wifi: mwifiex: move common settings out of switch/case Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 12/12] wifi: mwifiex: drop asynchronous init waiting code Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZwB3FCdpL85yA2Si@google.com \
    --to=briannorris@chromium.org \
    --cc=francesco@dolcini.it \
    --cc=kernel@pengutronix.de \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=stable@vger.kernel.org \
    --cc=yu-hao.lin@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).