aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Lagerwall <ross.lagerwall@citrix.com>2015-04-02 03:39:00 -0400
committerMatt Fleming <matt.fleming@intel.com>2015-04-17 10:41:13 -0400
commitc57dcb566d3d866a302a1da2e06344bec31d5bcd (patch)
treedcfff9f237c2d3d6d82ccecbeee230f1756119ce
parentbfbaafae8519d82d10da6abe75f5766dd5b20475 (diff)
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>
-rw-r--r--fs/efivarfs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index ddbce42548c9..acf9a67f6770 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,
121 int len, i; 121 int len, i;
122 int err = -ENOMEM; 122 int err = -ENOMEM;
123 123
124 entry = kmalloc(sizeof(*entry), GFP_KERNEL); 124 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
125 if (!entry) 125 if (!entry)
126 return err; 126 return err;
127 127