LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH RESEND] efivarfs: Ensure VariableName is NUL-terminated
@ 2015-04-02  7:39 Ross Lagerwall
  2015-04-02 18:28 ` Matthew Garrett
  2015-04-06 18:39 ` Matt Fleming
  0 siblings, 2 replies; 3+ messages in thread
From: Ross Lagerwall @ 2015-04-02  7:39 UTC (permalink / raw)
  To: linux-efi
  Cc: Matthew Garrett, Jeremy Kerr, Matt Fleming, linux-kernel, Ross Lagerwall

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>
---
 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;
 
-- 
2.1.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] efivarfs: Ensure VariableName is NUL-terminated
  2015-04-02  7:39 [PATCH RESEND] efivarfs: Ensure VariableName is NUL-terminated Ross Lagerwall
@ 2015-04-02 18:28 ` Matthew Garrett
  2015-04-06 18:39 ` Matt Fleming
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2015-04-02 18:28 UTC (permalink / raw)
  To: Ross Lagerwall; +Cc: linux-efi, Jeremy Kerr, Matt Fleming, linux-kernel

On Thu, 2015-04-02 at 08:39 +0100, Ross Lagerwall wrote:
> 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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] efivarfs: Ensure VariableName is NUL-terminated
  2015-04-02  7:39 [PATCH RESEND] efivarfs: Ensure VariableName is NUL-terminated Ross Lagerwall
  2015-04-02 18:28 ` Matthew Garrett
@ 2015-04-06 18:39 ` Matt Fleming
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Fleming @ 2015-04-06 18:39 UTC (permalink / raw)
  To: Ross Lagerwall
  Cc: linux-efi, Matthew Garrett, Jeremy Kerr, Matt Fleming, linux-kernel

On Thu, 02 Apr, at 08:39:00AM, Ross Lagerwall wrote:
> 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>
> ---
>  fs/efivarfs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied with Matthew's ACK!

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-06 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02  7:39 [PATCH RESEND] efivarfs: Ensure VariableName is NUL-terminated Ross Lagerwall
2015-04-02 18:28 ` Matthew Garrett
2015-04-06 18:39 ` Matt Fleming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).