1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-17 12:00:35 +00:00
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: 0ac7584c08ce ("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
..
2025-09-30 16:58:21 -07:00
2025-10-07 08:59:25 -07:00
2025-09-16 19:55:11 +01:00
2025-09-29 18:48:39 -07:00
2025-05-21 16:46:37 +02:00
2025-07-29 20:21:54 -07:00
2025-09-16 21:05:48 +01:00
2025-07-29 20:21:54 -07:00
2025-10-07 08:59:25 -07:00
2025-07-28 17:11:40 -07:00
2025-07-29 12:27:40 -04:00
2025-10-04 08:52:16 -07:00
2025-04-01 15:17:15 -07:00
2025-05-29 08:10:01 -07:00