• Ard Biesheuvel's avatar
    efi: libstub: check Shim mode using MokSBStateRT · 5f56a74c
    Ard Biesheuvel authored
    We currently check the MokSBState variable to decide whether we should
    treat UEFI secure boot as being disabled, even if the firmware thinks
    otherwise. This is used by shim to indicate that it is not checking
    signatures on boot images. In the kernel, we use this to relax lockdown
    policies.
    
    However, in cases where shim is not even being used, we don't want this
    variable to interfere with lockdown, given that the variable may be
    non-volatile and therefore persist across a reboot. This means setting
    it once will persistently disable lockdown checks on a given system.
    
    So switch to the mirrored version of this variable, called MokSBStateRT,
    which is supposed to be volatile, and this is something we can check.
    
    Cc: <stable@vger.kernel.org> # v4.19+
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
    Reviewed-by: default avatarPeter Jones <pjones@redhat.com>
    5f56a74c
secureboot.c 1.66 KB