diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2020-01-03 14:39:37 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-01-10 20:55:01 +0300 |
commit | ffc2760bcf2dba0dbef74013ed73eea8310cc52c (patch) | |
tree | c8a4f99f6254a3e6a52582b7400fd791a65f09d6 /include/linux/goldfish.h | |
parent | 6cfcd6f001b42fdbe6948cd113a5024945a8f50f (diff) | |
download | linux-ffc2760bcf2dba0dbef74013ed73eea8310cc52c.tar.xz |
efi/x86: Map the entire EFI vendor string before copying it
Fix a couple of issues with the way we map and copy the vendor string:
- we map only 2 bytes, which usually works since you get at least a
page, but if the vendor string happens to cross a page boundary,
a crash will result
- only call early_memunmap() if early_memremap() succeeded, or we will
call it with a NULL address which it doesn't like,
- while at it, switch to early_memremap_ro(), and array indexing rather
than pointer dereferencing to read the CHAR16 characters.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Matthew Garrett <mjg59@google.com>
Cc: linux-efi@vger.kernel.org
Fixes: 5b83683f32b1 ("x86: EFI runtime service support")
Link: https://lkml.kernel.org/r/20200103113953.9571-5-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/goldfish.h')
0 files changed, 0 insertions, 0 deletions