From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kkq7t-0004SB-PB for mharc-grub-devel@gnu.org; Thu, 03 Dec 2020 10:02:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkq7o-0004OL-Mm for grub-devel@gnu.org; Thu, 03 Dec 2020 10:02:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkq7m-00020o-E2 for grub-devel@gnu.org; Thu, 03 Dec 2020 10:02:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607007745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mvUOaBfIQ7qo/Brsa/fRWxattLlqTuwoi8pYTPjrIIM=; b=QiStRP1xysFQ3lesNn3h5AiVmd80R62CNm4ht3qyJg4jPzwXQwwXZo6/jqB2ot/a9tVOsy teEgwaYxujimM8zK0+y0PX7fHAjYpajA3LZkCX3bNzhmw12EwLILIuNXCukserhAejs7IB pklK5eARQQ0TEex5yhW+6oxj9j933zM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-pTmrZoUGOEy6BDHrjOxCyQ-1; Thu, 03 Dec 2020 10:02:24 -0500 X-MC-Unique: pTmrZoUGOEy6BDHrjOxCyQ-1 Received: by mail-wm1-f72.google.com with SMTP id u123so1410868wmu.5 for ; Thu, 03 Dec 2020 07:02:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mvUOaBfIQ7qo/Brsa/fRWxattLlqTuwoi8pYTPjrIIM=; b=TFl4zLga+PLv+h7hzAL3c0u+jh4DYZ4jPsVpuhFlTcwKg5I98Gqqh1Oqc2VPTSbj/7 ys7H9slQ49n/Lxguc64r//BfkhZgeQqce/6yD26UviIqTL27sdYXQwfWVp+Ko61XVCyD wPhzx8mRO5bzoLvF/2Tc87A4OxRyya2x7CCZ8yuoJ+iRbcRe1lG3jQHNDvJq80wH8kiG 1EByjK+5pLabULtblBX4SdNz9Z1Cei78FrtiWCUOyDu+sIJVVKbWxZl4qcKFj0MdgCAO HnStMDJXxHfWmj96NLdGT5YdiS4sSkh9f3SQSo8BMJAQQBo9PZYVItp5lFWX4dN2iWr9 ogtw== X-Gm-Message-State: AOAM531e9V4B1eUMGCl8eiFRNGmM8BOoKZfI9qyz79VQIsKiKNJwbu4Z YCG8PCm7HTsro/okbuOyhUiM8qieWtfcoOgtJ6vJRjw8H6Aq7Ol9iXF2QFPuZqyXATx1CmTj9it mxRLun5S82CwpYWaDOUj7oLykbWSN19OnmBPTGGBWvhAHZEt2PEbQiRsWvxuXtQ== X-Received: by 2002:a7b:c19a:: with SMTP id y26mr3756366wmi.20.1607007742503; Thu, 03 Dec 2020 07:02:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEGZMRD+t9ROQIes+sUnOwnh2UFjKjYh0m/5rGWKWqvrL5Qjm6MWUF3ENqo2+KnPsbQZD2eA== X-Received: by 2002:a7b:c19a:: with SMTP id y26mr3756327wmi.20.1607007742265; Thu, 03 Dec 2020 07:02:22 -0800 (PST) Received: from minerva.redhat.com ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id n128sm1896759wmb.46.2020.12.03.07.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 07:02:21 -0800 (PST) From: Javier Martinez Canillas To: grub-devel@gnu.org Cc: Ignat Korchagin , Michael Chang , Peter Jones , Marco A Benatto , Leif Lindholm , Daniel Kiper , Javier Martinez Canillas Subject: [PATCH 4/9] efi: Make shim_lock GUID and protocol type public Date: Thu, 3 Dec 2020 16:01:45 +0100 Message-Id: <20201203150151.848077-5-javierm@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201203150151.848077-1-javierm@redhat.com> References: <20201203150151.848077-1-javierm@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=216.205.24.124; envelope-from=javierm@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.495, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2020 15:02:31 -0000 From: Daniel Kiper The GUID will be used to properly detect and report UEFI Secure Boot status to the x86 Linux kernel. The functionality will be added by subsequent patches. The shim_lock protocol type is made public for completeness. Additionally, fix formatting of four preceding GUIDs. Signed-off-by: Daniel Kiper Signed-off-by: Marco A Benatto Signed-off-by: Javier Martinez Canillas --- grub-core/commands/efi/shim_lock.c | 12 ------------ include/grub/efi/api.h | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/grub-core/commands/efi/shim_lock.c b/grub-core/commands/efi/shim_lock.c index 764098cfc83..d8f52d721c3 100644 --- a/grub-core/commands/efi/shim_lock.c +++ b/grub-core/commands/efi/shim_lock.c @@ -27,18 +27,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); -#define GRUB_EFI_SHIM_LOCK_GUID \ - { 0x605dab50, 0xe046, 0x4300, \ - { 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } \ - } - -struct grub_efi_shim_lock_protocol -{ - grub_efi_status_t - (*verify) (void *buffer, grub_uint32_t size); -}; -typedef struct grub_efi_shim_lock_protocol grub_efi_shim_lock_protocol_t; - static grub_efi_guid_t shim_lock_guid = GRUB_EFI_SHIM_LOCK_GUID; static grub_efi_shim_lock_protocol_t *sl; diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 1dcaa12f59e..39733585b58 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -321,22 +321,27 @@ #define GRUB_EFI_SAL_TABLE_GUID \ { 0xeb9d2d32, 0x2d88, 0x11d3, \ - { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ } #define GRUB_EFI_HCDP_TABLE_GUID \ { 0xf951938d, 0x620b, 0x42ef, \ - { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \ + { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \ } #define GRUB_EFI_DEVICE_TREE_GUID \ { 0xb1b621d5, 0xf19c, 0x41a5, \ - { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \ + { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \ } #define GRUB_EFI_VENDOR_APPLE_GUID \ { 0x2B0585EB, 0xD8B8, 0x49A9, \ - { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ + { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ + } + +#define GRUB_EFI_SHIM_LOCK_GUID \ + { 0x605dab50, 0xe046, 0x4300, \ + { 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } \ } struct grub_efi_sal_system_table @@ -1694,6 +1699,12 @@ struct grub_efi_block_io }; typedef struct grub_efi_block_io grub_efi_block_io_t; +struct grub_efi_shim_lock_protocol +{ + grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size); +}; +typedef struct grub_efi_shim_lock_protocol grub_efi_shim_lock_protocol_t; + #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \ || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) \ || defined(__riscv) -- 2.28.0