linux/arch/arm64/kernel
Ada Couprie Diaz ea0d55ae4b arm64: debug: always unmask interrupts in el0_softstp()
We intend that EL0 exception handlers unmask all DAIF exceptions
before calling exit_to_user_mode().

When completing single-step of a suspended breakpoint, we do not call
local_daif_restore(DAIF_PROCCTX) before calling exit_to_user_mode(),
leaving all DAIF exceptions masked.

When pseudo-NMIs are not in use this is benign.

When pseudo-NMIs are in use, this is unsound. At this point interrupts
are masked by both DAIF.IF and PMR_EL1, and subsequent irq flag
manipulation may not work correctly. For example, a subsequent
local_irq_enable() within exit_to_user_mode_loop() will only unmask
interrupts via PMR_EL1 (leaving those masked via DAIF.IF), and
anything depending on interrupts being unmasked (e.g. delivery of
signals) will not work correctly.

This was detected by CONFIG_ARM64_DEBUG_PRIORITY_MASKING.

Move the call to `try_step_suspended_breakpoints()` outside of the check
so that interrupts can be unmasked even if we don't call the step handler.

Fixes: 0ac7584c08 ("arm64: debug: split single stepping exception entry")
Cc: <stable@vger.kernel.org> # 6.17
Signed-off-by: Ada Couprie Diaz <ada.coupriediaz@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
[catalin.marinas@arm.com: added Mark's rewritten commit log and some whitespace]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2025-10-17 18:08:05 +01:00
..
pi arm64: map [_text, _stext) virtual address range non-executable+read-only 2025-09-22 11:58:17 +01:00
probes arm64: kprobes: call set_memory_rox() for kprobe page 2025-09-25 13:56:48 +01:00
vdso stackleak: Split KSTACK_ERASE_CFLAGS from GCC_PLUGINS_CFLAGS 2025-07-21 21:40:57 -07:00
vdso32 Updates for the VDSO subsystem: 2025-09-30 16:58:21 -07:00
.gitignore
Makefile arm64 updates for 6.17: 2025-07-29 20:21:54 -07:00
Makefile.syscalls
acpi.c Merge branch 'for-next/entry' into for-next/core 2025-09-24 16:34:02 +01:00
acpi_numa.c
acpi_parking_protocol.c
alternative.c
armv8_deprecated.c
asm-offsets.c arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-09-25 09:57:15 +02: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-reset.S
cpu_errata.c arm64: errata: Apply workarounds for Neoverse-V3AE 2025-09-22 11:27:14 +01:00
cpu_ops.c
cpufeature.c arm64 fixes for -rc1 2025-10-07 08:59:25 -07:00
cpuinfo.c arm64/hwcap: Add hwcap for FEAT_LSFE 2025-09-16 19:55:11 +01:00
crash_dump.c
debug-monitors.c arm64 updates for 6.18 2025-09-29 18:48:39 -07:00
efi-header.S include: pe.h: Fix PE definitions 2025-05-21 16:46:37 +02:00
efi-rt-wrapper.S
efi.c arm64: efi: Remove CONFIG_VMAP_STACK check 2025-07-08 13:41:08 +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 arm64: debug: always unmask interrupts in el0_softstp() 2025-10-17 18:08:05 +01:00
entry-fpsimd.S
entry-ftrace.S fgraph: Replace fgraph_ret_regs with ftrace_regs 2024-12-26 10:50:02 -05:00
entry.S arm64 updates for 6.17: 2025-07-29 20:21:54 -07:00
fpsimd.c arm64/fpsimd: simplify sme_setup() 2025-09-16 21:05:48 +01:00
ftrace.c arm64: ftrace: fix unreachable PLT for ftrace_caller in init_module with CONFIG_DYNAMIC_FTRACE 2025-09-05 16:56:20 +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
hw_breakpoint.c arm64: debug: split hardware watchpoint exception entry 2025-07-08 13:27:42 +01:00
hyp-stub.S arm64: errata: Work around AmpereOne's erratum AC04_CPU_23 2025-05-19 12:46:26 +01:00
idle.c
image-vars.h KVM: arm64: Don't access ICC_SRE_EL2 if GICv3 doesn't support v2 compatibility 2025-09-17 17:40:42 +01:00
image.h
io.c
irq.c arm64: remove CONFIG_VMAP_STACK conditionals from irq stack setup 2025-07-08 13:41:08 +01:00
jump_label.c
kaslr.c arm64/mm: Remove randomization of the linear map 2025-04-29 13:21:49 +01:00
kexec_image.c
kgdb.c arm64: debug: call step handlers statically 2025-07-08 13:27:41 +01:00
kuser32.S
machine_kexec.c kexec: Consolidate machine_kexec_mask_interrupts() implementation 2024-12-11 20:32:34 +01:00
machine_kexec_file.c arm64: kexec: initialize kexec_buf struct in load_other_segments() 2025-09-03 17:10:37 -07:00
module-plts.c arm64: ftrace: fix unreachable PLT for ftrace_caller in init_module with CONFIG_DYNAMIC_FTRACE 2025-09-05 16:56:20 +01:00
module.c arm64: ftrace: fix unreachable PLT for ftrace_caller in init_module with CONFIG_DYNAMIC_FTRACE 2025-09-05 16:56:20 +01:00
mte.c arm64 fixes for -rc1 2025-10-07 08:59:25 -07:00
paravirt.c
patching.c arm64: patching: avoid early page_to_phys() 2024-12-03 18:05:42 +00:00
pci.c
perf_callchain.c
perf_regs.c
pointer_auth.c
process.c arch: copy_thread: pass clone_flags as u64 2025-09-01 15:31:34 +02:00
proton-pack.c arm64: errata: Expand speculative SSBS workaround for Cortex-A720AE 2025-09-18 11:41:24 +01:00
psci.c
ptrace.c execve updates for v6.17 2025-07-28 17:11:40 -07:00
reloc_test_core.c
reloc_test_syms.S
relocate_kernel.S
return_address.c
rsi.c arm64: realm: ioremap: Allow mapping memory as encrypted 2025-09-19 10:12:01 +01:00
sdei.c arm64: ptrace: Replace interrupts_enabled() with regs_irqs_disabled() 2025-09-11 15:55:34 +01:00
setup.c arm64: map [_text, _stext) virtual address range non-executable+read-only 2025-09-22 11:58:17 +01:00
signal.c arm64: entry: Switch to generic IRQ entry 2025-09-11 15:55:35 +01:00
signal32.c arm64/fpsimd: signal32: Always save+flush state early 2025-04-09 18:06:31 +01:00
sigreturn32.S
sleep.S
smccc-call.S
smp.c KVM/arm64 changes for 6.17, round #1 2025-07-29 12:27:40 -04:00
smp_spin_table.c
stacktrace.c Merge branches 'for-next/livepatch', 'for-next/user-contig-bbml2', 'for-next/misc', 'for-next/acpi', 'for-next/debug-entry', 'for-next/feat_mte_tagged_far', 'for-next/kselftest', 'for-next/mdscr-cleanup' and 'for-next/vmap-stack', remote-tracking branch 'arm64/for-next/perf' into for-next/core 2025-07-24 16:01:22 +01:00
suspend.c
sys.c
sys32.c
sys_compat.c
syscall.c arm/syscalls: mark syscall invocation as likely in invoke_syscall 2025-09-22 13:26:16 +01: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
traps.c guest_memfd: 2025-10-04 08:52:16 -07:00
vdso-wrap.S
vdso.c mseal sysmap: enable arm64 2025-04-01 15:17:15 -07:00
vdso32-wrap.S
vmcore_info.c
vmlinux.lds.S ARM: 2025-05-29 08:10:01 -07:00
watchdog_hld.c arm64/watchdog_hld: Add a cpufreq notifier for update watchdog thresh 2025-07-04 13:17:30 +01:00