linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Arend Van Spriel <arend.vanspriel@broadcom.com>,
	Victor Bravo <1905@spmblk.com>, Kalle Valo <kvalo@codeaurora.org>
Cc: Franky Lin <franky.lin@broadcom.com>,
	Hante Meuleman <hante.meuleman@broadcom.com>,
	Chi-Hsien Lin <chi-hsien.lin@cypress.com>,
	Wright Feng <wright.feng@cypress.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	brcm80211-dev-list@cypress.com, linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: Re: [PATCH RFC] brcmfmac: sanitize DMI strings v2
Date: Tue, 7 May 2019 17:38:51 +0200	[thread overview]
Message-ID: <02a6dc11-7def-7d72-4640-d9d42ccec47c@redhat.com> (raw)
In-Reply-To: <95cd81ea-3970-92de-7983-5c1919e2bbd9@broadcom.com>

Hi,

On 06-05-19 21:30, Arend Van Spriel wrote:
> + Luis (for real this time)
> 
> On 5/6/2019 6:05 PM, Hans de Goede wrote:
>> Hi,
>>
>> On 06-05-19 17:24, Victor Bravo wrote:
>>> On Mon, May 06, 2019 at 03:26:28PM +0300, Kalle Valo wrote:
>>>> Hans de Goede <hdegoede@redhat.com> writes:
>>>>
>>>>> If we're going to do some filtering, then I suggest we play it safe and also
>>>>> disallow other chars which may be used as a separator somewhere, specifically
>>>>> ':' and ','.
>>>>>
>>>>> Currently upstream linux-firmware has these files which rely on the DMI
>>>>> matching:
>>>>>
>>>>> brcmfmac4330-sdio.Prowise-PT301.txt
>>>>> brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt
>>>>> brcmfmac43430a0-sdio.ONDA-V80 PLUS.txt
>>>>>
>>>>> The others are either part of the DMI override table for devices with unsuitable
>>>>> DMI strings like "Default String"; or are device-tree based.
>>>>>
>>>>> So as long as we don't break those 3 (or break the ONDA one but get a symlink
>>>>> in place) we can sanitize a bit more then just non-printable and '/'.
>>>>>
>>>>> Kalle, Arend, what is your opinion on this?
>>>>>
>>>>> Note I do not expect the ONDA V80 Plus to have a lot of Linux users,
>>>>> but it definitely has some.
>>>>
>>>> To me having spaces in filenames is a bad idea, but on the other hand we
>>>> do have the "don't break existing setups" rule, so it's not so simple. I
>>>> vote for not allowing spaces, I think that's the best for the long run,
>>>> but don't know what Arend thinks.
> 
> Hi,
> 
> Had a day off today so I did see some of the discussion, but was not able to chime in until now.
> 
> To be honest I always disliked spaces in filenames, but that does not necessarily make it a bad idea. What I would like to know is why built-in firmware can not deal with spaces in the firmware file names. I think Hans mentioned it in the thread and it crossed my mind as well last night. From driver perspective, being brcmfmac or any other for that matter, there is only one API to request firmware and in my opinion it should behave the same no matter where the firmware is coming from. I would prefer to fix that for built-in firmware, but we need to understand where this limitation is coming 
> from. Hopefully Luis can elaborate on that.

Ok.


>>> I have found a fresh judicate on this:
>>> https://lkml.org/lkml/2018/12/22/221
>>>
>>> It seems clear that we have to support at least spaces for some time
>>> (maybe wih separate config option which will be deprecated but on by
>>> defaut until old files are considered gone).
>>
>> Ah that issue, well that is not really comparable in that case a lot of
>> peoples setups were completely broken by that commit and it was a
>> quite surprising behavior change in a userspace facing API.
>>
>> The nvram loading path already does 2 tries, I really don't want to
>> unnecessary complicate it with a third try.
>>
>> The Onda V80 Plus is a X86 based Windows / Android dual boot tablet,
>> as said before I do not expect a ton of users to be running regular
>> Linux on it.
>>
>> Given Kalle's clear preference for getting rid of the spaces lets
>> just do that. But first we must get a symlink added to linux-firmware
>> using the name with the _, newer kernels requiring a newer linux-firmware
>> to match is not unheard of AFAIK, so combined with the limited amount
>> of users I think this is a reasonable compromise.
> 
> Right. In the brcm folder we have bcm4329-fullmac-4.bin for older kernels and brcmfmac4329-sdio.bin for later kernels when we switched to stricter firmware naming convention.
> 
>> Kalle, do you agree with getting the symlink added to linux-firmware
>> ASAP as a fix for the V80 Plus issue; or do you want to see a fallback
>> to the un-cleaned name as you suggested before ?
> 
> How many releases have an issue and how many V80 Plus users running regular linux are actually using built-in firmware. And is it really a regression for them? Not saying it does not require fixing. However, as stated above I would prefer to fix the built-in firmware limitation if possible and backport that fix if it is only a few kernel releases provided stable allows such a backport.

The issue is not V80 Plus users running regular linux with built-in firmware.
The issue is that the 5.0+ kernel + a new enough linux-firmware will just
work on the V80 Plus, since linux-firmware contains a nvram file for the V80 Plus,
with the space in the name.

So if we replace the space with an _ then things will stop working for those
users. But we can avoid this by adding a compat symlink to linux-firmware, then
users will require a new linux-firmware together with the new kernel, but that
is not unheard of.

As for how many users / releases. Users who have a fresh Fedora 30 install or
a fresh install of a rolling-release distro may rely on things working ootb.

Users with an older Linux install will have manually added the nvram using
the non board specific name to get things to work, so I expect things to
stay working for them.

So taking the group of people putting regular Linux on a V80 Plus
and then taking the cross-section of the group with users with a very recent
install, I expect the amount of affected users to be very small and both
Fedora and rolling-release updates update linux-firmware regularly.

So IMHO we should be fine with the sanitizing of the DMI strings, combined
with pushing a compat patch to linux-firmware.

Regards,

Hans




> 
> Regards,
> Arend

  reply	other threads:[~2019-05-07 15:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 16:26 PROBLEM: brcmfmac's DMI-based fw file names break built-in fw loader Victor Bravo
2019-05-04 19:11 ` Arend Van Spriel
2019-05-04 19:44   ` Victor Bravo
2019-05-05  8:20     ` Arend Van Spriel
2019-05-05 14:36       ` Victor Bravo
2019-05-05 14:48       ` [PATCH RFC] brcmfmac: sanitize DMI strings Victor Bravo
2019-05-05 14:52         ` Victor Bravo
2019-05-05 15:03       ` [PATCH RFC] brcmfmac: sanitize DMI strings v2 Victor Bravo
2019-05-06  8:13         ` Hans de Goede
2019-05-06  8:42           ` Kalle Valo
2019-05-06  9:14             ` Victor Bravo
2019-05-06 12:29               ` Kalle Valo
2019-05-06 14:06                 ` Victor Bravo
2019-05-06  9:06           ` Victor Bravo
2019-05-06  9:33             ` Hans de Goede
2019-05-06 10:20               ` Victor Bravo
2019-05-06 10:34                 ` Hans de Goede
2019-05-06 12:26                   ` Kalle Valo
2019-05-06 15:24                     ` Victor Bravo
2019-05-06 16:05                       ` Hans de Goede
2019-05-06 19:30                         ` Arend Van Spriel
2019-05-07 15:38                           ` Hans de Goede [this message]
2019-05-13  9:21                             ` Arend Van Spriel
2019-05-06  8:44         ` Kalle Valo

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=02a6dc11-7def-7d72-4640-d9d42ccec47c@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=1905@spmblk.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211-dev-list@cypress.com \
    --cc=chi-hsien.lin@cypress.com \
    --cc=davem@davemloft.net \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=wright.feng@cypress.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).