]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - include/linux/efi.h
efi: Add nonblocking option to efi_query_variable_store()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 1 Feb 2016 22:06:58 +0000 (22:06 +0000)
committerIngo Molnar <mingo@kernel.org>
Wed, 3 Feb 2016 10:31:04 +0000 (11:31 +0100)
commitca0e30dcaa53a3fcb2dfdf74252d30bc40603eea
treeff97b9475eaeca4fb8007dc1ba10836fe4f21373
parentd3cac1f83c631b9fe5edaebcba49f6989bfff089
efi: Add nonblocking option to efi_query_variable_store()

The function efi_query_variable_store() may be invoked by
efivar_entry_set_nonblocking(), which itself takes care to only
call a non-blocking version of the SetVariable() runtime
wrapper. However, efi_query_variable_store() may call the
SetVariable() wrapper directly, as well as the wrapper for
QueryVariableInfo(), both of which could deadlock in the same
way we are trying to prevent by calling
efivar_entry_set_nonblocking() in the first place.

So instead, modify efi_query_variable_store() to use the
non-blocking variants of QueryVariableInfo() (and give up rather
than free up space if the available space is below
EFI_MIN_RESERVE) if invoked with the 'nonblocking' argument set
to true.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/1454364428-494-5-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/platform/efi/quirks.c
drivers/firmware/efi/vars.c
include/linux/efi.h