linux/arch/arm64/kernel
Mark Rutland f80d034086 arm64: ensure ERET from kthread is illegal
For consistency, all tasks have a pt_regs reserved at the highest
portion of their task stack. Among other things, this ensures that a
task's SP is always pointing within its stack rather than pointing
immediately past the end.

While it is never legitimate to ERET from a kthread, we take pains to
initialize pt_regs for kthreads as if this were legitimate. As this is
never legitimate, the effects of an erroneous return are rarely tested.

Let's simplify things by initializing a kthread's pt_regs such that an
ERET is caught as an illegal exception return, and removing the explicit
initialization of other exception context. Note that as
spectre_v4_enable_task_mitigation() only manipulates the PSTATE within
the unused regs this is safe to remove.

As user tasks will have their exception context initialized via
start_thread() or start_compat_thread(), this should only impact cases
where something has gone very wrong and we'd like that to be clearly
indicated.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201113124937.20574-2-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2020-12-02 19:44:02 +00:00
..
probes arm64: kprobes: Use BRK instead of single-step when executing instructions out-of-line 2020-11-03 14:03:38 +00:00
vdso arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y 2020-11-09 21:49:34 +00:00
vdso32 arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y 2020-11-09 21:49:34 +00:00
.gitignore
acpi_numa.c
acpi_parking_protocol.c
acpi.c arm64: permit ACPI core to map kernel memory used for table overrides 2020-09-30 22:27:51 +01:00
alternative.c arm64: alternatives: Remove READ_ONCE() usage during patch operation 2020-11-09 21:49:34 +00:00
armv8_deprecated.c
asm-offsets.c KVM: arm64: Make struct kvm_regs userspace-only 2020-07-07 09:28:38 +01:00
cacheinfo.c
cpu_errata.c arm64: Add workaround for Arm Cortex-A77 erratum 1508412 2020-10-29 12:56:01 +00:00
cpu_ops.c
cpu-reset.h
cpu-reset.S arm64/relocate_kernel: remove redundant code 2020-09-11 19:06:25 +01:00
cpufeature.c arm64: cpufeatures: Add capability for LDAPR instruction 2020-11-09 21:49:34 +00:00
cpuidle.c
cpuinfo.c arm64: avoid -Woverride-init warning 2020-10-28 13:38:36 +00:00
crash_core.c arm64/crash_core: Export TCR_EL1.T1SZ in vmcoreinfo 2020-07-02 17:56:49 +01:00
crash_dump.c
debug-monitors.c arm64: Improve diagnostics when trapping BRK with FAULT_BRK_IMM 2020-09-18 16:35:54 +01:00
efi-entry.S arm64 updates for 5.8 2020-06-01 15:18:27 -07:00
efi-header.S arm64: efi: increase EFI PE/COFF header padding to 64 KB 2020-10-28 14:02:03 +00:00
efi-rt-wrapper.S Merge branch 'for-next/scs' into for-next/core 2020-05-28 18:03:40 +01:00
efi.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
entry-common.c arm64: ptrauth: Introduce Armv8.3 pointer authentication enhancements 2020-09-14 12:07:02 +01:00
entry-fpsimd.S arm64/sve: Implement a helper to load SVE registers from FPSIMD state 2020-09-21 18:06:33 +01:00
entry-ftrace.S
entry.S arm64: Add workaround for Arm Cortex-A77 erratum 1508412 2020-10-29 12:56:01 +00:00
fpsimd.c arm64: reject prctl(PR_PAC_RESET_KEYS) on compat tasks 2020-10-15 10:50:09 +01:00
ftrace.c arm64: ftrace: Change CONFIG_FTRACE_WITH_REGS to CONFIG_DYNAMIC_FTRACE_WITH_REGS 2020-06-08 15:44:59 +01:00
head.S Revert "arm64: initialize per-cpu offsets earlier" 2020-10-09 11:24:17 +01:00
hibernate-asm.S
hibernate.c Merge branch 'for-next/mte' into for-next/core 2020-10-02 12:16:11 +01:00
hw_breakpoint.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hyp-stub.S
image-vars.h KVM/arm64 fixes for 5.10, take #1 2020-10-30 13:25:09 -04:00
image.h arm64: get rid of TEXT_OFFSET 2020-09-07 15:00:52 +01:00
insn.c arm64: kprobe: disable probe of fault prone ptrauth instruction 2020-09-14 12:07:02 +01:00
io.c
irq.c arm64: Remove custom IRQ stat accounting 2020-09-17 16:37:28 +01:00
jump_label.c
kaslr.c arm64: kaslr: Use standard early random function 2020-08-07 09:10:11 -07:00
kexec_image.c arm64: kexec_file: try more regions if loading segments fails 2020-11-05 21:48:05 +00:00
kgdb.c arm64: kgdb: Fix single-step exception handling oops 2020-07-08 22:18:54 +01:00
kuser32.S
machine_kexec_file.c arm64: kexec_file: try more regions if loading segments fails 2020-11-05 21:48:05 +00:00
machine_kexec.c
Makefile Merge branch 'for-next/mte' into for-next/core 2020-10-02 12:16:11 +01:00
module-plts.c arm64/module: set trampoline section flags regardless of CONFIG_DYNAMIC_FTRACE 2020-09-02 08:35:33 +01:00
module.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mte.c arm64: mte: Enable swap of tagged pages 2020-09-04 12:46:07 +01:00
paravirt.c arm64: paravirt: Initialize steal time when cpu is online 2020-09-17 18:12:18 +01:00
pci.c
perf_callchain.c arm64: stacktrace: Make stack walk callback consistent with generic code 2020-09-18 14:24:16 +01:00
perf_event.c arm64: perf: Defer irq_work to IPI_IRQ_WORK 2020-09-28 19:00:17 +01:00
perf_regs.c arm64: fix some spelling mistakes in the comments by codespell 2020-09-07 14:18:50 +01:00
pointer_auth.c arm64: reject prctl(PR_PAC_RESET_KEYS) on compat tasks 2020-10-15 10:50:09 +01:00
process.c arm64: ensure ERET from kthread is illegal 2020-12-02 19:44:02 +00:00
proton-pack.c arm64: alternatives: Split up alternative.h 2020-11-09 21:49:34 +00:00
psci.c
ptrace.c arm64: mte: ptrace: Add NT_ARM_TAGGED_ADDR_CTRL regset 2020-09-04 12:46:07 +01:00
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S arm64/relocate_kernel: remove redundant code 2020-09-11 19:06:25 +01:00
return_address.c arm64: stacktrace: Make stack walk callback consistent with generic code 2020-09-18 14:24:16 +01:00
scs.c
sdei.c uaccess: add force_uaccess_{begin,end} helpers 2020-08-12 10:57:59 -07:00
setup.c memblock: use separate iterators for memory and reserved regions 2020-10-13 18:38:35 -07:00
signal32.c arm64: compat: Always use sigpage for sigreturn trampoline 2020-06-23 14:56:24 +01:00
signal.c tracehook: clear TIF_NOTIFY_RESUME in tracehook_notify_resume() 2020-10-17 15:04:36 -06:00
sigreturn32.S
sleep.S Merge branch 'for-next/bti' into for-next/core 2020-05-28 18:00:51 +01:00
smccc-call.S arm64/kernel: Remove needless Call Frame Information annotations 2020-09-01 09:50:36 +02:00
smp_spin_table.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
smp.c arm64/smp: Move rcu_cpu_starting() earlier 2020-10-30 08:13:18 +00:00
stacktrace.c arm64: Move console stack display code to stacktrace.c 2020-09-21 19:43:03 +01:00
suspend.c Merge branch 'for-next/mte' into for-next/core 2020-10-02 12:16:11 +01:00
sys32.c
sys_compat.c
sys.c
syscall.c arm64: mte: Handle synchronous and asynchronous tag check faults 2020-09-04 12:46:06 +01:00
time.c
topology.c Power management updates for 5.10-rc1 2020-10-14 10:45:41 -07:00
trace-events-emulation.h
traps.c Merge branches 'for-next/acpi', 'for-next/boot', 'for-next/bpf', 'for-next/cpuinfo', 'for-next/fpsimd', 'for-next/misc', 'for-next/mm', 'for-next/pci', 'for-next/perf', 'for-next/ptrauth', 'for-next/sdei', 'for-next/selftests', 'for-next/stacktrace', 'for-next/svm', 'for-next/topology', 'for-next/tpyos' and 'for-next/vdso' into for-next/core 2020-10-02 12:01:41 +01:00
vdso.c arm64: vdso: Fix unusual formatting in *setup_additional_pages() 2020-09-01 13:37:57 +01:00
vmlinux.lds.S arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y 2020-11-09 21:49:34 +00:00