1. 26 8月, 2017 1 次提交
  2. 21 8月, 2017 2 次提交
  3. 13 7月, 2017 1 次提交
  4. 28 5月, 2017 1 次提交
  5. 17 4月, 2017 1 次提交
  6. 06 4月, 2017 1 次提交
  7. 05 4月, 2017 8 次提交
  8. 02 3月, 2017 1 次提交
  9. 07 2月, 2017 3 次提交
  10. 02 2月, 2017 1 次提交
    • A
      efi/fdt: Avoid FDT manipulation after ExitBootServices() · c8f325a5
      Ard Biesheuvel 提交于
      Some AArch64 UEFI implementations disable the MMU in ExitBootServices(),
      after which unaligned accesses to RAM are no longer supported.
      
      Commit:
      
        abfb7b68 ("efi/libstub/arm*: Pass latest memory map to the kernel")
      
      fixed an issue in the memory map handling of the stub FDT code, but
      inadvertently created an issue with such firmware, by moving some
      of the FDT manipulation to after the invocation of ExitBootServices().
      
      Given that the stub's libfdt implementation uses the ordinary, accelerated
      string functions, which rely on hardware handling of unaligned accesses,
      manipulating the FDT with the MMU off may result in alignment faults.
      
      So fix the situation by moving the update_fdt_memmap() call into the
      callback function invoked by efi_exit_boot_services() right before it
      calls the ExitBootServices() UEFI service (which is arguably a better
      place for it anyway)
      
      Note that disabling the MMU in ExitBootServices() is not compliant with
      the UEFI spec, and carries great risk due to the fact that switching from
      cached to uncached memory accesses halfway through compiler generated code
      (i.e., involving a stack) can never be done in a way that is architecturally
      safe.
      
      Fixes: abfb7b68 ("efi/libstub/arm*: Pass latest memory map to the kernel")
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Tested-by: NRiku Voipio <riku.voipio@linaro.org>
      Cc: <stable@vger.kernel.org>
      Cc: mark.rutland@arm.com
      Cc: linux-efi@vger.kernel.org
      Cc: matt@codeblueprint.co.uk
      Cc: leif.lindholm@linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1485971102-23330-2-git-send-email-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      c8f325a5
  11. 01 2月, 2017 2 次提交
  12. 28 12月, 2016 1 次提交
  13. 14 12月, 2016 1 次提交
    • P
      Remove references to dead make variable LINUX_INCLUDE · 846221cf
      Paul Bolle 提交于
      Commit 4fd06960 ("Use the new x86 setup code for i386") introduced a
      reference to the make variable LINUX_INCLUDE. That reference got moved
      around a bit and copied twice and now there are three references to it.
      
      There has never been a definition of that variable. (Presumably that is
      because it started out as a mistyped reference to LINUXINCLUDE.) So this
      reference has always been an empty string. Let's remove it before it
      spreads any further.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      846221cf
  14. 25 11月, 2016 1 次提交
    • A
      efi/libstub: Make efi_random_alloc() allocate below 4 GB on 32-bit · 018edcfa
      Ard Biesheuvel 提交于
      The UEFI stub executes in the context of the firmware, which identity
      maps the available system RAM, which implies that only memory below
      4 GB can be used for allocations on 32-bit architectures, even on [L]PAE
      capable hardware.
      
      So ignore any reported memory above 4 GB in efi_random_alloc(). This
      also fixes a reported build problem on ARM under -Os, where the 64-bit
      logical shift relies on a software routine that the ARM decompressor does
      not provide.
      
      A second [minor] issue is also fixed, where the '+ 1' is moved out of
      the shift, where it belongs: the reason for its presence is that a
      memory region where start == end should count as a single slot, given
      that 'end' takes the desired size and alignment of the allocation into
      account.
      
      To clarify the code in this regard, rename start/end to 'first_slot' and
      'last_slot', respectively, and introduce 'region_end' to describe the
      last usable address of the current region.
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1480010543-25709-2-git-send-email-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      018edcfa
  15. 13 11月, 2016 3 次提交
  16. 19 10月, 2016 1 次提交
    • A
      efi/arm: Fix absolute relocation detection for older toolchains · b0dddf6c
      Ard Biesheuvel 提交于
      When building the ARM kernel with CONFIG_EFI=y, the following build
      error may occur when using a less recent version of binutils (2.23 or
      older):
      
         STUBCPY drivers/firmware/efi/libstub/lib-sort.stub.o
       00000000 R_ARM_ABS32       sort
       00000004 R_ARM_ABS32       __ksymtab_strings
       drivers/firmware/efi/libstub/lib-sort.stub.o: absolute symbol references not allowed in the EFI stub
      
      (and when building with debug symbols, the list above is much longer, and
      contains all the internal references between the .debug sections and the
      actual code)
      
      This issue is caused by the fact that objcopy v2.23 or earlier does not
      support wildcards in its -R and -j options, which means the following
      line from the Makefile:
      
        STUBCOPY_FLAGS-y		:= -R .debug* -R *ksymtab* -R *kcrctab*
      
      fails to take effect, leaving harmless absolute relocations in the binary
      that are indistinguishable from relocations that may cause crashes at
      runtime due to the fact that these relocations are resolved at link time
      using the virtual address of the kernel, which is always different from
      the address at which the EFI firmware loads and invokes the stub.
      
      So, as a workaround, disable debug symbols explicitly when building the
      stub for ARM, and strip the ksymtab and kcrctab symbols for the only
      exported symbol we currently reuse in the stub, which is 'sort'.
      Tested-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: http://lkml.kernel.org/r/1476805991-7160-2-git-send-email-ard.biesheuvel@linaro.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      b0dddf6c
  17. 05 9月, 2016 3 次提交
    • J
      efi/libstub: Use efi_exit_boot_services() in FDT · ed9cc156
      Jeffrey Hugo 提交于
      The FDT code directly calls ExitBootServices.  This is inadvisable as the
      UEFI spec details a complex set of errors, race conditions, and API
      interactions that the caller of ExitBootServices must get correct.  The
      FDT code does not handle EFI_INVALID_PARAMETER as required by the spec,
      which causes intermittent boot failures on the Qualcomm Technologies
      QDF2432.  Call the efi_exit_boot_services() helper intead, which handles
      the EFI_INVALID_PARAMETER scenario properly.
      Signed-off-by: NJeffrey Hugo <jhugo@codeaurora.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      ed9cc156
    • J
      efi/libstub: Introduce ExitBootServices helper · fc07716b
      Jeffrey Hugo 提交于
      The spec allows ExitBootServices to fail with EFI_INVALID_PARAMETER if a
      race condition has occurred where the EFI has updated the memory map after
      the stub grabbed a reference to the map.  The spec defines a retry
      proceedure with specific requirements to handle this scenario.
      
      This scenario was previously observed on x86 - commit d3768d88 ("x86,
      efi: retry ExitBootServices() on failure") but the current fix is not spec
      compliant and the scenario is now observed on the Qualcomm Technologies
      QDF2432 via the FDT stub which does not handle the error and thus causes
      boot failures.  The user will notice the boot failure as the kernel is not
      executed and the system may drop back to a UEFI shell, but will be
      unresponsive to input and the system will require a power cycle to recover.
      
      Add a helper to the stub library that correctly adheres to the spec in the
      case of EFI_INVALID_PARAMETER from ExitBootServices and can be universally
      used across all stub implementations.
      Signed-off-by: NJeffrey Hugo <jhugo@codeaurora.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      fc07716b
    • J
      efi/libstub: Allocate headspace in efi_get_memory_map() · dadb57ab
      Jeffrey Hugo 提交于
      efi_get_memory_map() allocates a buffer to store the memory map that it
      retrieves.  This buffer may need to be reused by the client after
      ExitBootServices() is called, at which point allocations are not longer
      permitted.  To support this usecase, provide the allocated buffer size back
      to the client, and allocate some additional headroom to account for any
      reasonable growth in the map that is likely to happen between the call to
      efi_get_memory_map() and the client reusing the buffer.
      Signed-off-by: NJeffrey Hugo <jhugo@codeaurora.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      dadb57ab
  18. 29 4月, 2016 1 次提交
    • A
      arm64: kaslr: increase randomization granularity · 6f26b367
      Ard Biesheuvel 提交于
      Currently, our KASLR implementation randomizes the placement of the core
      kernel at 2 MB granularity. This is based on the arm64 kernel boot
      protocol, which mandates that the kernel is loaded TEXT_OFFSET bytes above
      a 2 MB aligned base address. This requirement is a result of the fact that
      the block size used by the early mapping code may be 2 MB at the most (for
      a 4 KB granule kernel)
      
      But we can do better than that: since a KASLR kernel needs to be relocated
      in any case, we can tolerate a physical misalignment as long as the virtual
      misalignment relative to this 2 MB block size is equal in size, and code to
      deal with this is already in place.
      
      Since we align the kernel segments to 64 KB, let's randomize the physical
      offset at 64 KB granularity as well (unless CONFIG_DEBUG_ALIGN_RODATA is
      enabled). This way, the page table and TLB footprint is not affected.
      
      The higher granularity allows for 5 bits of additional entropy to be used.
      Reviewed-by: NMatt Fleming <matt@codeblueprint.co.uk>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6f26b367
  19. 28 4月, 2016 6 次提交
  20. 16 4月, 2016 1 次提交