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] [day] [month] [year] [list]
Message-ID: <CAF4BwTWJy7ct0xzAGBX7dGDKS7Y+rB6aHhkEan3+QYvV+OgQzA@mail.gmail.com>
Date:   Mon, 23 Oct 2023 07:34:55 -0400
From:   Daniel Berlin <dberlin@...rlin.org>
To:     Arend van Spriel <arend.vanspriel@...adcom.com>
Cc:     Arend van Spriel <aspriel@...il.com>,
        Franky Lin <franky.lin@...adcom.com>,
        Hante Meuleman <hante.meuleman@...adcom.com>,
        SHA-cyfmac-dev-list@...ineon.com,
        brcm80211-dev-list.pdl@...adcom.com, linux-kernel@...r.kernel.org,
        linux-wireless@...r.kernel.org
Subject: Re: [PATCH 1/1] [brcmfmac] Fix regulatory domain handling to reset
 bands properly

On Mon, Oct 23, 2023 at 4:38 AM Arend van Spriel
<arend.vanspriel@...adcom.com> wrote:
>
> On 10/21/2023 4:40 PM, Daniel Berlin wrote:
> > As an aside, the alternative would be to simply not ignore any
> > attempts to set the regulatory domain, regardless of whether it's 00
> > or the chip is already set to that country.
> > It doesn't happen that often, so it's not clear it's worth avoiding it at all.
> > There are some things i'd have to fix to make it work resiliently well
> > (for example, i know we set the 2g bw cap where we do because it has
> > to be done with the interface down), but i can fix those if needed.
>
> Please do not top post.
>
> The firmware has its own regulatory information (actually the CLM blob
> holds that information) which is independent of the wireless regulatory
> database in the kernel. As such trying to configure country '00' will
> simply fail as it is not known inside CLM blob.
>
> The firmware needs a
> country abbreviation *and* a revision. Hence we require a mapping of
> country code to <abbrev,rev> tuple. If that mapping is not in place we
> bail out setting the country in the regulatory notifier.
>
>  From the description below it is not clear what problem is fixed here
> in terms of user experience.


As far as the stack and kernel are concerned, it gets stuck in the
custom regulatory domain ('99') and sets the max power levels,
bandwidth caps, etc in the capabilities to match.

If you look at the phy info, it will clearly show you this.
You are correct that the chip maintains its own view of power levels
(though most drivers set them, we do not), but the bandwidth caps are
respected, for example.
Note also that '00' is recognized by at least this firmware, though I
agree it depends on whether/what is done in the CLM blob.

All that said, even if it changed nothing in the chip itself, it would
still be displaying completely wrong info to the user.
I'm happy to update the description if that is your main concern.


>
> Regards,
> Arend
>
> > On Thu, Oct 19, 2023 at 10:18 AM Daniel Berlin <dberlin@...rlin.org> wrote:
> >>
> >> Currently, we ignore the default country in the reg notifier.
> >> We also register a custom regulatory domain, which is set
> >> as the default.
> >> As a result, the chip is likely to be set to the correct country,
> >> but the regulatory domain will not match it.
> >>
> >> When the regulatory notifier is then called, we see the countries
> >> are the same and do not change anything, even though the domain
> >> is wrong.
> >>
> >> This patch forces us to reset the bands on the first country change
> >> even if the chip is already set to that country.
> >>
> >> We also restore the original band info before reconstructing channel
> >> info, as the new regdom power limits may be higher than what is
> >> currently set.
> >>
> >> Signed-off-by: Daniel Berlin <dberlin@...rlin.org>
> >> ---
> >>   .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 38 +++++++++++++++----
> >>   .../broadcom/brcm80211/brcmfmac/cfg80211.h    |  2 +
> >>   2 files changed, 33 insertions(+), 7 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ