2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/arch/arm64/kernel
Kevin Brodsky 22f3a4f608 arm64: poe: Handle spurious Overlay faults
We do not currently issue an ISB after updating POR_EL0 when
context-switching it, for instance. The rationale is that if the old
value of POR_EL0 is more restrictive and causes a fault during
uaccess, the access will be retried [1]. In other words, we are
trading an ISB on every context-switching for the (unlikely)
possibility of a spurious fault. We may also miss faults if the new
value of POR_EL0 is more restrictive, but that's considered
acceptable.

However, as things stand, a spurious Overlay fault results in
uaccess failing right away since it causes fault_from_pkey() to
return true. If an Overlay fault is reported, we therefore need to
double check POR_EL0 against vma_pkey(vma) - this is what
arch_vma_access_permitted() already does.

As it turns out, we already perform that explicit check if no
Overlay fault is reported, and we need to keep that check (see
comment added in fault_from_pkey()). Net result: the Overlay ISS2
bit isn't of much help to decide whether a pkey fault occurred.

Remove the check for the Overlay bit from fault_from_pkey() and
add a comment to try and explain the situation. While at it, also
add a comment to permission_overlay_switch() in case anyone gets
surprised by the lack of ISB.

[1] https://lore.kernel.org/linux-arm-kernel/ZtYNGBrcE-j35fpw@arm.com/

Fixes: 160a8e13de ("arm64: context switch POR_EL0 register")
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Link: https://lore.kernel.org/r/20250619160042.2499290-2-kevin.brodsky@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
2025-07-04 16:40:38 +01:00
..
pi arm64 fixes for -rc1 2025-06-05 11:39:17 -07:00
probes - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
vdso Updates for the VDSO infrastructure: 2025-03-25 11:30:42 -07:00
vdso32 arm64: vdso: Switch to generic storage implementation 2025-02-21 09:54:01 +01:00
.gitignore
acpi_numa.c arm64: ACPI: NUMA: initialize all values of acpi_early_node_map to NUMA_NO_NODE 2024-08-14 17:51:39 +01:00
acpi_parking_protocol.c arm64: smp: Remove dedicated wakeup IPI 2023-09-25 17:15:28 +01:00
acpi.c mm/ioremap: pass pgprot_t to ioremap_prot() instead of unsigned long 2025-03-16 22:06:23 -07:00
alternative.c Merge branches 'for-next/kpti', 'for-next/missing-proto-warn', 'for-next/iss2-decode', 'for-next/kselftest', 'for-next/misc', 'for-next/feat_mops', 'for-next/module-alloc', 'for-next/sysreg', 'for-next/cpucap', 'for-next/acpi', 'for-next/kdump', 'for-next/acpi-doc', 'for-next/doc' and 'for-next/tpidr2-fix', remote-tracking branch 'arm64/for-next/perf' into for-next/core 2023-06-23 18:32:20 +01:00
armv8_deprecated.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
asm-offsets.c arm64/mm: Re-organise setting up FEAT_S1PIE registers PIRE0_EL1 and PIR_EL1 2025-05-16 15:06:36 +01:00
cacheinfo.c arm64: cacheinfo: Avoid out-of-bounds write to cacheinfo array 2025-02-07 09:57:56 +00:00
compat_alignment.c arm64: Don't call NULL in do_compat_alignment_fixup() 2025-04-01 14:13:11 +01:00
cpu_errata.c Merge branch kvm-arm64/misc-6.16 into kvmarm-master/next 2025-05-23 10:59:43 +01:00
cpu_ops.c
cpu-reset.S arm64: kernel: remove SHF_WRITE|SHF_EXECINSTR from .idmap.text 2023-05-02 12:42:22 +01:00
cpufeature.c arm64: Filter out SME hwcaps when FEAT_SME isn't implemented 2025-07-04 16:35:30 +01:00
cpuinfo.c arm64: Add override for MPAM 2025-06-02 13:49:09 +01:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
debug-monitors.c Merge branch 'for-next/mops' into for-next/core 2024-11-14 12:07:28 +00:00
efi-header.S include: pe.h: Fix PE definitions 2025-05-21 16:46:37 +02:00
efi-rt-wrapper.S arm64: efi: Avoid workqueue to check whether EFI runtime is live 2023-01-16 15:27:31 +01:00
efi.c arm64: efi: Fix KASAN false positive for EFI runtime stack 2025-07-04 14:47:06 +01:00
elfcore.c fs: avoid mmap sem relocks when coredumping with many missing pages 2025-02-21 10:25:32 +01:00
entry-common.c Merge branch 'for-next/sme-fixes' into for-next/core 2025-05-27 12:26:43 +01:00
entry-fpsimd.S arm64/sme: Implement context switching for ZT0 2023-01-20 12:23:06 +00:00
entry-ftrace.S fgraph: Replace fgraph_ret_regs with ftrace_regs 2024-12-26 10:50:02 -05:00
entry.S arm64: stacktrace: unwind exception boundaries 2024-10-17 18:06:25 +01:00
fpsimd.c Merge branch 'for-next/sme-fixes' into for-next/core 2025-05-27 12:26:43 +01:00
ftrace.c arm64: module: Use RCU in all users of __module_text_address(). 2025-03-10 11:54:45 +01:00
head.S arm64/boot: Move init_pgdir[] and init_idmap_pgdir[] into __pi_ namespace 2025-05-16 16:05:21 +01:00
hibernate-asm.S
hibernate.c hugetlb: arm64: add mte support 2024-10-16 14:50:47 +01:00
hw_breakpoint.c perf/bpf: Remove unneeded uses_default_overflow_handler() 2024-04-12 11:49:50 +02:00
hyp-stub.S arm64: errata: Work around AmpereOne's erratum AC04_CPU_23 2025-05-19 12:46:26 +01:00
idle.c arm64: idle: Tag the arm64 idle functions as __cpuidle 2023-09-25 17:15:28 +01:00
image-vars.h arm64 fixes for -rc1 2025-06-05 11:39:17 -07:00
image.h
io.c arm64: Use new fallback IO memcpy/memset 2024-10-28 21:44:29 +00:00
irq.c arm64: irq: set the correct node for shadow call stack 2023-12-13 12:09:00 +00:00
jump_label.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
kaslr.c arm64/mm: Remove randomization of the linear map 2025-04-29 13:21:49 +01:00
kexec_image.c kexec_file, arm64: print out debugging message if required 2023-12-20 15:02:57 -08:00
kgdb.c asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
kuser32.S arm64: Update Documentation/arm references 2023-06-12 06:33:48 -06:00
machine_kexec_file.c arm64, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
machine_kexec.c kexec: Consolidate machine_kexec_mask_interrupts() implementation 2024-12-11 20:32:34 +01:00
Makefile arm64: Unconditionally select CONFIG_JUMP_LABEL 2025-07-04 14:47:51 +01:00
Makefile.syscalls syscalls: fix syscall macros for newfstat/newfstatat 2024-08-02 15:20:47 +02:00
module-plts.c Merge branch 'for-next/cpus_have_const_cap' into for-next/core 2023-10-26 17:10:18 +01:00
module.c arm64/scs: Fix handling of DWARF augmentation data in CIE/FDE frames 2024-11-08 16:37:55 +00:00
mte.c hugetlb: arm64: add mte support 2024-10-16 14:50:47 +01:00
paravirt.c arm64: paravirt: remove conduit check in has_pv_steal_clock 2022-11-09 18:11:56 +00:00
patching.c arm64: patching: avoid early page_to_phys() 2024-12-03 18:05:42 +00:00
pci.c arm64: PCI: Migrate ACPI related functions to pci-acpi.c 2024-08-27 15:48:34 +02:00
perf_callchain.c perf/core: Correct perf sampling with guest VMs 2024-11-14 10:40:01 +01:00
perf_regs.c perf: arm64: Add SVE vector granule register to user regs 2022-09-22 15:06:02 +01:00
pointer_auth.c
process.c arm64: poe: Handle spurious Overlay faults 2025-07-04 16:40:38 +01:00
proton-pack.c arm64: proton-pack: Add new CPUs 'k' values for branch mitigation 2025-05-08 15:29:28 +01:00
psci.c arm64: psci: Ignore DENIED CPUs 2024-06-28 18:38:31 +01:00
ptrace.c arm64/ptrace: Fix stack-out-of-bounds read in regs_get_kernel_stack_nth() 2025-06-12 17:28:18 +01:00
reloc_test_core.c ARM64: reloc_test: add missing MODULE_DESCRIPTION() macro 2024-06-13 10:23:54 +01:00
reloc_test_syms.S
relocate_kernel.S arm64: kexec: load from kimage prior to clobbering 2022-05-17 14:25:35 +01:00
return_address.c
rsi.c arm64: rsi: Add automatic arm-cca-guest module loading 2025-01-08 13:58:49 +00:00
sdei.c arm64: sdei: abort running SDEI handlers during crash 2023-08-04 17:35:33 +01:00
setup.c arm64: Extend pr_crit message on invalid FDT 2025-04-29 16:23:57 +01:00
signal32.c arm64/fpsimd: signal32: Always save+flush state early 2025-04-09 18:06:31 +01:00
signal.c arm64/fpsimd: signal: Use SMSTOP behaviour in setup_return() 2025-05-08 15:29:09 +01:00
sigreturn32.S arm64: rework compat syscall macros 2024-07-10 14:23:38 +02:00
sleep.S arm64: mm: Handle LVA support as a CPU feature 2024-02-16 12:42:36 +00:00
smccc-call.S arm64: smccc: Remove broken support for SMCCCv1.3 SVE discard hint 2024-11-07 11:18:52 +00:00
smp_spin_table.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00
smp.c arm64: move smp_send_stop() cpu mask off stack 2025-07-04 16:32:15 +01:00
stacktrace.c arm64: stacktrace: Don't WARN when unwinding other tasks 2024-12-12 16:23:15 +00:00
suspend.c arm64/sme: Restore SME registers on exit from suspend 2024-02-20 12:19:15 +00:00
sys32.c arm64: convert unistd_32.h to syscall.tbl format 2024-07-10 14:23:38 +02:00
sys_compat.c arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1542419 2023-10-16 14:17:06 +01:00
sys.c arm64: generate 64-bit syscall.tbl 2024-07-10 14:23:38 +02:00
syscall.c arm64: convert unistd_32.h to syscall.tbl format 2024-07-10 14:23:38 +02:00
time.c
topology.c Merge branch 'for-next/smt-control' into for-next/core 2025-03-25 19:32:28 +00:00
trace-events-emulation.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
traps.c ubsan: Remove regs from report_ubsan_failure() 2025-05-07 11:21:35 +01:00
vdso32-wrap.S
vdso-wrap.S
vdso.c mseal sysmap: enable arm64 2025-04-01 15:17:15 -07:00
vmcore_info.c crash: split vmcoreinfo exporting code out from crash_core.c 2024-02-23 17:48:22 -08:00
vmlinux.lds.S ARM: 2025-05-29 08:10:01 -07:00
watchdog_hld.c arm64: enable perf events based hard lockup detector 2023-06-09 17:44:22 -07:00