efi: Add tee-based EFI variable driverWhen the flash is not owned by the non-secure world, accessing the EFIvariables is straight-forward and done via EFI Runtime VariableServices. In this case,
efi: Add tee-based EFI variable driverWhen the flash is not owned by the non-secure world, accessing the EFIvariables is straight-forward and done via EFI Runtime VariableServices. In this case, critical variables for system integrity andsecurity are normally stored in the dedicated secure storage and canonly be manipulated directly from the secure world.Usually, small embedded devices don't have the special dedicated securestorage. The eMMC device with an RPMB partition is becoming more common,and we can use this RPMB partition to store the EFI Variables.The eMMC device is typically owned by the non-secure world (Linux in ourcase). There is an existing solution utilizing eMMC RPMB partition forEFI Variables, it is implemented by interacting with TEE (OP-TEE in thiscase), StandaloneMM (as EFI Variable Service Pseudo TA), eMMC driver andtee-supplicant. The last piece is the tee-based variable access driverto interact with TEE and StandaloneMM.So let's add the kernel functions needed.This feature is implemented as a kernel module. StMM PTA hasTA_FLAG_DEVICE_ENUM_SUPP flag when registered to OP-TEE so that thistee_stmm_efi module is probed after tee-supplicant starts, since"SetVariable" EFI Runtime Variable Service requires to interact withtee-supplicant.Acked-by: Sumit Garg <[email protected]>Co-developed-by: Ilias Apalodimas <[email protected]>Signed-off-by: Ilias Apalodimas <[email protected]>Signed-off-by: Masahisa Kojima <[email protected]>Signed-off-by: Ard Biesheuvel <[email protected]>
show more ...