diff options
author | Peter Jones <pjones@redhat.com> | 2016-02-08 14:48:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-16 08:41:37 -0700 |
commit | 44f21ed11c92f28b44fe283b8d0fd7899bc35430 (patch) | |
tree | 3f92880a120061900dbd079b44cac436044e82d6 /include | |
parent | c6d535a35f5a3e842e02d13f84a729ef98f20952 (diff) | |
download | lwn-44f21ed11c92f28b44fe283b8d0fd7899bc35430.tar.gz lwn-44f21ed11c92f28b44fe283b8d0fd7899bc35430.zip |
efi: Do variable name validation tests in utf8
commit 3dcb1f55dfc7631695e69df4a0d589ce5274bd07 upstream.
Actually translate from ucs2 to utf8 before doing the test, and then
test against our other utf8 data, instead of fudging it.
Signed-off-by: Peter Jones <pjones@redhat.com>
Acked-by: Matthew Garrett <mjg59@coreos.com>
Tested-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/efi.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index 2bc0ad78d058..06cce30161c2 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -769,8 +769,10 @@ struct efivars { * and we use a page for reading/writing. */ +#define EFI_VAR_NAME_LEN 1024 + struct efi_variable { - efi_char16_t VariableName[1024/sizeof(efi_char16_t)]; + efi_char16_t VariableName[EFI_VAR_NAME_LEN/sizeof(efi_char16_t)]; efi_guid_t VendorGuid; unsigned long DataSize; __u8 Data[1024]; @@ -832,7 +834,7 @@ int efivar_entry_iter(int (*func)(struct efivar_entry *, void *), struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid, struct list_head *head, bool remove); -bool efivar_validate(struct efi_variable *var, u8 *data, unsigned long len); +bool efivar_validate(efi_char16_t *var_name, u8 *data, unsigned long len); extern struct work_struct efivar_work; void efivar_run_worker(void); |