Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 6521e4d2021bc047ef78c5360b9277a699117a0e
      
https://github.com/tianocore/edk2/commit/6521e4d2021bc047ef78c5360b9277a699117a0e
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Include/AArch64/ProcessorBind.h

  Log Message:
  -----------
  MdePkg/ProcessorBind AARCH64: Add asm macro to emit GNU BTI note

Implement a CPP macro that can be called from .S files to emit the .note
section carrying the annotation that informs the linker that the object
file is compatible with BTI control flow integrity checks.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: c5cd360277bcf8b11ff88f95c4ae92cda29eba64
      
https://github.com/tianocore/edk2/commit/c5cd360277bcf8b11ff88f95c4ae92cda29eba64
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Library/BaseCpuLib/AArch64/CpuFlushTlb.S
    M MdePkg/Library/BaseCpuLib/AArch64/CpuSleep.S

  Log Message:
  -----------
  MdePkg/BaseCpuLib AARCH64: Make asm files BTI compatible

Add the BTI instructions and the associated note to make the AArch64 asm
objects compatible with BTI enforcement.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: ea1312a5b443b0d3691d825c2dc8cf2227120ba3
      
https://github.com/tianocore/edk2/commit/ea1312a5b443b0d3691d825c2dc8cf2227120ba3
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Library/BaseIoLibIntrinsic/AArch64/ArmVirtMmio.S

  Log Message:
  -----------
  MdePkg/BaseIoLibIntrinsic AARCH64: Make asm files BTI compatible

Add the BTI instructions and the associated note to make the AArch64 asm
objects compatible with BTI enforcement.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: e504b3917e2b5b0cdd6a381141efb7e303eeb6c1
      
https://github.com/tianocore/edk2/commit/e504b3917e2b5b0cdd6a381141efb7e303eeb6c1
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S

  Log Message:
  -----------
  MdePkg/BaseLib AARCH64: Make LongJump() BTI compatible

Currently, the AArch64 implementation of LongJump() avoids using the RET
instruction to perform the jump, even though the target address is held
in the link register X30, as the nature of a long jump implies that the
ordinary return address prediction machinery will not be able to make a
correct prediction.

However, LongJump() is rarely used, and the return stack will be out of
sync in any case, so this optimization has little value in practice, and
given that indirect calls other than function returns require a BTI
landing pad at the call site, this optimization is not compatible with
BTI. So let's just use RET instead.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: c4c7fb21744788e40de85630280e1c101b85294e
      
https://github.com/tianocore/edk2/commit/c4c7fb21744788e40de85630280e1c101b85294e
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Library/BaseLib/AArch64/CpuBreakpoint.S
    M MdePkg/Library/BaseLib/AArch64/DisableInterrupts.S
    M MdePkg/Library/BaseLib/AArch64/EnableInterrupts.S
    M MdePkg/Library/BaseLib/AArch64/GetInterruptsState.S
    M MdePkg/Library/BaseLib/AArch64/MemoryFence.S
    M MdePkg/Library/BaseLib/AArch64/SetJumpLongJump.S
    M MdePkg/Library/BaseLib/AArch64/SpeculationBarrier.S
    M MdePkg/Library/BaseLib/AArch64/SwitchStack.S

  Log Message:
  -----------
  MdePkg/BaseLib AARCH64: Make asm files BTI compatible

Add the BTI instructions and the associated note to make the AArch64 asm
objects compatible with BTI enforcement.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: 0ee255f50a7d612f157ab95db00dc49406b7a627
      
https://github.com/tianocore/edk2/commit/0ee255f50a7d612f157ab95db00dc49406b7a627
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
    M MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S
    M MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S
    M MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S
    M MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S

  Log Message:
  -----------
  MdePkg/BaseMemoryLibOptDxe AARCH64: Make asm files BTI compatible

Add the BTI instructions and the associated note to make the AArch64 asm
objects compatible with BTI enforcement.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: 35318c2eb9ad3747f70cdee0714893e282ca51b0
      
https://github.com/tianocore/edk2/commit/35318c2eb9ad3747f70cdee0714893e282ca51b0
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Library/BaseSynchronizationLib/AArch64/Synchronization.S

  Log Message:
  -----------
  MdePkg/BaseSynchronizationLib AARCH64: Make asm files BTI compatible

Add the BTI instructions and the associated note to make the AArch64 asm
objects compatible with BTI enforcement.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: f8b1854b92559ad28dc6df6bb886652b87e2a422
      
https://github.com/tianocore/edk2/commit/f8b1854b92559ad28dc6df6bb886652b87e2a422
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S
    M MdePkg/Library/BaseRngLib/AArch64/ArmRng.S

  Log Message:
  -----------
  MdePkg/BaseRngLib AARCH64: Make asm files BTI compatible

Add the BTI instructions and the associated note to make the AArch64 asm
objects compatible with BTI enforcement.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: 48d642a310b96e68465d724644510d3f6e381b2c
      
https://github.com/tianocore/edk2/commit/48d642a310b96e68465d724644510d3f6e381b2c
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M ArmPkg/Include/AsmMacroIoLibV8.h
    M ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S
    M ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S

  Log Message:
  -----------
  ArmPkg: Emit BTI opcodes when BTI codegen is enabled

When building with -mbranch-protection=bti, which affects the compiler
codegen only, ensure that the assembler based codegen is aligned with
this, by emitting the BTI C opcode at the start of each exported
function. While most exported functions are not in fact ever called
indirectly, whether or not this is the case is a property of the caller
so annotating every exported function is a reasonable default.

While at it, fix two occurrences in ArmPkg of exported functions that
did not use the ASM_FUNC() macro.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: 77ea6b547ebed267ec409d47c49e1663750955d3
      
https://github.com/tianocore/edk2/commit/77ea6b547ebed267ec409d47c49e1663750955d3
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M ArmPkg/Library/GccLto/liblto-aarch64.a

  Log Message:
  -----------
  ArmPkg/GccLto AARCH64: Add BTI note to LTO helper library

The GccLto helper library does not contain any code, as its only purpose
is to pull in other libraries that implement intrinsics to which the
linker's codegen pass may emit calls.

So mark it as BTI compatible, so that the linker does not complain about
unannotated objects.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: f484427d10a5ff6c2437c2f7c671e9e552ad6766
      
https://github.com/tianocore/edk2/commit/f484427d10a5ff6c2437c2f7c671e9e552ad6766
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    A ArmPkg/Library/GnuNoteBti.bin
    M BaseTools/Conf/tools_def.template

  Log Message:
  -----------
  ArmPkg, BaseTools AARCH64: Add BTI ELF note to .hii objects

The ELF based toolchains use objcopy to create HII object files, which
contain only a single .hii section. This means no GNU note is inserted
that describes the object as compatible with BTI, even though the lack
of executable code in such an object makes the distinction irrelevant.
However, the linker will not add the note globally to the resulting ELF
executable, and this breaks BTI compatibility.

So let's insert a GNU BTI-compatible ELF note by hand when generating
such object files.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: e701a4d51e6903da59086771f532928858839a2b
      
https://github.com/tianocore/edk2/commit/e701a4d51e6903da59086771f532928858839a2b
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M ArmPlatformPkg/PrePeiCore/AArch64/Exception.S

  Log Message:
  -----------
  ArmPlatformPkg/PrePeiCore: Make vector table object BTI compatible

The object file containing the vector table does not contain any
callable functions, so it will not be implicitly annotated as BTI
compatible on BTI builds. So add the annotation by hand, and use the
'empty' type so we get the GNU ELF note but not the actual BTI opcode.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


  Commit: 3b4d1b38eac0542c8942dd114a6600d31aec503d
      
https://github.com/tianocore/edk2/commit/3b4d1b38eac0542c8942dd114a6600d31aec503d
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M ArmVirtPkg/Library/ArmPlatformLibQemu/IdMap.S

  Log Message:
  -----------
  ArmVirtPkg/ArmPlatformLibQemu: Make IdMap.S BTI compatible

The IdMap.S asm source file has not executable content, but its lack of
a BTI annotation prevents the linker from marking any executables it
emits as BTI compatible if this object is part of the build. So add the
BTI note by hand.

Signed-off-by: Ard Biesheuvel <a...@kernel.org>


  Commit: 53eb26b238541799134aa5846530485c915735da
      
https://github.com/tianocore/edk2/commit/53eb26b238541799134aa5846530485c915735da
  Author: Ard Biesheuvel <a...@kernel.org>
  Date:   2023-03-30 (Thu, 30 Mar 2023)

  Changed paths:
    M MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c
    M MdePkg/Include/Guid/MemoryAttributesTable.h

  Log Message:
  -----------
  MdePkg: Update MemoryAttributesTable to v2.10

UEFI v2.10 introduces a new flag to the memory attributes table to
inform the OS whether or not runtime services code regions were emitted
by the compiler with guard instructions for forward edge control flow
integrity enforcement.

So update our definition accordingly.

Link: 
https://uefi.org/specs/UEFI/2.10/04_EFI_System_Table.html#efi-memory-attributes-table
Signed-off-by: Ard Biesheuvel <a...@kernel.org>
Reviewed-by: Michael D Kinney <michael.d.kin...@intel.com>
Acked-by: Michael Kubacki <michael.kuba...@microsoft.com>
Reviewed-by: Leif Lindholm <quic_llind...@quicinc.com>
Reviewed-by: Oliver Smith-Denny <o...@smith-denny.com>


Compare: https://github.com/tianocore/edk2/compare/e3e88d90e8d7...53eb26b23854


_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to