diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-31 15:26:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-31 15:26:05 -0400 |
commit | 7cc3afdf43ffb703db831292f3816d909fd44767 (patch) | |
tree | 9c9f4b9c1a880b4f8ec4fc44ef80b6568142756b /fs | |
parent | ad8946fbf913fff8671cbaee776d23c3d07173fa (diff) | |
parent | 204b0a1a4b92612c957a042df1a3be0e9cc79391 (diff) |
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 EFI changes from Ingo Molnar:
"The main changes:
- Add debug code to the dump EFI pagetable - Borislav Petkov
- Make 1:1 runtime mapping robust when booting on machines with lots
of memory - Borislav Petkov
- Move the EFI facilities bits out of 'x86_efi_facility' and into
efi.flags which is the standard architecture independent place to
keep EFI state, by Matt Fleming.
- Add 'EFI mixed mode' support: this allows 64-bit kernels to be
booted from 32-bit firmware. This needs a bootloader that supports
the 'EFI handover protocol'. By Matt Fleming"
* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (31 commits)
x86, efi: Abstract x86 efi_early calls
x86/efi: Restore 'attr' argument to query_variable_info()
x86/efi: Rip out phys_efi_get_time()
x86/efi: Preserve segment registers in mixed mode
x86/boot: Fix non-EFI build
x86, tools: Fix up compiler warnings
x86/efi: Re-disable interrupts after calling firmware services
x86/boot: Don't overwrite cr4 when enabling PAE
x86/efi: Wire up CONFIG_EFI_MIXED
x86/efi: Add mixed runtime services support
x86/efi: Firmware agnostic handover entry points
x86/efi: Split the boot stub into 32/64 code paths
x86/efi: Add early thunk code to go from 64-bit to 32-bit
x86/efi: Build our own EFI services pointer table
efi: Add separate 32-bit/64-bit definitions
x86/efi: Delete dead code when checking for non-native
x86/mm/pageattr: Always dump the right page table in an oops
x86, tools: Consolidate #ifdef code
x86/boot: Cleanup header.S by removing some #ifdefs
efi: Use NULL instead of 0 for pointer
...
Diffstat (limited to 'fs')
-rw-r--r-- | fs/efivarfs/file.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index 8dd524f32284..cdb2971192a5 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c | |||
@@ -21,7 +21,7 @@ static ssize_t efivarfs_file_write(struct file *file, | |||
21 | u32 attributes; | 21 | u32 attributes; |
22 | struct inode *inode = file->f_mapping->host; | 22 | struct inode *inode = file->f_mapping->host; |
23 | unsigned long datasize = count - sizeof(attributes); | 23 | unsigned long datasize = count - sizeof(attributes); |
24 | ssize_t bytes = 0; | 24 | ssize_t bytes; |
25 | bool set = false; | 25 | bool set = false; |
26 | 26 | ||
27 | if (count < sizeof(attributes)) | 27 | if (count < sizeof(attributes)) |
@@ -33,14 +33,9 @@ static ssize_t efivarfs_file_write(struct file *file, | |||
33 | if (attributes & ~(EFI_VARIABLE_MASK)) | 33 | if (attributes & ~(EFI_VARIABLE_MASK)) |
34 | return -EINVAL; | 34 | return -EINVAL; |
35 | 35 | ||
36 | data = kmalloc(datasize, GFP_KERNEL); | 36 | data = memdup_user(userbuf + sizeof(attributes), datasize); |
37 | if (!data) | 37 | if (IS_ERR(data)) |
38 | return -ENOMEM; | 38 | return PTR_ERR(data); |
39 | |||
40 | if (copy_from_user(data, userbuf + sizeof(attributes), datasize)) { | ||
41 | bytes = -EFAULT; | ||
42 | goto out; | ||
43 | } | ||
44 | 39 | ||
45 | bytes = efivar_entry_set_get_size(var, attributes, &datasize, | 40 | bytes = efivar_entry_set_get_size(var, attributes, &datasize, |
46 | data, &set); | 41 | data, &set); |