efivars: Respect "block" flag in efivar_entry_set_safe()
authorJann Horn <jannh@google.com>
Fri, 18 Feb 2022 18:05:59 +0000 (19:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:01:58 +0000 (19:01 +0100)
commita0261dc55c01c18e265d0796a2be7ca0c9429728
tree61d09e5135af1af7727c4d5e2b322cdf07b78002
parentb1ee6b9340a38bdb9e5c90f0eac5b22b122c3049
efivars: Respect "block" flag in efivar_entry_set_safe()

commit 258dd902022cb10c83671176688074879517fd21 upstream.

When the "block" flag is false, the old code would sometimes still call
check_var_size(), which wrongly tells ->query_variable_store() that it can
block.

As far as I can tell, this can't really materialize as a bug at the moment,
because ->query_variable_store only does something on X86 with generic EFI,
and in that configuration we always take the efivar_entry_set_nonblocking()
path.

Fixes: ca0e30dcaa53 ("efi: Add nonblocking option to efi_query_variable_store()")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220218180559.1432559-1-jannh@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efi/vars.c