From patchwork Fri Sep 3 01:55:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 506466 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp594386jai; Thu, 2 Sep 2021 18:54:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJhfj6PCWlGnd/Euhq4OjfZRtEg+mrAyE3IFR5K/jtZl1kAqLAl7CtGA4usZdbNNsDmVck X-Received: by 2002:a05:6402:1779:: with SMTP id da25mr1354168edb.200.1630634082966; Thu, 02 Sep 2021 18:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630634082; cv=none; d=google.com; s=arc-20160816; b=ezWuZI2O+739NO8fMNCNJLalN+YdGZtFO2dbBg/FkE0m+YSUojX42BF29CRXOXAVMQ cAbIJVckdf42lvG919m8h47GPFRnK4qnodxv28KPw6NleybgwwJUio/sRXko2SW/FUYD rxI148UsmbrciKeKcGutljx49iqwIT8nbbRMWpxV0ACCHB0BtOZJgCrnYy9yq6iW7oLZ VfeaRcSwmvx/S3V40u9K8x3JD3aM8TT84R/vOUIQQc3F3SgA3WvmJh/vncpBKmhTqdzj sVKfwyMJh4+oMTGqy1K8k4K3kQ4vlbr7/kb03sQy0AFkIQOwfVNoim3TuGvVaONEormg 4Zsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=2q6LYLIy26DSv9lc4lY9hrB8jIQ6aKlOoaRXoPoYM1M=; b=jJ7rrBkcn9+a1eG8kajnQ+/V+1P1bBs6u91hFNTppcfDemEUb/7P6CRcEiYLNkcowq ymZHPmpgUeC2OxQUYdkqyAasN12hcUUB0RQatrtZ2aBx3nkgFRJO3YEIQGBGB5dyY5tZ xiHN8SYwxHHTGEVut+tiC/Dht2NXleZGcilj4kDRc8nsF/lxOPzjlslLT2nZU/PYqLrZ fycj2wnDfTcSqwPnOWPpDIZZanKoS6FWBk16xjDPcFL5/lrSD95u0DLVN1M6mzmYJVIM oUoOFAeqoOd2mYCpqJ5KizXjuiEriq8n6741WYD7o1Oa+0GC77xHzUeGOBP1yOP27O5b r6VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VWd/OiHF"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id ar10si3313832ejc.418.2021.09.02.18.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 18:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VWd/OiHF"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 058F0834F1; Fri, 3 Sep 2021 03:54:24 +0200 (CEST) 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="VWd/OiHF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 82D6A800AA; Fri, 3 Sep 2021 03:54:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (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 B3D20834BA for ; Fri, 3 Sep 2021 03:54:12 +0200 (CEST) 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-pg1-x52c.google.com with SMTP id q68so3974590pga.9 for ; Thu, 02 Sep 2021 18:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=2q6LYLIy26DSv9lc4lY9hrB8jIQ6aKlOoaRXoPoYM1M=; b=VWd/OiHFE0iyP8a+d5+Ks88ofj3jzNvdkpJ/rQwB5fk0Q9CTGnUUcQcIbdDggd9v57 sO5DtahCXM1OvoRMs2Sw4k1ZZGRD7SNh2Ezvpmjpcdrz9FKuJbV+w7n7CgLFsxJ2lTo9 jIV2k3dBjr/9P6YWvE0jubsAsNNvZ7oFi6OwZ9GpZ12zcrXG+AO/9DqD4yx2NCRpV0ni 015Q1L6Svw56E1bEyrQJq9We6XnhRIuB20FMNi7in9QPKr7x3g3y7keS+JRjqBuk9FUv O48F/KOIEv4tE17lM5MBDe5HH1ouMNkhSVOJRvEMQXdAROFg3VH0I9lt9WlvStHEUd7X 6WQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=2q6LYLIy26DSv9lc4lY9hrB8jIQ6aKlOoaRXoPoYM1M=; b=YXdcHp5WTETMjkAro5GXT/j+XWkGelMJBtX6+mtDuqFhYXNhLp9ovlhIEtZR9SwIeM l+rh9APxDfA0XDXgCQ9VjBYaxaKVXkNUf9KdRrAz1n8y3mHCsXDatlM0m73RN9eAuTT5 PiaQIMVIWlZ5D4r/MAAipcADpCDPo6ppDwvuI0HgqMXp3QXljo1ojOW4+pDsanhOdjrI WAenxOtQanSba+05tqoRGHhUflvchGNFab3j6gR2X42yWg5e+YC5kphKYhUIX8Kbz9E0 Ao16EcmXDaQTRLa27MUGLkrm3yH6mF0tEqGZrAQvRORWe3AlVSYDfw2AWrX/16V7xarw fiiw== X-Gm-Message-State: AOAM5333o4ooXGVbae0/br9xEkcemn2DUjL7czHygO1964IYdbzLulWm IAHbmYOJDk/+0kQp9T5LkM5/3Q== X-Received: by 2002:a05:6a00:98f:b0:40c:96c5:b4fd with SMTP id u15-20020a056a00098f00b0040c96c5b4fdmr1142394pfg.0.1630634051066; Thu, 02 Sep 2021 18:54:11 -0700 (PDT) Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id g37sm4182198pgl.94.2021.09.02.18.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 18:54:10 -0700 (PDT) From: Masahisa Kojima To: Heinrich Schuchardt , Alexander Graf , Ilias Apalodimas , Simon Glass , AKASHI Takahiro , u-boot@lists.denx.de Subject: [PATCH 2/3] efi_loader: fix boot_service_capability_min calculation Date: Fri, 3 Sep 2021 10:55:51 +0900 Message-Id: <20210903015552.17180-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210903015552.17180-1-masahisa.kojima@linaro.org> References: <20210903015552.17180-1-masahisa.kojima@linaro.org> 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 TCG EFI Protocol Specification requires to the input ProtocolCapability.Size < size of the EFI_TCG2_BOOT_SERVICE_CAPABILITY up to and including the vendor ID field. Current implementation does different calculation, let's fix it. Signed-off-by: Masahisa Kojima --- include/efi_tcg2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Ilias Apalodimas Reviewed-by: Heinrich Schuchardt diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h index b6b958da51..45788d55d5 100644 --- a/include/efi_tcg2.h +++ b/include/efi_tcg2.h @@ -127,8 +127,8 @@ struct efi_tcg2_boot_service_capability { efi_tcg_event_algorithm_bitmap active_pcr_banks; }; +/* up to and including the vendor ID(manufacture_id) field */ #define boot_service_capability_min \ - sizeof(struct efi_tcg2_boot_service_capability) - \ offsetof(struct efi_tcg2_boot_service_capability, number_of_pcr_banks) #define TCG_EFI_SPEC_ID_EVENT_SIGNATURE_03 "Spec ID Event03"