1. 19 May, 2020 10 commits
  2. 06 May, 2020 1 commit
  3. 05 May, 2020 3 commits
  4. 01 May, 2020 11 commits
  5. 25 Apr, 2020 2 commits
  6. 24 Apr, 2020 11 commits
  7. 23 Apr, 2020 2 commits
    • Ard Biesheuvel's avatar
      efi/libstub/arm64: Simplify randomized loading of kernel image · 5d12da9d
      Ard Biesheuvel authored
      The KASLR code path in the arm64 version of the EFI stub incorporates
      some overly complicated logic to randomly allocate a region of the right
      alignment: there is no need to randomize the placement of the kernel
      modulo 2 MiB separately from the placement of the 2 MiB aligned allocation
      itself - we can simply follow the same logic used by the non-randomized
      placement, which is to allocate at the correct alignment, and only take
      TEXT_OFFSET into account if it is not a round multiple of the alignment.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      5d12da9d
    • Ard Biesheuvel's avatar
      efi/libstub/arm64: Replace 'preferred' offset with alignment check · 82046702
      Ard Biesheuvel authored
      The notion of a 'preferred' load offset for the kernel dates back to the
      times when the kernel's primary mapping overlapped with the linear region,
      and memory below it could not be used at all.
      
      Today, the arm64 kernel does not really care where it is loaded in physical
      memory, as long as the alignment requirements are met, and so there is no
      point in unconditionally moving the kernel to a new location in memory at
      boot. Instead, we can
      - check for a KASLR seed, and randomly reallocate the kernel if one is
        provided
      - otherwise, check whether the alignment requirements are met for the
        current placement of the kernel, and just run it in place if they are
      - finally, do an ordinary page allocation and reallocate the kernel to a
        suitably aligned buffer anywhere in memory.
      
      By the same reasoning, there is no need to take TEXT_OFFSET into account
      if it is a round multiple of the minimum alignment, which is the usual
      case for relocatable kernels with TEXT_OFFSET randomization disabled.
      Otherwise, it suffices to use the relative misaligment of TEXT_OFFSET
      when reallocating the kernel.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      82046702