All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip:x86/urgent] efivarfs: Ensure VariableName is NUL-terminated
@ 2015-05-06  7:33 tip-bot for Ross Lagerwall
  0 siblings, 0 replies; only message in thread
From: tip-bot for Ross Lagerwall @ 2015-05-06  7:33 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: stable, hpa, tglx, matt.fleming, mingo, jk, ross.lagerwall, mjg59

Commit-ID:  c57dcb566d3d866a302a1da2e06344bec31d5bcd
Gitweb:     http://git.kernel.org/tip/c57dcb566d3d866a302a1da2e06344bec31d5bcd
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Thu, 2 Apr 2015 08:39:00 +0100
Committer:  Matt Fleming <matt.fleming@intel.com>
CommitDate: Fri, 17 Apr 2015 15:41:13 +0100

efivarfs: Ensure VariableName is NUL-terminated

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@citrix.com>
Acked-by: Matthew Garrett <mjg59@coreos.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.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 ddbce42..acf9a67 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;
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-06  7:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06  7:33 [tip:x86/urgent] efivarfs: Ensure VariableName is NUL-terminated tip-bot for Ross Lagerwall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.