[ 3.5.y.z extended stable ] Patch "x86, efi: Check max_size only if it is non-zero." has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Wed Jul 10 15:34:09 UTC 2013
This is a note to let you know that I have just added a patch titled
x86,efi: Check max_size only if it is non-zero.
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 4a720d95adb772fc1d8e5f4fb5378634f8d5b0a2 Mon Sep 17 00:00:00 2001
From: Richard Weinberger <richard at nod.at>
Date: Wed, 10 Apr 2013 10:59:34 +0200
Subject: [PATCH] x86,efi: Check max_size only if it is non-zero.
commit 7791c8423f1f7f4dad94e753bae67461d5b80be8 upstream.
Some EFI implementations return always a MaximumVariableSize of 0,
check against max_size only if it is non-zero.
My Intel DQ67SW desktop board has such an implementation.
Signed-off-by: Richard Weinberger <richard at nod.at>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
arch/x86/platform/efi/efi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index b8699b3..0eb3066 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -983,7 +983,12 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
if (status != EFI_SUCCESS)
return status;
- if (!storage_size || size > remaining_size || size > max_size ||
+ if (!max_size && remaining_size > size)
+ printk_once(KERN_ERR FW_BUG "Broken EFI implementation"
+ " is returning MaxVariableSize=0\n");
+
+ if (!storage_size || size > remaining_size ||
+ (max_size && size > max_size) ||
(remaining_size - size) < (storage_size / 2))
return EFI_OUT_OF_RESOURCES;
--
1.8.1.2
More information about the kernel-team
mailing list