From mboxrd@z Thu Jan 1 00:00:00 1970 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 DE1EFC433F5 for ; Tue, 2 Nov 2021 08:04:03 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51DED61050 for ; Tue, 2 Nov 2021 08:04:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 51DED61050 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF51C8350D; Tue, 2 Nov 2021 09:04:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="n0ri1EOv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9961783383; Tue, 2 Nov 2021 09:03:58 +0100 (CET) Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 734D983383 for ; Tue, 2 Nov 2021 09:03:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-il1-x130.google.com with SMTP id s14so3735110ilv.10 for ; Tue, 02 Nov 2021 01:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hOFI7Wjx+xUzcmIcT2nQ6N/rCB7mxWpwl9p1rpKMf98=; b=n0ri1EOvfOHLhvBbuZEgLDiGIkbSfjsQWTc2G8h2Ch1kwqYriIM1R8zwVeNx+hV1BG W3I0GVVACBwg7kxFXNjoX6FalZQrMX2VhnUOrrSm8QNsyPom6O3+wltWu7Fyq2LVEGtU MZDEZMfBQi5DGmKTZlDd9APv/YvX+/QqCQYJ5YEmT4R1rciBnN0t+IIhPkLzKdnF6IUU fw3oAlT7p6eaY3CRVeC83vKBOVAT2efGN6kR78qctDf0TcU3zqEeKC1R3tuiFz+zMWmF /GfLP/pYkHhzoCWYoD95EnCL7um6563SlLj5QDadcCGHzWjyhTb/a+8L8i+NiYqNysa8 z0CA== 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=hOFI7Wjx+xUzcmIcT2nQ6N/rCB7mxWpwl9p1rpKMf98=; b=VtZxGmU8tpgntrbGg1/EkszFTRb5jM1VRh5Df8GiKS1BWgJLM5crleuey744wkYqlp o2mcf7AleY2H+ikYfIJSyqfZ+4QvGzVARf7BTH9t12QURoLDRRuIz/iW+tVVp279ASD3 34RqLWTlte3LuQV3rqBESGlbjm6ddhxxpY4VmgLLldz+DCH/ivM9B5ZhJgiIU2SMqGUk g/90sdmek/zvZ71+sswGfWJuPmyqnJAWh+nwjNm5f0zQHAxV6FueAcX2KR6ou9FKDCB8 XiqZHAP68I1XBiBjvIsOAK7iKCBfddeUVWvDpAFbtLKbnL0i5Itg2ygAN+A2IWfZILT2 UbhA== X-Gm-Message-State: AOAM533/ATpxXbiB1MpyNPSgRTTz+dKusJGRHINkWybVqvjNONoHTeeP qad4Sb3nIJx64/nyXuKQep2UN2/qigbb5cDOtt7HZg== X-Google-Smtp-Source: ABdhPJw7b379vMLcIeYbeoF2ztbOCaEEUKhc3r6TJ+JhgQiwksR/zCKR0XoKFv4l9Jvp+YpDZk2Ion6lHXmeqBVHlc8= X-Received: by 2002:a92:c26f:: with SMTP id h15mr14276991ild.72.1635840233147; Tue, 02 Nov 2021 01:03:53 -0700 (PDT) MIME-Version: 1.0 References: <20211022112426.25009-1-masahisa.kojima@linaro.org> In-Reply-To: From: Masahisa Kojima Date: Tue, 2 Nov 2021 17:03:41 +0900 Message-ID: Subject: Re: [PATCH 0/2] add selftest for EFI_TCG2_PROTOCOL and Measured Boot To: Simon Glass Cc: U-Boot Mailing List , Heinrich Schuchardt , Ilias Apalodimas Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Simon, On Mon, 25 Oct 2021 at 04:54, Simon Glass wrote: > > Hi Masahisa, > > On Fri, 22 Oct 2021 at 05:23, Masahisa Kojima > wrote: > > > > This patch series adds the selftest for the EFI_TCG2_PROTOCOL and > > Measured Boot flow. > > This selftest is verified on qemu with swtpm. > > Is this in CI? Where are the instructions for doing this? Not yet included in CI. For the instructions, Ilias is preparing the documentation at: https://github.com/apalos/u-boot/commit/6edcf3c02996edf8c50a38632aac1091f8bcbf0b > > I have expressed my preference for expanding the in-tree emulator to > handle this. For the measured boot selftest, I need to access the efi internal data such as SMBIOS table, that is why I chose the C based efi_selftest. Tcg2 efi_selftest does not rely on the specific TPM backend. Thanks, Masahisa Kojima > > Regards, > Simon > > > > > > This covers most of the functionalities, but there are some > > limitations and TODO items. > > > > [Limitation] > > - tcg2 selftest must run at the beginning of the efi_selftest because > > some measurement occurs in efi_tcg2_register() and boottime->image_load(). > > Need to configure the efi_selftest with "setenv efi_selftest tcg2; bootefi selftest" > > - Skip ExitBootService measurement test > > - EFI application can not read PCR after calling ExitBootService > > - Skip EventLog Validation > > - Measured Boot measures U-Boot version, so EventLog varies every build having > > different commit hash. > > - Skip PCR[0] validation > > - PCR[0] include U-Boot version measurement, this value varies every build > > having different commit hash. > > - Skip PCR[7] validation > > - Secure Boot Variables can not be updated through efi_selftest. > > - The initial PCR value of PCR[17 - 22] is all 0xff, I'm not sure > > it is expected or not. > > > > [TODO] > > - GPT measurement test > > - Secure Boot Variable test > > - Eventlog validation > > > > Masahisa Kojima (2): > > efi_loader: add missing const qualifier > > efi_selftest: add selftest for EFI_TCG2_PROTOCOL and Measured Boot > > > > include/efi_api.h | 2 +- > > lib/efi_loader/efi_boottime.c | 5 +- > > lib/efi_selftest/Makefile | 10 + > > .../efi_selftest_miniapp_measuredboot.c | 93 ++ > > lib/efi_selftest/efi_selftest_tcg2.c | 804 +++++++++++++++++- > > 5 files changed, 910 insertions(+), 4 deletions(-) > > create mode 100644 lib/efi_selftest/efi_selftest_miniapp_measuredboot.c > > > > -- > > 2.17.1 > >