Skip to content

Commit 533b220

Browse files
committed
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Will Deacon: "A sizeable pile of arm64 updates for 5.8. Summary below, but the big two features are support for Branch Target Identification and Clang's Shadow Call stack. The latter is currently arm64-only, but the high-level parts are all in core code so it could easily be adopted by other architectures pending toolchain support Branch Target Identification (BTI): - Support for ARMv8.5-BTI in both user- and kernel-space. This allows branch targets to limit the types of branch from which they can be called and additionally prevents branching to arbitrary code, although kernel support requires a very recent toolchain. - Function annotation via SYM_FUNC_START() so that assembly functions are wrapped with the relevant "landing pad" instructions. - BPF and vDSO updates to use the new instructions. - Addition of a new HWCAP and exposure of BTI capability to userspace via ID register emulation, along with ELF loader support for the BTI feature in .note.gnu.property. - Non-critical fixes to CFI unwind annotations in the sigreturn trampoline. Shadow Call Stack (SCS): - Support for Clang's Shadow Call Stack feature, which reserves platform register x18 to point at a separate stack for each task that holds only return addresses. This protects function return control flow from buffer overruns on the main stack. - Save/restore of x18 across problematic boundaries (user-mode, hypervisor, EFI, suspend, etc). - Core support for SCS, should other architectures want to use it too. - SCS overflow checking on context-switch as part of the existing stack limit check if CONFIG_SCHED_STACK_END_CHECK=y. CPU feature detection: - Removed numerous "SANITY CHECK" errors when running on a system with mismatched AArch32 support at EL1. This is primarily a concern for KVM, which disabled support for 32-bit guests on such a system. - Addition of new ID registers and fields as the architecture has been extended. Perf and PMU drivers: - Minor fixes and cleanups to system PMU drivers. Hardware errata: - Unify KVM workarounds for VHE and nVHE configurations. - Sort vendor errata entries in Kconfig. Secure Monitor Call Calling Convention (SMCCC): - Update to the latest specification from Arm (v1.2). - Allow PSCI code to query the SMCCC version. Software Delegated Exception Interface (SDEI): - Unexport a bunch of unused symbols. - Minor fixes to handling of firmware data. Pointer authentication: - Add support for dumping the kernel PAC mask in vmcoreinfo so that the stack can be unwound by tools such as kdump. - Simplification of key initialisation during CPU bringup. BPF backend: - Improve immediate generation for logical and add/sub instructions. vDSO: - Minor fixes to the linker flags for consistency with other architectures and support for LLVM's unwinder. - Clean up logic to initialise and map the vDSO into userspace. ACPI: - Work around for an ambiguity in the IORT specification relating to the "num_ids" field. - Support _DMA method for all named components rather than only PCIe root complexes. - Minor other IORT-related fixes. Miscellaneous: - Initialise debug traps early for KGDB and fix KDB cacheflushing deadlock. - Minor tweaks to early boot state (documentation update, set TEXT_OFFSET to 0x0, increase alignment of PE/COFF sections). - Refactoring and cleanup" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (148 commits) KVM: arm64: Move __load_guest_stage2 to kvm_mmu.h KVM: arm64: Check advertised Stage-2 page size capability arm64/cpufeature: Add get_arm64_ftr_reg_nowarn() ACPI/IORT: Remove the unused __get_pci_rid() arm64/cpuinfo: Add ID_MMFR4_EL1 into the cpuinfo_arm64 context arm64/cpufeature: Add remaining feature bits in ID_AA64PFR1 register arm64/cpufeature: Add remaining feature bits in ID_AA64PFR0 register arm64/cpufeature: Add remaining feature bits in ID_AA64ISAR0 register arm64/cpufeature: Add remaining feature bits in ID_MMFR4 register arm64/cpufeature: Add remaining feature bits in ID_PFR0 register arm64/cpufeature: Introduce ID_MMFR5 CPU register arm64/cpufeature: Introduce ID_DFR1 CPU register arm64/cpufeature: Introduce ID_PFR2 CPU register arm64/cpufeature: Make doublelock a signed feature in ID_AA64DFR0 arm64/cpufeature: Drop TraceFilt feature exposure from ID_DFR0 register arm64/cpufeature: Add explicit ftr_id_isar0[] for ID_ISAR0 register arm64: mm: Add asid_gen_match() helper firmware: smccc: Fix missing prototype warning for arm_smccc_version_init arm64: vdso: Fix CFI directives in sigreturn trampoline arm64: vdso: Don't prefix sigreturn trampoline with a BTI C instruction ...
2 parents 3ee3723 + 082af5e commit 533b220

File tree

159 files changed

+2559
-976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+2559
-976
lines changed

Documentation/admin-guide/kdump/vmcoreinfo.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ KERNELOFFSET
393393
The kernel randomization offset. Used to compute the page offset. If
394394
KASLR is disabled, this value is zero.
395395

396+
KERNELPACMASK
397+
-------------
398+
399+
The mask to extract the Pointer Authentication Code from a kernel virtual
400+
address.
401+
396402
arm
397403
===
398404

Documentation/arm64/booting.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ Before jumping into the kernel, the following conditions must be met:
173173
- Caches, MMUs
174174

175175
The MMU must be off.
176-
Instruction cache may be on or off.
176+
The instruction cache may be on or off, and must not hold any stale
177+
entries corresponding to the loaded kernel image.
177178
The address range corresponding to the loaded kernel image must be
178179
cleaned to the PoC. In the presence of a system cache or other
179180
coherent masters with caches enabled, this will typically require

Documentation/arm64/cpu-feature-registers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ infrastructure:
176176
+------------------------------+---------+---------+
177177
| SSBS | [7-4] | y |
178178
+------------------------------+---------+---------+
179+
| BT | [3-0] | y |
180+
+------------------------------+---------+---------+
179181

180182

181183
4) MIDR_EL1 - Main ID Register

Documentation/arm64/elf_hwcaps.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ HWCAP2_RNG
236236

237237
Functionality implied by ID_AA64ISAR0_EL1.RNDR == 0b0001.
238238

239+
HWCAP2_BTI
240+
241+
Functionality implied by ID_AA64PFR0_EL1.BT == 0b0001.
242+
243+
239244
4. Unused AT_HWCAP bits
240245
-----------------------
241246

Documentation/arm64/silicon-errata.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ stable kernels.
6464
+----------------+-----------------+-----------------+-----------------------------+
6565
| ARM | Cortex-A53 | #843419 | ARM64_ERRATUM_843419 |
6666
+----------------+-----------------+-----------------+-----------------------------+
67+
| ARM | Cortex-A55 | #1024718 | ARM64_ERRATUM_1024718 |
68+
+----------------+-----------------+-----------------+-----------------------------+
69+
| ARM | Cortex-A55 | #1530923 | ARM64_ERRATUM_1530923 |
70+
+----------------+-----------------+-----------------+-----------------------------+
6771
| ARM | Cortex-A57 | #832075 | ARM64_ERRATUM_832075 |
6872
+----------------+-----------------+-----------------+-----------------------------+
6973
| ARM | Cortex-A57 | #852523 | N/A |
@@ -78,8 +82,6 @@ stable kernels.
7882
+----------------+-----------------+-----------------+-----------------------------+
7983
| ARM | Cortex-A73 | #858921 | ARM64_ERRATUM_858921 |
8084
+----------------+-----------------+-----------------+-----------------------------+
81-
| ARM | Cortex-A55 | #1024718 | ARM64_ERRATUM_1024718 |
82-
+----------------+-----------------+-----------------+-----------------------------+
8385
| ARM | Cortex-A76 | #1188873,1418040| ARM64_ERRATUM_1418040 |
8486
+----------------+-----------------+-----------------+-----------------------------+
8587
| ARM | Cortex-A76 | #1165522 | ARM64_ERRATUM_1165522 |
@@ -88,8 +90,6 @@ stable kernels.
8890
+----------------+-----------------+-----------------+-----------------------------+
8991
| ARM | Cortex-A76 | #1463225 | ARM64_ERRATUM_1463225 |
9092
+----------------+-----------------+-----------------+-----------------------------+
91-
| ARM | Cortex-A55 | #1530923 | ARM64_ERRATUM_1530923 |
92-
+----------------+-----------------+-----------------+-----------------------------+
9393
| ARM | Neoverse-N1 | #1188873,1418040| ARM64_ERRATUM_1418040 |
9494
+----------------+-----------------+-----------------+-----------------------------+
9595
| ARM | Neoverse-N1 | #1349291 | N/A |

Documentation/filesystems/proc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ encoded manner. The codes are the following:
543543
hg huge page advise flag
544544
nh no huge page advise flag
545545
mg mergable advise flag
546+
bt - arm64 BTI guarded page
546547
== =======================================
547548

548549
Note that there is no guarantee that every flag and associated mnemonic will

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15518,6 +15518,15 @@ M: Nicolas Pitre <[email protected]>
1551815518
S: Odd Fixes
1551915519
F: drivers/net/ethernet/smsc/smc91x.*
1552015520

15521+
SECURE MONITOR CALL(SMC) CALLING CONVENTION (SMCCC)
15522+
M: Mark Rutland <[email protected]>
15523+
M: Lorenzo Pieralisi <[email protected]>
15524+
M: Sudeep Holla <[email protected]>
15525+
15526+
S: Maintained
15527+
F: drivers/firmware/smccc/
15528+
F: include/linux/arm-smccc.h
15529+
1552115530
SMIA AND SMIA++ IMAGE SENSOR DRIVER
1552215531
M: Sakari Ailus <[email protected]>
1552315532

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,12 @@ ifdef CONFIG_LIVEPATCH
862862
KBUILD_CFLAGS += $(call cc-option, -flive-patching=inline-clone)
863863
endif
864864

865+
ifdef CONFIG_SHADOW_CALL_STACK
866+
CC_FLAGS_SCS := -fsanitize=shadow-call-stack
867+
KBUILD_CFLAGS += $(CC_FLAGS_SCS)
868+
export CC_FLAGS_SCS
869+
endif
870+
865871
# arch Makefile may override CC so keep this after arch Makefile is included
866872
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
867873

arch/Kconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,31 @@ config STACKPROTECTOR_STRONG
533533
about 20% of all kernel functions, which increases the kernel code
534534
size by about 2%.
535535

536+
config ARCH_SUPPORTS_SHADOW_CALL_STACK
537+
bool
538+
help
539+
An architecture should select this if it supports Clang's Shadow
540+
Call Stack and implements runtime support for shadow stack
541+
switching.
542+
543+
config SHADOW_CALL_STACK
544+
bool "Clang Shadow Call Stack"
545+
depends on CC_IS_CLANG && ARCH_SUPPORTS_SHADOW_CALL_STACK
546+
depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
547+
help
548+
This option enables Clang's Shadow Call Stack, which uses a
549+
shadow stack to protect function return addresses from being
550+
overwritten by an attacker. More information can be found in
551+
Clang's documentation:
552+
553+
https://clang.llvm.org/docs/ShadowCallStack.html
554+
555+
Note that security guarantees in the kernel differ from the
556+
ones documented for user space. The kernel must store addresses
557+
of shadow stacks in memory, which means an attacker capable of
558+
reading and writing arbitrary memory may be able to locate them
559+
and hijack control flow by modifying the stacks.
560+
536561
config HAVE_ARCH_WITHIN_STACK_FRAMES
537562
bool
538563
help

0 commit comments

Comments
 (0)