~ubuntu-core-dev/grub/+git/ubuntu:lp.1795291

Last commit made on 2018-10-01
Get this branch:
git clone -b lp.1795291 https://git.launchpad.net/~ubuntu-core-dev/grub/+git/ubuntu
Members of Ubuntu Core Development Team can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
lp.1795291
Repository:
lp:~ubuntu-core-dev/grub/+git/ubuntu

Recent commits

00b2d12... by Steve Langasek

Handle the case where we have unsigned vmlinuz and signed vmlinuz.efi.signed

If we have both vmlinuz and vmlinuz.efi.signed in /boot, the presence of
vmlinuz shouldn't cause grub-check-signatures to error.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1795291
Signed-off-by: Steve Langasek <email address hidden>

2d17f37... by Mathieu Trudel-Lapierre

releasing package grub2 version 2.02+dfsg1-5ubuntu5

7c8ccc8... by Mathieu Trudel-Lapierre

  [ Steve Langasek ]
  * debian/rules, debian/control: enable dh-systemd.
  * debian/patches/add-initrd-less-boot-fallback.patch: add initrd-less
    capabilities. If a kernel fails to boot without initrd, grub will fallback
    to trying to boot the kernel with an initrd. Patch by Chris Glass.

364c9c5... by Chris Glass

Added initrd-less boot capabilities.

In case the kernel fails to boot without an initrd, grub will fallback
to trying to boot the kernel with an initrd.

Signed-off-by: Steve Langasek <email address hidden>

Patch-Name: add-initrd-less-boot-fallback.patch

1399c95... by Mathieu Trudel-Lapierre

debian/patches/linuxefi_truncate_overlong_reloc_section.patch: The Windows 7 bootloader has inconsistent headers; truncate to the smaller, correct size to fix chainloading Windows 7.

0785df0... by Laszlo Ersek (Red Hat)

efi/chainloader: truncate overlong relocation section

The UEFI Windows 7 boot loader ("EFI/Microsoft/Boot/bootmgfw.efi", SHA1
31b410e029bba87d2068c65a80b88882f9f8ea25) has inconsistent headers.

Compare:

> The Data Directory
> ...
> Entry 5 00000000000d9000 00000574 Base Relocation Directory [.reloc]

Versus:

> Sections:
> Idx Name Size VMA LMA File off ...
> ...
> 10 .reloc 00000e22 00000000100d9000 00000000100d9000 000a1800 ...

That is, the size reported by the RelocDir entry (0x574) is smaller than
the virtual size of the .reloc section (0xe22).

Quoting the grub2 debug log for the same:

> chainloader.c:595: reloc_dir: 0xd9000 reloc_size: 0x00000574
> chainloader.c:603: reloc_base: 0x7d208000 reloc_base_end: 0x7d208573
> ...
> chainloader.c:620: Section 10 ".reloc" at 0x7d208000..0x7d208e21
> chainloader.c:661: section is not reloc section?
> chainloader.c:663: rds: 0x00001000, vs: 00000e22
> chainloader.c:664: base: 0x7d208000 end: 0x7d208e21
> chainloader.c:666: reloc_base: 0x7d208000 reloc_base_end: 0x7d208573
> chainloader.c:671: Section characteristics are 42000040
> chainloader.c:673: Section virtual size: 00000e22
> chainloader.c:675: Section raw_data size: 00001000
> chainloader.c:678: Discarding section

After hexdumping "bootmgfw.efi" and manually walking its relocation blocks
(yes, really), I determined that the (smaller) RelocDir value is correct.
The remaining area that extends up to the .reloc section size (== 0xe22 -
0x574 == 0x8ae bytes) exists as zero padding in the file.

This zero padding shouldn't be passed to relocate_coff() for parsing. In
order to cope with it, split the handling of .reloc sections into the
following branches:

- original case (equal size): original behavior (--> relocation
  attempted),

- overlong .reloc section (longer than reported by RelocDir): truncate the
  section to the RelocDir size for the purposes of relocate_coff(), and
  attempt relocation,

- .reloc section is too short, or other checks fail: original behavior
  (--> relocation not attempted).

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1347291
Signed-off-by: Laszlo Ersek <email address hidden>
Patch-Name: linuxefi_truncate_overlong_relocs.patch
Last-Update: 2018-09-25

c3e65b8... by Mathieu Trudel-Lapierre

releasing package grub2 version 2.02+dfsg1-5ubuntu4

9cd8d73... by Mathieu Trudel-Lapierre

debian/patches/linuxefi_fix_relocate_coff.patch: fix typo in relocate_coff() causing issues with relocation of code in chainload. (LP: #1792575)

bfe7c89... by Laszlo Ersek (Red Hat)

efi/chainloader: fix wrong sanity check in relocate_coff()

In relocate_coff(), the relocation entries are parsed from the original
image (not the section-wise copied image). The original image is
pointed-to by the "orig" pointer. The current check

  (void *)reloc_end < data

compares the addresses of independent memory allocations. "data" is a typo
here, it should be "orig".

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1347291
Signed-off-by: Laszlo Ersek <email address hidden>
Tested-by: Bogdan Costescu <email address hidden>
Tested-by: Juan Orti <email address hidden>
Patch-Name: linuxefi_fix_relocate_coff.patch

24125e3... by dann frazier

releasing package grub2 version 2.02+dfsg1-5ubuntu3