[3.19.y-ckt stable] Patch "efivarfs: Ensure VariableName is NUL-terminated" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Thu May 21 20:36:57 UTC 2015


This is a note to let you know that I have just added a patch titled

    efivarfs: Ensure VariableName is NUL-terminated

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue

This patch is scheduled to be released in version 3.19.8-ckt1.

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.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 64b1f1bb912246219faf90002f6cdf452df5beaf Mon Sep 17 00:00:00 2001
From: Ross Lagerwall <ross.lagerwall at citrix.com>
Date: Thu, 2 Apr 2015 08:39:00 +0100
Subject: efivarfs: Ensure VariableName is NUL-terminated

commit c57dcb566d3d866a302a1da2e06344bec31d5bcd upstream.

Some buggy firmware implementations update VariableNameSize on success
such that it does not include the final NUL character which results in
garbage in the efivarfs name entries.  Use kzalloc on the efivar_entry
(as is done in efivars.c) to ensure that the name is always
NUL-terminated.

The buggy firmware is:
BIOS Information
        Vendor: Intel Corp.
        Version: S1200RP.86B.02.02.0005.102320140911
        Release Date: 10/23/2014
        BIOS Revision: 4.6
System Information
        Manufacturer: Intel Corporation
        Product Name: S1200RP_SE

Signed-off-by: Ross Lagerwall <ross.lagerwall at citrix.com>
Acked-by: Matthew Garrett <mjg59 at coreos.com>
Cc: Jeremy Kerr <jk at ozlabs.org>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 fs/efivarfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 6dad117..7b9efb9 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -121,7 +121,7 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor,
 	int len, i;
 	int err = -ENOMEM;

-	entry = kmalloc(sizeof(*entry), GFP_KERNEL);
+	entry = kzalloc(sizeof(*entry), GFP_KERNEL);
 	if (!entry)
 		return err;

--
1.9.1





More information about the kernel-team mailing list