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-0004SU-W2 for mharc-grub-devel@gnu.org; Thu, 03 Dec 2020 10:02:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkq7p-0004OS-W8 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]:47432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkq7j-0001yR-6V for grub-devel@gnu.org; Thu, 03 Dec 2020 10:02:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607007739; 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; bh=07QrBEMii+qu3kozIPozT56idP0z1+UrkLKNd2dS1IE=; b=A/5W9emqjwLFmX2/bLQ+1V5qZoahuvQzcE2qR7Z0lH5PUZHMBUBIZZTKKMiqLh/U1Fd+5e EZPLJNyZLv4KkogH5OFzw82N82hDSwCUeLpjitBztjJ1R43M7twnRIzHGP0axT4cYOBIi9 +6BAytMWpBQAgcEVP9uxJxYgwxDDGJA= 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-125-CZzgX47_OquzNazNMxvaJQ-1; Thu, 03 Dec 2020 10:02:18 -0500 X-MC-Unique: CZzgX47_OquzNazNMxvaJQ-1 Received: by mail-wm1-f72.google.com with SMTP id a134so1415300wmd.8 for ; Thu, 03 Dec 2020 07:02:15 -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:mime-version :content-transfer-encoding; bh=07QrBEMii+qu3kozIPozT56idP0z1+UrkLKNd2dS1IE=; b=PrzW8BXpTTJS1O/d3ZmxoLQvQKTaCwePhZvOZ61A27+lsl2nmYCCJbvytWv+G37upO V0mESXsgQUnUL2NBwyTxeALj30C1CTQHwyxS6NfqvHEaVS4JOI6hjo+AlyiECGrcNfJl lcDoRgh3/wGVs9leIeBYDuZ/C6GAYaQha3B0joPj27OHKitlgrXvfNDlxYr5RvMv5ocm AK1K+/9dEwrFyH6BBCzJRFA4TmuFaJxzEXvUrFCBHKI6yUdE8y3ReSy1VxzLQZl1ZSNW EAauTmU6eJ0sQDgkLfDGMEVpp+R5bXGa2pMcqRXPUDxiK7kgkLJlq24hS6kndyN2AO8G 1qqQ== X-Gm-Message-State: AOAM532TcLH2oSZZOL8boUuc5qFRSJtJ01svOEYFJXlrbkNvtqC+uobE yJrsndtS4prWdH0EUJTOtTXkfCe2m4eHY3umUg4qWStALWyiX4E7f6fKhGrYmVZPainsr6wYD/D V0ec/rKH1qeD2qJ7ZhW5gqx1EqMJXQsP23/jglL0sW/KrEG3fggZmOtPI1DPlDg== X-Received: by 2002:a1c:a402:: with SMTP id n2mr3932563wme.185.1607007733860; Thu, 03 Dec 2020 07:02:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwa5EnNHvgv+FucQyuteCmr5x2/qNKNiz42/31WjFjru0SEm0mU1V+kq7REm162HGxA4ZTjqQ== X-Received: by 2002:a1c:a402:: with SMTP id n2mr3932528wme.185.1607007733593; Thu, 03 Dec 2020 07:02:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 07:02:12 -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 0/9] Add UEFI Secure Boot detection and report the status to Linux Date: Thu, 3 Dec 2020 16:01:41 +0100 Message-Id: <20201203150151.848077-1-javierm@redhat.com> X-Mailer: git-send-email 2.28.0 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 This patch series adds support for the GRUB to detect the UEFI Secure Boot status using the SecureBoot and SetupMode EFI variables. It also reports this to Linux by setting the .secure_boot field of struct boot_params. Besides that, it contains some cleanups and fixes mostly around EFI support. Best regards, Javier Daniel Kiper (5): efi: Make shim_lock GUID and protocol type public efi: Return grub_efi_status_t from grub_efi_get_variable() efi: Add a function to read EFI variables with attributes efi: Add secure boot detection loader/linux: Report the UEFI Secure Boot status to the Linux kernel Javier Martinez Canillas (4): i386: Don't include in coreboot and ieee1275 startup.S include/grub/i386/linux.h: Include missing header arm/term: Fix linking error due multiple ps2_state definitions efi: Only register shim_lock verifier if shim_lock protocol is found and SB enabled grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 1 + grub-core/commands/efi/efifwsetup.c | 8 +- grub-core/commands/efi/shim_lock.c | 28 ++----- grub-core/kern/efi/efi.c | 30 +++++-- grub-core/kern/efi/sb.c | 109 +++++++++++++++++++++++++ grub-core/kern/i386/coreboot/startup.S | 1 - grub-core/kern/i386/ieee1275/startup.S | 1 - grub-core/loader/i386/linux.c | 6 +- grub-core/term/arm/cros.c | 2 +- grub-core/term/arm/pl050.c | 2 +- grub-core/video/efi_gop.c | 2 +- include/grub/efi/api.h | 19 ++++- include/grub/efi/efi.h | 12 ++- include/grub/efi/sb.h | 40 +++++++++ include/grub/i386/linux.h | 10 ++- 16 files changed, 225 insertions(+), 47 deletions(-) create mode 100644 grub-core/kern/efi/sb.c create mode 100644 include/grub/efi/sb.h -- 2.28.0