[3.13.y.z extended stable] Patch "efi-pstore: Fix an overflow on 32-bit builds" has been added to staging queue
Kamal Mostafa
kamal at canonical.com
Tue Jul 15 21:30:02 UTC 2014
This is a note to let you know that I have just added a patch titled
efi-pstore: Fix an overflow on 32-bit builds
to the linux-3.13.y-queue branch of the 3.13.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.13.y-queue
This patch is scheduled to be released in version 3.13.11.5.
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.13.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
------
>From c5a1fd5cb29ab73f06bd39f8e255ab28b088a66b Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <andrew.zaborowski at intel.com>
Date: Mon, 9 Jun 2014 16:50:40 +0200
Subject: efi-pstore: Fix an overflow on 32-bit builds
commit 783ee43118dc773bc8b0342c5b230e017d5a04d0 upstream.
In generic_id the long int timestamp is multiplied by 100000 and needs
an explicit cast to u64.
Without that the id in the resulting pstore filename is wrong and
userspace may have problems parsing it, but more importantly files in
pstore can never be deleted and may fill the EFI flash (brick device?).
This happens because when generic pstore code wants to delete a file,
it passes the id to the EFI backend which reinterpretes it and a wrong
variable name is attempted to be deleted. There's no error message but
after remounting pstore, deleted files would reappear.
Signed-off-by: Andrew Zaborowski <andrew.zaborowski at intel.com>
Acked-by: David Rientjes <rientjes at google.com>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
drivers/firmware/efi/efi-pstore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
index 4b9dc83..e992abc 100644
--- a/drivers/firmware/efi/efi-pstore.c
+++ b/drivers/firmware/efi/efi-pstore.c
@@ -40,7 +40,7 @@ struct pstore_read_data {
static inline u64 generic_id(unsigned long timestamp,
unsigned int part, int count)
{
- return (timestamp * 100 + part) * 1000 + count;
+ return ((u64) timestamp * 100 + part) * 1000 + count;
}
static int efi_pstore_read_func(struct efivar_entry *entry, void *data)
--
1.9.1
More information about the kernel-team
mailing list