Martin Storsjö : ntdll: Fix arm call_user_exception_dispatcher with kernel stack for syscalls.

Alexandre Julliard julliard at winehq.org
Tue Nov 9 15:55:08 CST 2021


Module: wine
Branch: master
Commit: 324150c0ae0247a2a2ea72025dfff79bec5725cf
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=324150c0ae0247a2a2ea72025dfff79bec5725cf

Author: Martin Storsjö <martin at martin.st>
Date:   Tue Nov  9 16:05:48 2021 +0200

ntdll: Fix arm call_user_exception_dispatcher with kernel stack for syscalls.

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>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;
 }




More information about the wine-cvs mailing list