[PATCH 11/18] ntdll: Fix arm call_user_exception_dispatcher with kernel stack for syscalls.
Martin Storsjö
martin at martin.st
Tue Nov 9 08:05:48 CST 2021
This does the same as 23b44e8df62847872d036cd88d72e36b5424ee35,
but for arm:
Don't call KiUserExceptionDispatcher directly on the stack pointer
stored in the CONTEXT, but use the one stored in syscall_frame
(which includes the stack allocation in e.g. RtlRaiseException).
Signed-off-by: Martin Storsjö <martin at martin.st>
---
dlls/ntdll/unix/signal_arm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c
index 798d7b9cc87..88718e938a8 100644
--- a/dlls/ntdll/unix/signal_arm.c
+++ b/dlls/ntdll/unix/signal_arm.c
@@ -563,12 +563,16 @@ void call_raise_user_exception_dispatcher(void)
NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context )
{
struct syscall_frame *frame = arm_thread_data()->syscall_frame;
+ DWORD lr = frame->lr;
+ DWORD sp = frame->sp;
NTSTATUS status = NtSetContextThread( GetCurrentThread(), context );
if (status) return status;
frame->r0 = (DWORD)rec;
frame->r1 = (DWORD)context;
frame->pc = (DWORD)pKiUserExceptionDispatcher;
+ frame->lr = lr;
+ frame->sp = sp;
frame->restore_flags |= CONTEXT_INTEGER | CONTEXT_CONTROL;
return status;
}
--
2.25.1
More information about the wine-devel
mailing list