Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5816C433F5 for ; Thu, 11 Nov 2021 11:46:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 900E361268 for ; Thu, 11 Nov 2021 11:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233140AbhKKLtp (ORCPT ); Thu, 11 Nov 2021 06:49:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbhKKLtn (ORCPT ); Thu, 11 Nov 2021 06:49:43 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D17BC061766; Thu, 11 Nov 2021 03:46:54 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id bu18so13620343lfb.0; Thu, 11 Nov 2021 03:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9tM59iHxbjBy1nj5+saeMd6teAXT6q3TU+sgxUry514=; b=CIUmnieQoR1hCQLeHpZ5ND64jwPZyhb9sw95MlDQ5eOLhYH6rLx8k/XO4GZaU5pC0J yntni+AKB7XU+Yrs5cvLym76/9dofICQFBblyVecCUXdcxGO0PIrx2BL9b/Qnb/JTKaJ PtoteIt5y1jDyAdXRMudJGTFpcc0IXrx+CjgYQIC2ETL1asJE9BPI+1wLncFb3LtQbLl yOobghDPOAc0D1PSD4bCiJS13CitRo/gUVcLsRo8yTyV6cUMargeKtyVTgdVbQpYgt7O KNnswWufIic9guBst16ge/hh8eLlpQ7+QCfjGpW4e748WSXxPMSjzdkTCvPD2xHqou2V LAZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9tM59iHxbjBy1nj5+saeMd6teAXT6q3TU+sgxUry514=; b=4rvdfdte7VoJ4OfG5v3NpA9vdrdxqsUT71EhOM5aMxQKHkbI0LgqvH0B2KxzopRuYc 0ZrCXuTZUjHfNvWLbG1BUVCowAtDM7azaxy/0q5OGvtcqQX8Ej7/xmwmkvvnx8Y3RUKq uRlrHUNKSEIZLl+WSmHUIfIOGCPvK9k/y7wJ6xftNfOLdMD5N1q6HdaNRrQJrj57l9H3 a40u5Oih4KooAEVGsnM0h2B4a7uMAkFes1k7fm5XeNsCDdFcN3FWAoWrmcswvpou4M5i wFRavkDPMSwtoxAlF6tunXcBgS4/DtSpW51pILNYRkwBztVhvZji6+KnJ4OCofslxuWf E5tw== X-Gm-Message-State: AOAM530p+HAGnD5oHYPRZqMd6PM3KpUEZdzI2p37P4XNxd+uPhQkF9xt SaDBfuh0kv7Ar3mXc7t0OygHw06NJ/ZfKZCjxXUQDylkRc0= X-Google-Smtp-Source: ABdhPJxtFSfBVWazykokLpoBlAsxF3sPUki/hnXcuN7tS/9f15DbmBvhRTrjP6XvBP35W2yEZ5p4suuvkrTDTYHvC9g= X-Received: by 2002:a19:740a:: with SMTP id v10mr6081459lfe.179.1636631212426; Thu, 11 Nov 2021 03:46:52 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Hughes Date: Thu, 11 Nov 2021 11:46:39 +0000 Message-ID: Subject: Re: [PATCH] firmware: export x86_64 platform flash bios region via sysfs To: Mika Westerberg Cc: Hans-Gert Dahmen , Mauro Lima , Andy Shevchenko , Greg KH , "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , Philipp Deppenwiese , "platform-driver-x86@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Nov 2021 at 10:33, Mika Westerberg wrote: > OK, I see from your patch that it uses the direct mapped read-only > region to read this data. Sorry for the delay in replying here. What I like about Hans-Gert's patch is that it's always going to work on x64 -- if the system firmware isn't available at that offset then the platform just isn't going to boot. It's super simple, and means we can read out the hugely complex UEFI blob without asking the user to turn off kernel lockdown and secure boot so we can run the security verification tools. At the moment we're in this strange situation where we ask the user to cripple their platform security to run the platform security tools. > Do we know what information exactly fwupd needs? I mean exposing all of > this might not be good idea from security perspective (but I'm not an > expert). Ideally, fwupd needs the entire IFD partition which contains all the EFI File Volumes. We already parse these when the user is booting without secure boot using the Intel SPI controller and doing *evil* hacks to make the PCI device visible. The reason we want to parse the BIOS can be explained pretty easily; at startup we look at the TPM PCRs and we know very quickly and easily if the system firmware event has changed. If the checksum changed, then the firmware was modified in some way. However, saying to the user that "checksum changed" isn't useful at all. What we want to do is say something like "an EFI binary called RootKitz.efi was added" or "the AmiTcgPlatformPeiAfterMem.efi binary changed" and actually report what was done. At the moment we can do this, but not if /dev/mem cannot be used. > However, we can perhaps expose some of it through intel-spi, > and make that work so that distros can enable it safely. I think, if we're being honest, that Intel has no plans to make intel-spi available as a RO interface of any sort. There's some sort of hardware errata or misdesign that nobody can mention that makes the RO access unsafe. I think it's probably more than missing arbitration. Richard