summaryrefslogtreecommitdiff
path: root/lib/variables.c
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2021-06-30 16:34:51 +0800
committerPeter Jones <pjones@redhat.com>2021-09-07 17:05:04 -0400
commitb1fead0f7c9a09634057317a7bd2a5c94258e5df (patch)
tree570921d2d074b9809fac4b44a116e0243f5bcfaf /lib/variables.c
parente13ac7386ea425c9222e05a2f9879d5af5cb91f6 (diff)
downloadefi-boot-shim-b1fead0f7c9a09634057317a7bd2a5c94258e5df.tar.gz
efi-boot-shim-b1fead0f7c9a09634057317a7bd2a5c94258e5df.zip
mok: delete the existing RT variables only when only_first=TRUE
For the firmware without the variable writing issues, MOK variables are mirrored when only_first=TRUE. However, LibDeleteVariable() was called in maybe_mirror_one_mok_variable() when only_first=FALSE, and this could delete MOK variables that were just mirrored in the first round. This bug was hidden since LibDeleteVariable() deletes BS+RT+NV variables while we mirror MOK variables as BS+RT, and the firmware refused to delete the mirrored MOK variable due to mismatching attributes. However, some firmwares, such as VMWare, didn't enforce the attribute check and just deleted the variables with matched name and GUID. In such system, MokListRT was always removed before it reached OS. Fixes: https://github.com/rhboot/shim/issues/386 Signed-off-by: Gary Lin <glin@suse.com>
Diffstat (limited to 'lib/variables.c')
0 files changed, 0 insertions, 0 deletions