Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3893379yba; Tue, 7 May 2019 08:40:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+ZF39+iUjvOOVs9jsSWHJqB2eF8AZE8+cXwngdIxz8I9HQae4Y5yAP9ZJtJfwUJwH227D X-Received: by 2002:a62:e50a:: with SMTP id n10mr42348702pff.55.1557243651203; Tue, 07 May 2019 08:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557243651; cv=none; d=google.com; s=arc-20160816; b=MzecAvI7IRP3K37pL8LH54vIUhydPmOzZuFPtenmf1vtyvilEqV5QjvTE9NZmz7rhp i6jYf67D1HalJLrrpKWx2eTzBS9tQCXaxCzzBhk9TzxAsMS4fMdWVWT4s8wFQaKxp8qd K3FjSjyE7IPbpR6ULgbJIRY//+qmubRxZE3olE03FBFVCKNScRHnUBb5GjQZ64ahKON/ cwASdH8Gs8a3rdak1iEQxVLJOoTAEGNvj9XJ1hiVxPLdzvTYnBXaqrJJkJP3ZLPaWMd4 Hiq0GEKO4w6pktTN2P+heLps09cY2BD91MBezMcMsAiYmAgjk5YS8te0Qs7De7SuT0V5 zU7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lhOeBJyYPj/2xFqOsRFr3svYvc4ZmMF8TMLQhzpX+Nk=; b=lasY0Zh6OdlzsehLvbDwHJ2CYt2u+7dmwM5/mRYHyFE7ktGZChQoet8kc7Q+l0Z8b5 hMZ+PJvdgXE//O8BtYiNn6uCaBE8rFYcXJ4iWTfKMG3J2vjl+373dFLtNDIi4ptuLjN7 3N62sSwbdtEI/harwLJanZFKULRG6bnUoSfsfNfjC+1YfKKMgGi5Ls7mt0WtPoyR1d1v jIfakBVjrSODttvZ6cPb+A8h0kHU4QMfS71Nsz7/fYYH80O0QVnxxXMBh4tcloQUUWmL lky6x4g3rT7qPTMBQvIKAO9E4/zPVvPOzrR5H9zV+KDS/2JyQWXxMa3awITbmRMtlq/Y OS2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si18611728pgp.463.2019.05.07.08.40.24; Tue, 07 May 2019 08:40:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbfEGPi4 (ORCPT + 99 others); Tue, 7 May 2019 11:38:56 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:40770 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726521AbfEGPiz (ORCPT ); Tue, 7 May 2019 11:38:55 -0400 Received: by mail-ed1-f67.google.com with SMTP id e56so19145065ede.7 for ; Tue, 07 May 2019 08:38:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lhOeBJyYPj/2xFqOsRFr3svYvc4ZmMF8TMLQhzpX+Nk=; b=qrBg/CyZNzogJVti+AME9cpjw07t4syLPF/59xwO2SDyGLJwlRv0Flh9E+0DKCJwtg dGzGJ7bXC3zFdxC/tVw3eLJVgvvAUz5LH4r2N21zxuWEdEgIYMUY3uqb4c+dJVSvyHeM bfi/M0fV4UDqobDLpK2m6ED53N4h7GW1SC0V9BRPpIFBr12ll0f4XwSfNpsGj5p9DsWA swN0A+39diomTtES6AL7NH811MbKXaweNti2Nz3nFCDFJeamV83N50Ci2+sx02rMUCb/ PYcxuQS2v0SqI3Uq6JHBOy/AzJ930LaQOxNkMGHiVeSGSx28d29faGUZtjdO3qc2qfzI a7cQ== X-Gm-Message-State: APjAAAXnXEUAojCBP3sQseSIBoa2vUfz1HHeaNA7+0Ccjw8imQ237jQU MlrOcBUC396Y3zc9Fn7x4X7uAQ== X-Received: by 2002:a50:97d2:: with SMTP id f18mr33311946edb.130.1557243533683; Tue, 07 May 2019 08:38:53 -0700 (PDT) Received: from shalem.localdomain (84-106-84-65.cable.dynamic.v4.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id a61sm4240118edf.8.2019.05.07.08.38.52 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 08:38:52 -0700 (PDT) Subject: Re: [PATCH RFC] brcmfmac: sanitize DMI strings v2 To: Arend Van Spriel , Victor Bravo <1905@spmblk.com>, Kalle Valo Cc: Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , "David S. Miller" , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, linux-kernel@vger.kernel.org, Luis Chamberlain References: <20190504194440.4zcxjrtj2aft3ka4@localhost> <16a87149068.2764.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> <20190505150355.3fbng4ny34x255vk@localhost> <0f75a3d4-94af-5503-94c3-e8af2364448d@redhat.com> <20190506090609.msudhncj7e5vdtzw@localhost> <70677dff-4336-28d5-7ab9-7ba7c3d74ebc@redhat.com> <20190506102032.3ximjecado4mz62j@localhost> <87d0kvvkej.fsf@codeaurora.org> <20190506152441.ifjcdi73elxuq5it@localhost> <3f3cca6e-50b7-c61d-4a62-26ce508af9e7@redhat.com> <95cd81ea-3970-92de-7983-5c1919e2bbd9@broadcom.com> From: Hans de Goede Message-ID: <02a6dc11-7def-7d72-4640-d9d42ccec47c@redhat.com> Date: Tue, 7 May 2019 17:38:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <95cd81ea-3970-92de-7983-5c1919e2bbd9@broadcom.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 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