[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SECURITY PATCH 108/117] util/mkimage: Refactor section setup to use
From: |
John Paul Adrian Glaubitz |
Subject: |
Re: [SECURITY PATCH 108/117] util/mkimage: Refactor section setup to use a helper |
Date: |
Sat, 20 Mar 2021 16:05:08 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 |
Hello!
On 3/18/21 9:38 AM, John Paul Adrian Glaubitz wrote:
> This change broke GRUB on ia64 for me. It now fails to perform any basic
> commands:
>
> Loading.: grub
> Starting: grub
> Welcome to GRUB!
>
>
>
> error: unknown filesystem.
> Entering rescue mode...
> grub rescue> insmod ext2
> error: unknown filesystem.
> grub rescue> help
> Unknown command `help'.
> grub rescue> ?
> Unknown command `?'.
> grub rescue> linux
> Unknown command `linux'.
> grub rescue>
The problem seems that the module loader tries to load the modules from the
address
mentioned in the PE header which has changed before this patch was introduced.
However, the modules are still located at the same address in memory which is
why
the module loader can no longer find them.
For reference, here is a hex diff of core.efi for the working and non-working
builds
(without and with the patch):
--- grub-working.txt 2021-03-20 15:45:43.788950935 +0100
+++ grub-broken.txt 2021-03-20 15:46:05.588885451 +0100
@@ -25,10 +25,10 @@
00000180: 0000 0000 0000 0000 2e74 6578 7400 0000 .........text...
00000190: 00e0 0100 0010 0000 00e0 0100 0010 0000 ................
000001a0: 0000 0000 0000 0000 0000 0000 2000 0060 ............ ..`
-000001b0: 2e64 6174 6100 0000 e094 0100 00f0 0100 .data...........
-000001c0: e094 0100 00f0 0100 0000 0000 0000 0000 ................
+000001b0: 2e64 6174 6100 0000 00a0 0100 00f0 0100 .data...........
+000001c0: 00a0 0100 00f0 0100 0000 0000 0000 0000 ................
000001d0: 0000 0000 4000 00c0 6d6f 6473 0000 0000 ....@...mods....
-000001e0: 206b 0000 e084 0300 206b 0000 e084 0300 k...... k......
+000001e0: 0060 0000 0090 0300 0060 0000 0090 0300 .`.......`......
000001f0: 0000 0000 0000 0000 0000 0000 4000 00c0 ............@...
00000200: 2e72 656c 6f63 0000 0010 0000 00f0 0300 .reloc..........
00000210: 0010 0000 00f0 0300 0000 0000 0000 0000 ................
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
- [SECURITY PATCH 094/117] fs/btrfs: Squash some uninitialized reads, (continued)
- [SECURITY PATCH 094/117] fs/btrfs: Squash some uninitialized reads, Daniel Kiper, 2021/03/02
- [SECURITY PATCH 081/117] fs/nilfs2: Properly bail on errors in grub_nilfs2_btree_node_lookup(), Daniel Kiper, 2021/03/02
- [SECURITY PATCH 093/117] fs/btrfs: Validate the number of stripes/parities in RAID5/6, Daniel Kiper, 2021/03/02
- [SECURITY PATCH 090/117] disk/lvm: Do not overread metadata, Daniel Kiper, 2021/03/02
- [SECURITY PATCH 095/117] kern/parser: Fix a memory leak, Daniel Kiper, 2021/03/02
- [SECURITY PATCH 092/117] disk/lvm: Do not allow a LV to be it's own segment's node's LV, Daniel Kiper, 2021/03/02
- [SECURITY PATCH 098/117] kern/parser: Refactor grub_parser_split_cmdline() cleanup, Daniel Kiper, 2021/03/02
- [SECURITY PATCH 102/117] util/mkimage: Remove unused code to add BSS section, Daniel Kiper, 2021/03/02
- [SECURITY PATCH 108/117] util/mkimage: Refactor section setup to use a helper, Daniel Kiper, 2021/03/02
[SECURITY PATCH 107/117] util/mkimage: Improve data_size value calculation, Daniel Kiper, 2021/03/02
[SECURITY PATCH 100/117] kern/parser: Fix a stack buffer overflow, Daniel Kiper, 2021/03/02
[SECURITY PATCH 103/117] util/mkimage: Use grub_host_to_target32() instead of grub_cpu_to_le32(), Daniel Kiper, 2021/03/02
[SECURITY PATCH 105/117] util/mkimage: Unify more of the PE32 and PE32+ header set-up, Daniel Kiper, 2021/03/02
[SECURITY PATCH 101/117] kern/efi: Add initial stack protector implementation, Daniel Kiper, 2021/03/02
[SECURITY PATCH 109/117] util/mkimage: Add an option to import SBAT metadata into a .sbat section, Daniel Kiper, 2021/03/02