1. 13 Apr, 2022 3 commits
    • Dov Murik's avatar
      virt: Add efi_secret module to expose confidential computing secrets · cbabf03c
      Dov Murik authored
      The new efi_secret module exposes the confidential computing (coco)
      EFI secret area via securityfs interface.
      
      When the module is loaded (and securityfs is mounted, typically under
      /sys/kernel/security), a "secrets/coco" directory is created in
      securityfs.  In it, a file is created for each secret entry.  The name
      of each such file is the GUID of the secret entry, and its content is
      the secret data.
      
      This allows applications running in a confidential computing setting to
      read secrets provided by the guest owner via a secure secret injection
      mechanism (such as AMD SEV's LAUNCH_SECRET command).
      
      Removing (unlinking) files in the "secrets/coco" directory will zero out
      the secret in memory, and remove the filesystem entry.  If the module is
      removed and loaded again, that secret will not appear in the filesystem.
      Signed-off-by: default avatarDov Murik <dovmurik@linux.ibm.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://lore.kernel.org/r/20220412212127.154182-3-dovmurik@linux.ibm.comSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      cbabf03c
    • Dov Murik's avatar
      efi: Save location of EFI confidential computing area · 12274189
      Dov Murik authored
      Confidential computing (coco) hardware such as AMD SEV (Secure Encrypted
      Virtualization) allows a guest owner to inject secrets into the VMs
      memory without the host/hypervisor being able to read them.
      
      Firmware support for secret injection is available in OVMF, which
      reserves a memory area for secret injection and includes a pointer to it
      the in EFI config table entry LINUX_EFI_COCO_SECRET_TABLE_GUID.
      
      If EFI exposes such a table entry, uefi_init() will keep a pointer to
      the EFI config table entry in efi.coco_secret, so it can be used later
      by the kernel (specifically drivers/virt/coco/efi_secret).  It will also
      appear in the kernel log as "CocoSecret=ADDRESS"; for example:
      
          [    0.000000] efi: EFI v2.70 by EDK II
          [    0.000000] efi: CocoSecret=0x7f22e680 SMBIOS=0x7f541000 ACPI=0x7f77e000 ACPI 2.0=0x7f77e014 MEMATTR=0x7ea0c018
      
      The new functionality can be enabled with CONFIG_EFI_COCO_SECRET=y.
      Signed-off-by: default avatarDov Murik <dovmurik@linux.ibm.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Link: https://lore.kernel.org/r/20220412212127.154182-2-dovmurik@linux.ibm.comSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      12274189
    • Javier Martinez Canillas's avatar
      efi: Allow to enable EFI runtime services by default on RT · a031651f
      Javier Martinez Canillas authored
      Commit d9f283ae ("efi: Disable runtime services on RT") disabled EFI
      runtime services by default when the CONFIG_PREEMPT_RT option is enabled.
      
      The rationale for that commit is that some EFI calls could take too much
      time, leading to large latencies which is an issue for Real-Time kernels.
      
      But a side effect of that change was that now is not possible anymore to
      enable the EFI runtime services by default when CONFIG_PREEMPT_RT is set,
      without passing an efi=runtime command line parameter to the kernel.
      
      Instead, let's add a new EFI_DISABLE_RUNTIME boolean Kconfig option, that
      would be set to n by default but to y if CONFIG_PREEMPT_RT is enabled.
      
      That way, the current behaviour is preserved but gives users a mechanism
      to enable the EFI runtimes services in their kernels if that is required.
      For example, if the firmware could guarantee bounded time for EFI calls.
      
      Also, having a separate boolean config could allow users to disable the
      EFI runtime services by default even when CONFIG_PREEMPT_RT is not set.
      Reported-by: default avatarAlexander Larsson <alexl@redhat.com>
      Fixes: d9f283ae ("efi: Disable runtime services on RT")
      Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
      Link: https://lore.kernel.org/r/20220331151654.184433-1-javierm@redhat.comSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      a031651f
  2. 03 Apr, 2022 8 commits
  3. 02 Apr, 2022 29 commits