grub:master

Last commit made on 2024-05-23
Get this branch:
git clone -b master https://git.launchpad.net/grub

Branch merges

Branch information

Name:
master
Repository:
lp:grub

Recent commits

56e5882... by Yifan Zhao <email address hidden>

fs/erofs: Add tests for EROFS in grub-fs-tester

This patch introduces three EROFS tests which cover compact, extended
and chunk-based inodes respectively.

Signed-off-by: Yifan Zhao <email address hidden>
Reviewed-by: Glenn Washburn <email address hidden>
Signed-off-by: Gao Xiang <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

9d60306... by Yifan Zhao <email address hidden>

fs/erofs: Add support for the EROFS

The EROFS [1] is a lightweight read-only filesystem designed for performance
which has already been shipped in most Linux distributions as well as widely
used in several scenarios, such as Android system partitions, container
images and rootfs for embedded devices.

This patch brings in the EROFS uncompressed support. Now, it's possible to
boot directly through GRUB with an EROFS rootfs.

Support for the EROFS compressed files will be added later.

[1] https://erofs.docs.kernel.org

Signed-off-by: Yifan Zhao <email address hidden>
Tested-by: Daniel Axtens <email address hidden>
Signed-off-by: Gao Xiang <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

1ba39de... by Gao Xiang <email address hidden>

safemath: Add ALIGN_UP_OVF() which checks for an overflow

The following EROFS patch will use this helper to handle
ALIGN_UP() overflow.

Signed-off-by: Gao Xiang <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

d291449... by Jonathan Davies <email address hidden>

docs: Fix spelling mistakes

Signed-off-by: Jonathan Davies <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

6cc2e44... by Pascal Hambourg <email address hidden>

util/grub.d/00_header.in: Quote background image pathname in output

This is required if the pathname contains spaces or GRUB shell
metacharacters else the generated config file check will fail.

Signed-off-by: Pascal Hambourg <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

f456add... by Rogier777

disk/lvm: GRUB fails to detect LVM volumes due to an incorrect computation of mda_end

When handling a regular LVM volume, GRUB can fail with the message:

  error: disk `lvmid/******-****-****-****-****-****-****/******-****-****-****-****-****-******' not found.

If the condition which triggers this exists, grub-probe will report the
error mentioned above. Similarly, the GRUB boot code will fail to detect
LVM volumes, resulting in a failure to boot off of LVM disks/partitions.
The condition can be created on any LVM VG by an LVM configuration change,
so any system with /boot on LVM can become unbootable at "any" time (after
any LVM configuration change).

The problem is caused by an incorrect computation of mda_end in disk/lvm.c,
when the metadata area wraps around. Apparently, this can start happening at
around 220 metadata changes to the VG.

Fixes: 879c4a834 (lvm: Fix two more potential data-dependent alloc overflows)
Fixes: https://savannah.gnu.org/bugs/?61620

Signed-off-by: Rogier <email address hidden>
Signed-off-by: Glenn Washburn <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>
Tested-By: Michael Chang <email address hidden>

386b59d... by Forest

disk/cryptodisk: Allow user to retry failed passphrase

Give the user a chance to re-enter their cryptodisk passphrase after a typo,
rather than immediately failing (and likely dumping them into a GRUB shell).

By default, we allow 3 tries before giving up. A value in the
cryptodisk_passphrase_tries environment variable will override this default.

The user can give up early by entering an empty passphrase, just as they
could before this patch.

Signed-off-by: Forest <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

99b4c0c... by Lidong Chen <email address hidden>

disk/mdraid1x_linux: Prevent infinite recursion

The test corpus for version-1 RAID generated an infinite recursion
in grub_partition_iterate() while attempting to read the superblock.
The reason for the issue was that the data region overlapped with
the superblock.

The infinite call loop looks like this:
  grub_partition_iterate() -> partmap->iterate() ->
    -> grub_disk_read() -> grub_disk_read_small() ->
    -> grub_disk_read_small_real() -> grub_diskfilter_read() ->
    -> read_lv() -> read_segment() -> grub_diskfilter_read_node() ->
    -> grub_disk_read() -> grub_disk_read_small() -> ...

The fix adds checks for both the superblock region and the data
region when parsing the superblock metadata in grub_mdraid_detect().

Signed-off-by: Lidong Chen <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

b272ed2... by Ard Biesheuvel <email address hidden>

efi: Fix stack protector issues

The "ground truth" stack protector cookie value is kept in a global
variable, and loaded in every function prologue and epilogue to store
it into resp. compare it with the stack slot holding the cookie.

If the comparison fails, the program aborts, and this might occur
spuriously when the global variable changes values between the entry and
exit of a function. This implies that assigning the global variable at
boot should not involve any instrumented function calls, unless special
care is taken to ensure that the live call stack is synchronized, which
is non-trivial.

So avoid any function calls, including grub_memcpy(), which is
unnecessary given that the stack cookie is always a suitably aligned
variable of the native word size.

While at it, leave the last byte 0x0 to avoid inadvertent unbounded
strings on the stack.

Note that the use of __attribute__((optimize)) is described as
unsuitable for production use in the GCC documentation, so let's drop
this as well now that it is no longer needed.

Signed-off-by: Ard Biesheuvel <email address hidden>
Signed-off-by: Glenn Washburn <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>

6744840... by Oliver Steffen <email address hidden>

build: Track explicit module dependencies in Makefile.core.def

Add a new keyword, "depends", to the module definition syntax
used in Makefile.core.def. This allows specifying explicit module
dependencies together with the module definition.

Do not track the "extra_deps.lst" file in the repository anymore,
it is now auto-generated.

Make use of this new keyword in the bli module definition.

Signed-off-by: Oliver Steffen <email address hidden>
Reviewed-by: Daniel Kiper <email address hidden>