Received: by 10.223.185.116 with SMTP id b49csp5789425wrg; Tue, 27 Feb 2018 21:35:53 -0800 (PST) X-Google-Smtp-Source: AH8x225/SwcukEqATUDVUEqlGKgAD7pCQNYIJ80CpLmiJLfURnIIpWJe9S1elPsGR931jbqYYnnt X-Received: by 2002:a17:902:a607:: with SMTP id u7-v6mr16447873plq.367.1519796153751; Tue, 27 Feb 2018 21:35:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519796153; cv=none; d=google.com; s=arc-20160816; b=qB3oqK48t2SKrXKhv1xLIUomecaJyWLXpSYvbQMgkmARfM+mmNr/V1FaYUCwqy7FJ8 LRTKXx0CMuPJvWcWVEdXQCO3aUEBNrfoVD9/vxJ+4ZTjNaIu+w/30WiMAPvZYuGtt7z9 T770uYbTMlafMTdkB7IXkrDDn8jiDu0yRJRU6yfbIH3hGRzGfOCtr0MRCFfloaHFdAnv VbD9idJ94i++6ZV11hjitdcUXSZmmP3qckj8crXH6rjwhoQRPT9Ft4xQhm3KZ2H8motS R06n7xeg73jLVGTpSIfVrxzH/t0qTTDwLVXZx9kKgHJt6VmVwRuIdvpuUFk2eE/dfxgM 8KHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=dzn2wDkE6RQasDf8rTYe3/Hd+Uymay5JDPeCrBTPv1U=; b=rL2HgqUW9zmUh1G8v7G525s1TUU9xvkeWtlcBwGLev88qRSCySfIblUvo5maSMhacp hWH3HXcx1wcYnDC8lwDR07gKwniHh+VubU9kjazzj3X2Bd+stuI5tS6laq4zbTYLBWQu GC6H/SBRGXofEmfNvEx/vBbJTYc4PXQJ/g7IvJ5yLZA/dLomMoisk43Tmsw3JAXn3nPq Nnb/fKkwm5Ot9aSkREz4pW53JcodP8KkaKaxaihE9KKn2lPJExqJ0DbR4dHwz0jcSLVL eeqZIkW+MfWh0lqgFOXg7DW4aNMdy1kZSMpzMxbkLqPe5a+XVf/9TkO17ReKKmzYACZH KOTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=tWa/qSGM; dkim=fail header.i=@chromium.org header.s=google header.b=nAK5AIPi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5-v6si697495pls.800.2018.02.27.21.35.39; Tue, 27 Feb 2018 21:35:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=tWa/qSGM; dkim=fail header.i=@chromium.org header.s=google header.b=nAK5AIPi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751960AbeB1Fdd (ORCPT + 99 others); Wed, 28 Feb 2018 00:33:33 -0500 Received: from mail-vk0-f68.google.com ([209.85.213.68]:35001 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875AbeB1Fdb (ORCPT ); Wed, 28 Feb 2018 00:33:31 -0500 Received: by mail-vk0-f68.google.com with SMTP id b65so766781vka.2 for ; Tue, 27 Feb 2018 21:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dzn2wDkE6RQasDf8rTYe3/Hd+Uymay5JDPeCrBTPv1U=; b=tWa/qSGMU+eflQygo+pEe6QEzwT0tsmNxJfSXwzyAPP28ElHi01VDC5QbrEhWnvLf0 QMh1FkqpgMIEeYzRrFAhK1b8g+n3586UFp2uqugwSwexC2raUpiLV2RWAEyXeyWtcsVh GUZxaZm4O6B0TYqJ2EgG7iknu+lYMZ2+cIyc0AKDZAWAMkUosZI46k2swi8P0vN1STCc OEUOemj9yQk82uETEcBMUt5BCgBrayXwh2GQhT7XZ+oqcXxGXDpFOMDEk4qIIe0yIUiE C9SsRvF59rGLt/NKFjuVIXragENDw1nXdabCESt1SXKa92tNZBAkTxU5ydh93zkoU1ss x6QQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dzn2wDkE6RQasDf8rTYe3/Hd+Uymay5JDPeCrBTPv1U=; b=nAK5AIPiHw4QFZp1gQr2JUumlTbTMinNmAVUZjw6z8hdYWaIZnosBi2u4BW1GMO+GG 3oPPEavc8tWUjn5nN/RkJy1+QN0UxtQgWGdOSpsdkSR+X2uuWntZXC7BQDckrtutJEXV XD7GOqiN844Zc7evcDhhfD54ONBkp4SpTwnjs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dzn2wDkE6RQasDf8rTYe3/Hd+Uymay5JDPeCrBTPv1U=; b=puguSDMae5Vd0f+3w48Sj1LgrmjNa+6CScJtzMTlDaS59W3sXPcrRf2uePzHo7EgaU XHFYrgOD7Jlh8yM3F1wNnAuUdMVugm3lbj56mKZxK4Nop39OozDIvWWIYfTU9L1UyMo5 MThKf1dNf1dplStljEBYvvrKPj/x5xt9Cn78i8pm0Ivu4+BHLE+iJZlCZaXdtu/vfjsj ogtNxb8BO7NVYsyTZHF1V4+5hDsqWoOXr7BP4VpelwLdLRu25MXeltrMCeVNWDjwO6CT LNmXr0v0079qNhRkkuN2U/42SzumQEKyY9yxhdKXHSm0yTNBTX8aitxRfw9k803/HhLh uTVQ== X-Gm-Message-State: APf1xPDVdg0PTKpvddLYAQsTTq3/0Km4WNTMEBFrMak32KoymJe6Ys4W 1EOzGPs80rxc7pTTNlybMNDbstQoLKhuouzm4q/M2g== X-Received: by 10.31.196.131 with SMTP id u125mr12240895vkf.158.1519796010250; Tue, 27 Feb 2018 21:33:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.242.140 with HTTP; Tue, 27 Feb 2018 21:33:28 -0800 (PST) In-Reply-To: <20180228012802.GG14069@wotan.suse.de> References: <20180224024613.24078-1-mcgrof@kernel.org> <20180224024613.24078-8-mcgrof@kernel.org> <20180228012802.GG14069@wotan.suse.de> From: Kees Cook Date: Tue, 27 Feb 2018 21:33:28 -0800 X-Google-Sender-Auth: avcLit11JCD4fqr1i42a2WzdCTg Message-ID: Subject: Re: [PATCH v2 07/11] firmware: split firmware fallback functionality into its own file To: "Luis R. Rodriguez" , Greg KH Cc: Andrew Morton , Shuah Khan , Martin Fuzzey , Mimi Zohar , David Howells , pali.rohar@gmail.com, Takashi Iwai , arend.vanspriel@broadcom.com, =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , nbroeking@me.com, Vikram Mulukutla , stephen.boyd@linaro.org, Mark Brown , Dmitry Torokhov , David Woodhouse , Linus Torvalds , Abhay_Salunke@dell.com, bjorn.andersson@linaro.org, jewalt@lgsinnovations.com, LKML , "linux-fsdevel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 27, 2018 at 5:28 PM, Luis R. Rodriguez wrote: > On Tue, Feb 27, 2018 at 03:14:53PM -0800, Kees Cook wrote: >> On Fri, Feb 23, 2018 at 6:46 PM, Luis R. Rodriguez wrote: >> > The firmware fallback code is optional. Split that code out to help >> > distinguish the fallback functionlity from othere core firmware loader >> > features. This should make it easier to maintain and review code >> > changes. >> > >> > The reason for keeping the configuration onto a table which is built-in >> > if you enable firmware loading is so that we can later enable the kernel >> > after subsequent patches to tweak this configuration, even if the >> > firmware loader is modular. >> > >> > This introduces no functional changes. >> > >> > Signed-off-by: Luis R. Rodriguez >> > --- >> > drivers/base/Makefile | 4 +- >> > drivers/base/firmware_fallback.c | 661 +++++++++++++++++++++++++++ >> > drivers/base/firmware_fallback.h | 61 +++ >> > drivers/base/firmware_fallback_table.c | 29 ++ >> > drivers/base/firmware_loader.c | 803 +-------------------------------- >> > drivers/base/firmware_loader.h | 115 +++++ >> > 6 files changed, 874 insertions(+), 799 deletions(-) >> > create mode 100644 drivers/base/firmware_fallback.c >> > create mode 100644 drivers/base/firmware_fallback.h >> > create mode 100644 drivers/base/firmware_fallback_table.c >> > create mode 100644 drivers/base/firmware_loader.h >> >> Does it make sense to have a separate subdirectory for firmware >> instead? I did this _ stuff with lkdtm and have regretted it. (I'm >> likely going to make a subdirectory for it this cycle...) > > Sure, the only eyesore is that drivers/base/firmware.c what is that for? > > drivers/base/firmware_loader/ ok? Yeah? Seems fine to me. Greg, do you have thoughts on this? -Kees -- Kees Cook Pixel Security