Ard Biesheuvel ca0e30dcaa 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>
2016-02-03 11:31:04 +01:00
..
2016-01-21 19:36:08 +01:00
2015-06-25 11:49:31 +03:00
2015-10-17 21:22:08 -07:00
2015-10-07 18:08:15 +01:00
2016-01-18 12:10:45 -08:00
2016-01-05 18:04:58 +01:00
2015-11-16 15:41:49 +00:00
2016-01-20 18:42:30 -08:00
2015-05-13 12:04:55 -05:00
2016-01-13 09:26:40 -08:00
2015-12-23 08:37:10 -07:00
2015-08-03 12:01:54 -04:00
2015-12-22 09:38:34 -07:00
2015-12-06 12:46:31 +01:00
2015-10-07 16:02:49 -07:00
2015-09-04 16:54:41 -07:00
2016-01-30 13:35:32 -08:00
2015-10-18 10:14:39 -07:00
2015-10-31 19:05:59 -04:00
2016-01-08 01:12:06 +01:00
2015-10-30 01:47:27 -04:00
2015-06-24 17:49:45 -07:00
2015-05-12 10:46:53 +02:00
2015-12-28 13:41:50 +01:00
2016-01-15 17:56:32 -08:00
2015-05-05 13:40:42 -06:00
2015-11-25 09:22:00 -07:00
2015-10-23 05:44:28 -07:00
2016-01-20 17:09:18 -08:00
2015-10-01 15:06:43 +02:00
2015-12-14 10:03:46 +01:00
2015-06-25 12:06:45 +02:00
2015-07-28 08:50:42 +01:00
2016-01-15 17:56:32 -08:00
2016-01-15 17:56:32 -08:00
2015-04-29 17:17:17 -05:00
2015-11-23 09:44:58 +01:00
2016-01-15 17:56:32 -08:00
2015-10-27 18:55:31 -07:00
2015-06-24 17:49:41 -07:00
2015-12-04 22:46:26 +01:00
2015-10-20 22:10:45 +08:00
2015-07-21 10:39:05 -07:00
2016-01-21 11:52:16 -08:00
2015-06-25 04:20:04 -04:00
2016-01-14 16:08:23 -08:00
2016-01-14 16:08:23 -08:00
2016-01-04 13:19:55 -05:00
2015-07-01 19:40:18 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2016-01-22 17:02:18 -08:00
2016-01-21 11:52:16 -08:00
2016-01-31 09:10:19 -08:00
2016-01-15 17:56:32 -08:00
2016-01-07 14:31:27 -05:00
2015-10-06 17:08:19 +02:00
2015-10-22 08:59:18 -07:00
2015-11-16 09:23:47 +01:00
2015-05-26 15:23:23 +02:00
2016-01-15 17:56:32 -08:00
2015-06-25 01:13:43 +02:00
2016-01-10 22:13:15 -05:00
2015-12-13 19:59:48 -08:00
2016-01-04 16:11:11 -05:00
2016-01-04 10:20:19 -05:00
2015-11-13 21:53:18 -08:00
2015-06-25 17:00:39 -07:00
2015-11-05 14:36:09 -05:00
2016-01-15 22:34:39 +01:00
2015-08-17 11:25:28 -07:00
2015-10-01 09:57:59 -07:00
2015-10-19 01:01:21 +02:00
2015-11-23 09:44:58 +01:00
2015-12-21 15:28:11 -07:00
2016-01-12 20:47:02 +02:00
2016-01-15 17:56:32 -08:00
2016-01-14 16:00:49 -08:00
2015-12-03 07:24:29 -08:00
2015-09-08 15:35:28 -07:00