aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 19:17:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 19:17:42 -0500
commite3c4877de8b9d93bd47b6ee88eb594b1c1e10da5 (patch)
tree17ade3a3a13b1e7768abe3561b6808dc4980a5f6 /arch/x86/boot
parent18a44a7ff1075ce5157ac07cde573aca6b5e9973 (diff)
parent6b59e366e074d3962e04f01efb8acc10a33c0e1e (diff)
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86/EFI changes from Peter Anvin: - Improve the initrd handling in the EFI boot stub by allowing forward slashes in the pathname - from Chun-Yi Lee. - Cleanup code duplication in the EFI mixed kernel/firmware code - from Satoru Takeuchi. - efivarfs bug fixes for more strict filename validation, with lots of input from Al Viro. * 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, efi: remove duplicate code in setup_arch() by using, efi_is_native() efivarfs: guid part of filenames are case-insensitive efivarfs: Validate filenames much more aggressively efivarfs: Use sizeof() instead of magic number x86, efi: Allow slash in file path of initrd
Diffstat (limited to 'arch/x86/boot')
-rw-r--r--arch/x86/boot/compressed/eboot.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index f8fa41190c35..c205035a6b96 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -19,23 +19,28 @@
19 19
20static efi_system_table_t *sys_table; 20static efi_system_table_t *sys_table;
21 21
22static void efi_char16_printk(efi_char16_t *str)
23{
24 struct efi_simple_text_output_protocol *out;
25
26 out = (struct efi_simple_text_output_protocol *)sys_table->con_out;
27 efi_call_phys2(out->output_string, out, str);
28}
29
22static void efi_printk(char *str) 30static void efi_printk(char *str)
23{ 31{
24 char *s8; 32 char *s8;
25 33
26 for (s8 = str; *s8; s8++) { 34 for (s8 = str; *s8; s8++) {
27 struct efi_simple_text_output_protocol *out;
28 efi_char16_t ch[2] = { 0 }; 35 efi_char16_t ch[2] = { 0 };
29 36
30 ch[0] = *s8; 37 ch[0] = *s8;
31 out = (struct efi_simple_text_output_protocol *)sys_table->con_out;
32
33 if (*s8 == '\n') { 38 if (*s8 == '\n') {
34 efi_char16_t nl[2] = { '\r', 0 }; 39 efi_char16_t nl[2] = { '\r', 0 };
35 efi_call_phys2(out->output_string, out, nl); 40 efi_char16_printk(nl);
36 } 41 }
37 42
38 efi_call_phys2(out->output_string, out, ch); 43 efi_char16_printk(ch);
39 } 44 }
40} 45}
41 46
@@ -709,7 +714,12 @@ static efi_status_t handle_ramdisks(efi_loaded_image_t *image,
709 if ((u8 *)p >= (u8 *)filename_16 + sizeof(filename_16)) 714 if ((u8 *)p >= (u8 *)filename_16 + sizeof(filename_16))
710 break; 715 break;
711 716
712 *p++ = *str++; 717 if (*str == '/') {
718 *p++ = '\\';
719 *str++;
720 } else {
721 *p++ = *str++;
722 }
713 } 723 }
714 724
715 *p = '\0'; 725 *p = '\0';
@@ -737,7 +747,9 @@ static efi_status_t handle_ramdisks(efi_loaded_image_t *image,
737 status = efi_call_phys5(fh->open, fh, &h, filename_16, 747 status = efi_call_phys5(fh->open, fh, &h, filename_16,
738 EFI_FILE_MODE_READ, (u64)0); 748 EFI_FILE_MODE_READ, (u64)0);
739 if (status != EFI_SUCCESS) { 749 if (status != EFI_SUCCESS) {
740 efi_printk("Failed to open initrd file\n"); 750 efi_printk("Failed to open initrd file: ");
751 efi_char16_printk(filename_16);
752 efi_printk("\n");
741 goto close_handles; 753 goto close_handles;
742 } 754 }
743 755