1. 23 Feb, 2020 38 commits
  2. 22 Feb, 2020 2 commits
    • Ard Biesheuvel's avatar
      efi/libstub/x86: Avoid overflowing code32_start on PE entry · 04a7d0e1
      Ard Biesheuvel authored
      When using the native PE entry point (as opposed to the EFI handover
      protocol entry point that is used more widely), we set code32_start,
      which is a 32-bit wide field, to the effective symbol address of
      startup_32, which could overflow given that the EFI loader may have
      located the running image anywhere in memory, and we haven't reached
      the point yet where we relocate ourselves.
      
      Since we relocate ourselves if code32_start != pref_address, this
      isn't likely to lead to problems in practice, given how unlikely
      it is that the truncated effective address of startup_32 happens
      to equal pref_address. But it is better to defer the assignment
      of code32_start to after the relocation, when it is guaranteed to
      fit.
      
      While at it, move the call to efi_relocate_kernel() to an earlier
      stage so it is more likely that our preferred offset in memory has
      not been occupied by other memory allocations done in the mean time.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      04a7d0e1
    • Ard Biesheuvel's avatar
      efi/libstub/x86: Remove pointless zeroing of apm_bios_info · e6d832ea
      Ard Biesheuvel authored
      We have some code in the EFI stub entry point that takes the address
      of the apm_bios_info struct in the newly allocated and zeroed out
      boot_params structure, only to zero it out again. This is pointless
      so remove it.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      e6d832ea