diff options
| author | Ada Couprie Diaz <[email protected]> | 2025-10-14 09:25:36 +0000 |
|---|---|---|
| committer | Catalin Marinas <[email protected]> | 2025-10-17 17:08:05 +0000 |
| commit | ea0d55ae4b3207c33691a73da3443b1fd379f1d2 (patch) | |
| tree | d80d46b2aa4b8d31cd0403b4cbfb9b7da088401d /lib/test_fortify/write_overflow-strlcpy-src.c | |
| parent | arm64/sysreg: Fix GIC CDEOI instruction encoding (diff) | |
| download | kernel-ea0d55ae4b3207c33691a73da3443b1fd379f1d2.tar.gz kernel-ea0d55ae4b3207c33691a73da3443b1fd379f1d2.zip | |
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: <[email protected]> # 6.17
Signed-off-by: Ada Couprie Diaz <[email protected]>
Acked-by: Mark Rutland <[email protected]>
[[email protected]: added Mark's rewritten commit log and some whitespace]
Signed-off-by: Catalin Marinas <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions
