Skip to content

Commit c57dcb5

Browse files
rosslagerwallMatt Fleming
authored andcommitted
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>
1 parent bfbaafa commit c57dcb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/efivarfs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor,
121121
int len, i;
122122
int err = -ENOMEM;
123123

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

0 commit comments

Comments
 (0)