grub/grub-core/loader
Michael Chang 4868e17507 chainloader: Fix gcc9 error -Waddress-of-packed-member
The address of fp->path_name could be unaligned since seeking into the
device path buffer for a given node could end in byte boundary.

The fix is using aligned buffer allocated by grub_malloc for receiving
the converted UTF16 string by grub_utf8_to_utf16 and also the processing
after. The resulting string then gets copied to fp->path_name.

[  243s] ../../grub-core/loader/efi/chainloader.c: In function 'copy_file_path':
[  243s] ../../grub-core/loader/efi/chainloader.c:136:32: error: taking address of packed member of 'struct grub_efi_file_path_device_path' may result in an unaligned pointer value [-Werror=address-of-packed-member]
[  243s]   136 |   size = grub_utf8_to_utf16 (fp->path_name, len * GRUB_MAX_UTF16_PER_UTF8,
[  243s]       |                              ~~^~~~~~~~~~~
[  243s] ../../grub-core/loader/efi/chainloader.c:138:12: error: taking address of packed member of 'struct grub_efi_file_path_device_path' may result in an unaligned pointer value [-Werror=address-of-packed-member]
[  243s]   138 |   for (p = fp->path_name; p < fp->path_name + size; p++)
[  243s]       |            ^~

Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-04-23 11:37:08 +02:00
..
arm arm: Move initrd upper to leave more space for kernel 2019-02-06 11:34:07 +01:00
arm64 efi: Rename armxx to arch 2019-02-25 11:28:44 +01:00
efi chainloader: Fix gcc9 error -Waddress-of-packed-member 2019-04-23 11:37:08 +02:00
i386 Change fs functions to add fs_ prefix 2019-04-09 10:03:29 +10:00
ia64/efi verifiers: IA-64 fallout cleanup 2019-03-20 11:38:28 +01:00
mips verifiers: MIPS fallout cleanup 2019-03-20 11:38:28 +01:00
powerpc/ieee1275 verifiers: PowerPC fallout cleanup 2019-03-20 11:38:28 +01:00
riscv RISC-V: Add Linux load logic 2019-02-25 11:33:06 +01:00
sparc64/ieee1275 arm-uboot, ia64, sparc64: Fix up grub_file_open() calls 2018-11-16 14:42:51 +01:00
aout.c Implement automatic module license checking according to new GNU 2011-04-11 23:01:51 +02:00
linux.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00
lzss.c Add LZSS Mach-O support (needed for new xnu kernelcache). 2012-02-29 13:26:13 +01:00
macho.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00
macho32.c * grub-core/loader/machoXX.c: Fix compilation on non-i386. 2013-12-17 22:44:46 +01:00
macho64.c * grub-core/loader/machoXX.c: Fix compilation on non-i386. 2013-12-17 22:44:46 +01:00
machoXX.c Simplify few strings. 2013-05-07 11:44:15 +02:00
multiboot.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00
multiboot_elfxx.c multiboot_elfxx.c: Fix compilation by fixing undeclared variable 2018-07-02 14:16:14 +02:00
multiboot_mbi2.c verifiers: Add possibility to verify kernel and modules command lines 2018-11-09 13:25:31 +01:00
xnu.c Change fs functions to add fs_ prefix 2019-04-09 10:03:29 +10:00
xnu_resume.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00