Skip to contentSkip to conversation

Patch "efi: Make our variable validation list include the guid" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Mar 1, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

efi: Make our variable validation list include the guid

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
efi-make-our-variable-validation-list-include-the-guid.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 8282f5d9c17fe15a9e658c06e3f343efae1a2a2f Mon Sep 17 00:00:00 2001

From: Peter Jones <[email protected]>
Date: Mon, 8 Feb 2016 14:48:14 -0500
Subject: efi: Make our variable validation list include the guid

From: Peter Jones <[email protected]>

commit 8282f5d9c17fe15a9e658c06e3f343efae1a2a2f upstream.

All the variables in this list so far are defined to be in the global namespace in the UEFI spec, so this just further ensures we're validating the variables we think we are.

Including the guid for entries will become more important in future patches when we decide whether or not to allow deletion of variables based on presence in this list.

---
 drivers/firmware/efi/efivars.c |    5 ++-
 drivers/firmware/efi/vars.c    |   52 ++++++++++++++++++++++++++---------------
 include/linux/efi.h            |    3 +-
 3 files changed, 38 insertions(+), 22 deletions(-)
drivers/firmware/efi/efivars.c +3 -2
@@ -221,7 +221,7 @@ sanity_check(struct efi_variable *var, e
 	}
 
 	if ((attributes & ~EFI_VARIABLE_MASK) != 0 ||
-	    efivar_validate(name, data, size) == false) {
+	    efivar_validate(vendor, name, data, size) == false) {
 		printk(KERN_ERR "efivars: Malformed variable content\n");
 		return -EINVAL;
 	}
@@ -447,7 +447,8 @@ static ssize_t efivar_create(struct file
 	}
 
 	if ((attributes & ~EFI_VARIABLE_MASK) != 0 ||
-	    efivar_validate(name, data, size) == false) {
+	    efivar_validate(new_var->VendorGuid, name, data,
+			    size) == false) {
 		printk(KERN_ERR "efivars: Malformed variable content\n");
 		return -EINVAL;
 	}
drivers/firmware/efi/vars.c +33 -19

80 lines not on this page · raw message

include/linux/efi.h +2 -1
@@ -1199,7 +1199,8 @@ int efivar_entry_iter(int (*func)(struct
 struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid,
 				       struct list_head *head, bool remove);
 
-bool efivar_validate(efi_char16_t *var_name, u8 *data, unsigned long len);
+bool efivar_validate(efi_guid_t vendor, efi_char16_t *var_name, u8 *data,
+		     unsigned long data_size);
 
 extern struct work_struct efivar_work;
 void efivar_run_worker(void);

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/efi-do-variable-name-validation-tests-in-utf8.patch queue-4.4/efi-make-our-variable-validation-list-include-the-guid.patch queue-4.4/efi-use-ucs2_as_utf8-in-efivarfs-instead-of-open-coding-a-bad-version.patch queue-4.4/efi-add-pstore-variables-to-the-deletion-whitelist.patch queue-4.4/efi-make-efivarfs-entries-immutable-by-default.patch queue-4.4/lib-ucs2_string-correct-ucs2-utf8-conversion.patch queue-4.4/lib-ucs2_string-add-ucs2-utf8-helper-functions.patch