[PATCH 0/1] MR9502: ntoskrnl.exe: Open thread with MAXIMUM_ALLOWED access in KeGetCurrentThread().
From: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/ntoskrnl.exe/ntoskrnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index def86ca17e8..b3f45751b99 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -2571,7 +2571,7 @@ PRKTHREAD WINAPI KeGetCurrentThread(void) /* FIXME: we shouldn't need it, GetCurrentThread() should be client thread already */ if (GetCurrentThreadId() == request_thread) - handle = OpenThread( THREAD_QUERY_INFORMATION, FALSE, client_tid ); + handle = OpenThread( MAXIMUM_ALLOWED, FALSE, client_tid ); kernel_object_from_handle( handle, PsThreadType, (void**)&thread ); if (handle != GetCurrentThread()) NtClose( handle ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9502
NASCAR 25 sets some DACLs to the game threads which result in failure to open those in KeGetCurrentThread() when processing a request (to Wine driver) issued by such a thread. Ideally we should not use user-mode handle open functions at all in ntoskrnl / drivers, but we don't yet have full kernel object access management and both ntoskrnl and Wine drivers resort to some user-mode things currently. kernel_object_from_handle() called after doesn't depend on any access rights on user thread handle. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9502#note_122670
participants (2)
-
Paul Gofman -
Paul Gofman (@gofman)