Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp780019yba; Sat, 4 May 2019 12:40:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHiR58HmDWm465Vxc4pqCJKgUGFevUGNSFJIbHmMvkxqAMboyszSHWSl/FNmj/sdZmT0t0 X-Received: by 2002:a62:864a:: with SMTP id x71mr22327866pfd.228.1556998839973; Sat, 04 May 2019 12:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556998839; cv=none; d=google.com; s=arc-20160816; b=AZFjQGHVITOEsCgzhUwOHitAckQS9ak5mp7QXnXgOxBMob7O4jJERZ8bIyzVnVgycd V4FiOrTfvkFWlGSVTSO88ZEWf9tIbCjhsWkBr6QEd/RLxtE1bqaL3AsensRnzs9uG8Rd /C0oEiJxHbFqjEBBExvbJeSREgjqPwoEukFMhbORwlPaqFhutYGKIsV/+T203rdmoFjF Ff5h7krp8n1UZmZOd379OHbbZDsyAZyVMrtFQyXW3Db7QaX/9MGVGNPRIfMTMRXTpzE9 4E7f2w7uf7GeeEwmgD9mWX8gVuldBeTVqh8A4em0liMAic56C4TFnqcOL9v6fHPXFi6C MDjw== 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:to:subject:dkim-signature; bh=WcxhAgw8WDvU3ud152po/wV56qFlyq6ha4UCMPsuo1o=; b=n9RJaucNc4vYeX1EywrbR+yrn3k0FlkLPDoMyI8SSsyqd4y0t+IIiWC/EknHc1CX0p 1mqCYslG43myTDZ7807x3ejdaZkR2aGQdLbux4kkzdGtzMxVad1/uRL0ib244td5xqHa nxQJQ3sEZnJ4CDw/e9VhXmdijLHQQEASknA/9SwTWxawogO1phGiaAqPZx9eDrN/VxIb TpAvJRB9FXyuCB+5PY3gCjaEWhYG3K1+4Z39rUoAAJhbcLeXv5C+PabMgpUjZr9VEjK+ ixaj4BKUU6n12ar+efFWYhV7bXxmssiJCmGB13w0km6SCT02iWitGqZRSqhqB0hCVd01 XX9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=g3omv1xv; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si8457883pll.391.2019.05.04.12.40.06; Sat, 04 May 2019 12:40:39 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=g3omv1xv; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727372AbfEDTLM (ORCPT + 99 others); Sat, 4 May 2019 15:11:12 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44894 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbfEDTLL (ORCPT ); Sat, 4 May 2019 15:11:11 -0400 Received: by mail-ed1-f67.google.com with SMTP id b8so10134663edm.11 for ; Sat, 04 May 2019 12:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=WcxhAgw8WDvU3ud152po/wV56qFlyq6ha4UCMPsuo1o=; b=g3omv1xvZ8JG1O+yBpN9ylXgwt/WvBEQ6+qsh2OV9HpSDVEhCnNhg6qftQ2BfCrn7i D2nu3rqrXI9bIU/Lt5cU68YdRHr149kcV6dqetx0SYB3xkzKiPUg46s72hcAb0BxWEc1 nLmyC4uCMykptoeapyo1MOWO9WKlWB/HVvUaE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WcxhAgw8WDvU3ud152po/wV56qFlyq6ha4UCMPsuo1o=; b=L10LdUz4UJRok1MfP+mn5OJO9VsvuuMmR5d8z8OE0dPDIBDJ11jkFK+N229CsOi0Hv O1Q5nv4pnNwzFdhVaypUpM7pJdWGPNWEEKtsRrImALbcGPlkH5MKYWeWlxwe3IVjRjpz 1Afb2gfsuptM+al8b6/zY1lG3JD821tJWV6eDwURbfczRZPZLV0vzsPLxqWXXYYTMGdT HtTx0fWlnZOltAwxOJ9hGaw+deOKc4NdsO+7FL3ajrxuqx9q2VZygHI0h9gXFiFKtNac AnR3qixYJXCXzRbZXweGoGKb6hv3H0PV+sBDURNQ+y8P2ojeyS3k67c3I3C5C1kesFOE /b2w== X-Gm-Message-State: APjAAAXg8nlMkkAP0hP9yAsVpPOmWXwRz2H4a4A4+caa/dZNOY+ladLw Cdk3WtKmBXEoavxaUuuxGRx+NmPAuVvong== X-Received: by 2002:a17:906:1f53:: with SMTP id d19mr11978649ejk.12.1556997069734; Sat, 04 May 2019 12:11:09 -0700 (PDT) Received: from [192.168.178.129] (f140230.upc-f.chello.nl. [80.56.140.230]) by smtp.gmail.com with ESMTPSA id y12sm831873ejo.85.2019.05.04.12.11.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 May 2019 12:11:09 -0700 (PDT) Subject: Re: PROBLEM: brcmfmac's DMI-based fw file names break built-in fw loader To: Victor Bravo <1905@spmblk.com>, Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Kalle Valo , "David S. Miller" , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, linux-kernel@vger.kernel.org, Hans de Goede References: <20190504162633.ldrz2nqfocg55grb@localhost> From: Arend Van Spriel Message-ID: Date: Sat, 4 May 2019 21:11:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190504162633.ldrz2nqfocg55grb@localhost> 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 + Hans, Luis On 5/4/2019 6:26 PM, Victor Bravo wrote: > The brcmfmac driver seems to have partially fixed problems which > prevented it to be used in shared system/kernel images for multiple > hardware by trying to load it's .txt as > ...txt first and then > falling back to .txt. Real-life example: > > brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43340-sdio.ASUSTeK COMPUTER INC.-T100HAN.txt failed with > error -2 > brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43340-sdio for chip > BCM43340/2 > > Unfortunately this doesn't really help on systems which use static > kernel with firmware blobs (and also text configuration files in case of > brcmfmac) built-in using CONFIG_EXTRA_FIRMWARE, as CONFIG_EXTRA_FIRMWARE > doesn't support spaces in file names - kernel build fails with > > CONFIG_EXTRA_FIRMWARE="brcm/brcmfmac43340-sdio.bin brcm/brcmfmac43340-sdio.ASUSTeK COMPUTER INC.-T100HAN.txt" > > for obvious reasons. So the only way here is to stay with good old > brcmfmac43340-sdio.txt and support at most one brcmfmac-equipped machine > per kernel image. > > Please consider filtering the DMI strings and replacing spaces and > possibly other invalid characters with underscores, and/or adding module > parameter to allow passing the string from command line (using > brcmfmac.tag=t100 or brcmfmac.board=t100 to make the module load > brcmfmac43340-sdio.t100.txt seems nicer to me, and isn't prone to > breaking when DMI strings change on BIOS update). The intent of the DMI approach was to avoid end-users from passing module parameters for this. As to fixing DMI string usage patches are welcome. > My brief grep-based research also suggest that strings retrieved > by dmi_get_system_info() are passed to firmware loader without any > checks for special character, /../ etc. I'm not sure whether this is > considered to be proper & safe use, but if it's not, it may also have > some security implications, as it allows attacker with access to DMI > strings (using root rights/other OS/BIOS/physical access) to mess > with kernel space or secure boot. Hmm. Attackers with that kind of access can do bad is a gazillion ways. > I would also really appreciate not allowing future brcm (and other) > drivers to leave staging area before they fully support =y. Define fully support. At the time we moved into the wireless tree (almost a decade ago) we did support =y. As such you could consider the DMI approach a regression, but I find that a bit harsh to say. Hans made a honest attempt and it is something that can be fixed. It can be you providing just that ;-) Regards, Arend