Removed patch to fix various bugs in RtlUnwindEx on x86_64 (accepted upstream).

This commit is contained in:
Sebastian Lackner 2015-04-03 15:17:42 +02:00
parent e417298237
commit 031d8707e6
12 changed files with 37 additions and 240 deletions

View File

@ -125,7 +125,7 @@ for more details.*
* Fix access violation when calling GetStringTypeW with NULL src. ([Wine Bug #37759](https://bugs.winehq.org/show_bug.cgi?id=37759))
* Fix black screen on startup introduced by pixelformat changes. ([Wine Bug #35950](https://bugs.winehq.org/show_bug.cgi?id=35950))
* Fix caps lock state issues with multiple processes ([Wine Bug #35907](https://bugs.winehq.org/show_bug.cgi?id=35907))
* Fix check for end_frame in RtlUnwindEx on x86_64. ([Wine Bug #34254](https://bugs.winehq.org/show_bug.cgi?id=34254))
* ~~Fix check for end_frame in RtlUnwindEx on x86_64.~~ ([Wine Bug #34254](https://bugs.winehq.org/show_bug.cgi?id=34254))
* Fix comparison of punctuation characters in lstrcmp ([Wine Bug #10767](https://bugs.winehq.org/show_bug.cgi?id=10767))
* Fix condition mask handling in RtlVerifyVersionInfo ([Wine Bug #36143](https://bugs.winehq.org/show_bug.cgi?id=36143))
* Fix crash in Space Rangers2 caused by missing DXTn support ([Wine Bug #24983](https://bugs.winehq.org/show_bug.cgi?id=24983))

1
debian/changelog vendored
View File

@ -25,6 +25,7 @@ wine-staging (1.7.40) UNRELEASED; urgency=low
* Removed patch to emulate 'mov Eb, Gb' instruction on x86 processor architecture (accepted upstream).
* Removed patches for Setup*Log() functions (accepted upstream).
* Removed tests for job objects (accepted upstream).
* Removed patch to fix various bugs in RtlUnwindEx on x86_64 (accepted upstream).
* Partially removed patches for job objects (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 23 Mar 2015 16:12:20 +0100

View File

@ -1,4 +1,4 @@
From 8ce7a8b0f7ea6a94ae8327b4a3d07a10c12a2c9e Mon Sep 17 00:00:00 2001
From e498b901443fffeb344b2dcc4627da4b520f0af9 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 27 Mar 2015 15:32:04 +0100
Subject: Revert "advapi32: Add DACL inheritance support in SetSecurityInfo."
@ -10,7 +10,7 @@ This reverts commit f974d726720eff4fcd7371bca95e6cdcc4b4a848.
2 files changed, 14 insertions(+), 139 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 71a8c92..e8cdcc5 100644
index 2cd3f74..e8cdcc5 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -4052,8 +4052,6 @@ DWORD WINAPI SetNamedSecurityInfoW(LPWSTR pObjectName,
@ -35,7 +35,7 @@ index 71a8c92..e8cdcc5 100644
SetSecurityDescriptorGroup(&sd, psidGroup, FALSE);
if (SecurityInfo & DACL_SECURITY_INFORMATION)
- {
- if (ObjectType == SE_FILE_OBJECT)
- if (ObjectType == SE_FILE_OBJECT && pDacl)
- {
- SECURITY_DESCRIPTOR_CONTROL control;
- PSECURITY_DESCRIPTOR psd;
@ -172,10 +172,10 @@ index 71a8c92..e8cdcc5 100644
}
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 15c3b1d..6d3f9ac 100644
index 466100d..53fd643 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3417,22 +3417,25 @@ static void test_GetNamedSecurityInfoA(void)
@@ -3615,22 +3615,25 @@ static void test_GetNamedSecurityInfoA(void)
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION,
NULL, NULL, &pDacl, NULL, &pSD);
@ -210,7 +210,7 @@ index 15c3b1d..6d3f9ac 100644
+ todo_wine ok(h != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
CloseHandle(h);
/* NtSetSecurityObject doesn't inherit DACL entries */
/* test setting NULL DACL */
--
2.3.3

View File

@ -1,15 +1,15 @@
From 0f1815d016ff6cce3fae3e49f7ddb18121e469c4 Mon Sep 17 00:00:00 2001
From 0e64055fbe7f17de05328353457b93f720ef3bb7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 27 Mar 2015 15:32:32 +0100
Subject: Revert "advapi32: Add SetNamedSecurityInfo test with empty DACL."
This reverts commit 02c4f5bd275d70d1dcb48bf95775efa376b50c22.
---
dlls/advapi32/tests/security.c | 79 +++---------------------------------------
1 file changed, 4 insertions(+), 75 deletions(-)
dlls/advapi32/tests/security.c | 95 ++----------------------------------------
1 file changed, 4 insertions(+), 91 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index bd552d6..7ee881f 100644
index 00dd9e8..b19dbe8 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -125,7 +125,6 @@ static BOOL (WINAPI *pCreateRestrictedToken)(HANDLE, DWORD, DWORD, PSID_AND_ATTR
@ -28,7 +28,7 @@ index bd552d6..7ee881f 100644
pNtCreateFile = (void *)GetProcAddress(hntdll, "NtCreateFile");
pRtlDosPathNameToNtPathName_U = (void *)GetProcAddress(hntdll, "RtlDosPathNameToNtPathName_U");
pRtlAnsiStringToUnicodeString = (void *)GetProcAddress(hntdll, "RtlAnsiStringToUnicodeString");
@@ -3394,7 +3392,7 @@ static void test_GetNamedSecurityInfoA(void)
@@ -3429,7 +3427,7 @@ static void test_GetNamedSecurityInfoA(void)
char invalid_path[] = "/an invalid file path";
int users_ace_id = -1, admins_ace_id = -1, i;
char software_key[] = "MACHINE\\Software";
@ -37,7 +37,7 @@ index bd552d6..7ee881f 100644
SECURITY_DESCRIPTOR_CONTROL control;
ACL_SIZE_INFORMATION acl_size;
CHAR windows_dir[MAX_PATH];
@@ -3406,12 +3404,11 @@ static void test_GetNamedSecurityInfoA(void)
@@ -3441,12 +3439,11 @@ static void test_GetNamedSecurityInfoA(void)
BOOL owner_defaulted;
BOOL group_defaulted;
BOOL dacl_defaulted;
@ -51,7 +51,7 @@ index bd552d6..7ee881f 100644
if (!pSetNamedSecurityInfoA || !pGetNamedSecurityInfoA || !pCreateWellKnownSid)
{
@@ -3516,8 +3513,8 @@ static void test_GetNamedSecurityInfoA(void)
@@ -3551,8 +3548,8 @@ static void test_GetNamedSecurityInfoA(void)
bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE);
ok(bret, "Failed to add ACL to security desciptor.\n");
GetTempFileNameA(".", "foo", 0, tmpfile);
@ -62,7 +62,7 @@ index bd552d6..7ee881f 100644
SetLastError(0xdeadbeef);
error = pSetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL,
NULL, pDacl, NULL);
@@ -3569,74 +3566,6 @@ static void test_GetNamedSecurityInfoA(void)
@@ -3604,90 +3601,6 @@ static void test_GetNamedSecurityInfoA(void)
}
LocalFree(pSD);
HeapFree(GetProcessHeap(), 0, user);
@ -99,6 +99,22 @@ index bd552d6..7ee881f 100644
- todo_wine ok(h != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
- CloseHandle(h);
-
- /* test setting NULL DACL */
- error = pSetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
- DACL_SECURITY_INFORMATION, NULL, NULL, NULL, NULL);
- ok(!error, "SetNamedSecurityInfoA failed with error %d\n", error);
-
- error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION,
- NULL, NULL, &pDacl, NULL, &pSD);
- ok(!error, "GetNamedSecurityInfo failed with error %d\n", error);
- todo_wine ok(!pDacl, "pDacl != NULL\n");
- LocalFree(pSD);
-
- h = CreateFileA(tmpfile, GENERIC_READ, FILE_SHARE_DELETE|FILE_SHARE_WRITE|FILE_SHARE_READ,
- NULL, OPEN_EXISTING, 0, NULL);
- ok(h != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
- CloseHandle(h);
-
- /* NtSetSecurityObject doesn't inherit DACL entries */
- pSD = sd+sizeof(void*)-((ULONG_PTR)sd)%sizeof(void*);
- InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION);

View File

@ -1,53 +0,0 @@
From d5cbae7de46fb8b334cda913d6f141669424d2c0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 25 Jan 2015 15:46:05 +0100
Subject: ntdll: Fix check for end_frame in RtlUnwindEx on x86_64. (rev 3)
Changes in v2:
* Calling wine internal handlers should not mess up the EstablisherFrame.
Changes in v3:
* Fix dwarf_virtual_unwind too, to be compatible with RtlVirtualUnwind we
have to set the frame pointer _before_ doing the unwind.
---
dlls/ntdll/signal_x86_64.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c
index 551687f..493a9f7 100644
--- a/dlls/ntdll/signal_x86_64.c
+++ b/dlls/ntdll/signal_x86_64.c
@@ -1407,8 +1407,8 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex
TRACE( "fde %p len %x personality %p lsda %p code %lx-%lx\n",
fde, fde->length, *handler, *handler_data, info.ip, code_end );
execute_cfa_instructions( ptr, end, ip, &info );
- apply_frame_state( context, &info.state );
*frame = context->Rsp;
+ apply_frame_state( context, &info.state );
TRACE( "next function rip=%016lx\n", context->Rip );
TRACE( " rax=%016lx rbx=%016lx rcx=%016lx rdx=%016lx\n",
@@ -3214,6 +3214,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
}
else /* hack: call builtin handlers registered in the tib list */
{
+ DWORD64 backup_frame = dispatch.EstablisherFrame;
while ((ULONG64)teb_frame < new_context.Rsp && (ULONG64)teb_frame < (ULONG64)end_frame)
{
TRACE( "found builtin frame %p handler %p\n", teb_frame, teb_frame->Handler );
@@ -3222,10 +3223,10 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
teb_frame = __wine_pop_frame( teb_frame );
}
if ((ULONG64)teb_frame == (ULONG64)end_frame && (ULONG64)end_frame < new_context.Rsp) break;
- dispatch.EstablisherFrame = new_context.Rsp;
+ dispatch.EstablisherFrame = backup_frame;
}
- if (context->Rsp == (ULONG64)end_frame) break;
+ if (dispatch.EstablisherFrame == (ULONG64)end_frame) break;
*context = new_context;
}
--
2.3.2

View File

@ -1 +0,0 @@
Fixes: [34254] Fix check for end_frame in RtlUnwindEx on x86_64.

View File

@ -151,7 +151,6 @@ patch_enable_all ()
enable_ntdll_NtSetLdtEntries="$1"
enable_ntdll_Pipe_SpecialCharacters="$1"
enable_ntdll_RtlIpStringToAddress="$1"
enable_ntdll_RtlUnwindEx="$1"
enable_ntdll_ThreadTime="$1"
enable_ntdll_Threading="$1"
enable_ntdll_User_Shared_Data="$1"
@ -520,9 +519,6 @@ patch_enable ()
ntdll-RtlIpStringToAddress)
enable_ntdll_RtlIpStringToAddress="$2"
;;
ntdll-RtlUnwindEx)
enable_ntdll_RtlUnwindEx="$2"
;;
ntdll-ThreadTime)
enable_ntdll_ThreadTime="$2"
;;
@ -3276,21 +3272,6 @@ if test "$enable_ntdll_RtlIpStringToAddress" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-RtlUnwindEx
# |
# | This patchset fixes the following Wine bugs:
# | * [#34254] Fix check for end_frame in RtlUnwindEx on x86_64.
# |
# | Modified files:
# | * dlls/ntdll/signal_x86_64.c
# |
if test "$enable_ntdll_RtlUnwindEx" -eq 1; then
patch_apply ntdll-RtlUnwindEx/0001-ntdll-Fix-check-for-end_frame-in-RtlUnwindEx-on-x86_.patch
(
echo '+ { "Sebastian Lackner", "ntdll: Fix check for end_frame in RtlUnwindEx on x86_64.", 3 },';
) >> "$patchlist"
fi
# Patchset ntdll-ThreadTime
# |
# | This patchset fixes the following Wine bugs:
@ -3893,19 +3874,16 @@ fi
# | * [#33723] EA Origin needs support for job objects
# |
# | Modified files:
# | * dlls/kernel32/tests/process.c, dlls/ntdll/om.c, dlls/ntdll/sync.c, server/handle.c, server/object.c, server/object.h,
# | server/process.c, server/process.h, server/protocol.def
# | * dlls/kernel32/tests/process.c, dlls/ntdll/sync.c, server/process.c, server/process.h, server/protocol.def
# |
if test "$enable_server_JobObjects" -eq 1; then
patch_apply server-JobObjects/0001-server-Implement-remaining-wineserver-calls-for-job-.patch
patch_apply server-JobObjects/0002-server-Properly-track-handle-count-of-objects.patch
patch_apply server-JobObjects/0003-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch
patch_apply server-JobObjects/0004-kernel32-tests-Add-tests-for-waiting-on-an-job-objec.patch
patch_apply server-JobObjects/0005-server-Implement-waiting-for-job-objects.patch
patch_apply server-JobObjects/0006-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch
patch_apply server-JobObjects/0002-server-Implement-JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.patch
patch_apply server-JobObjects/0003-kernel32-tests-Add-tests-for-waiting-on-an-job-objec.patch
patch_apply server-JobObjects/0004-server-Implement-waiting-for-job-objects.patch
patch_apply server-JobObjects/0005-ntdll-Implement-NtQueryInformationJobObject-stub-fun.patch
(
echo '+ { "Andrew Cook", "server: Implement remaining wineserver calls for job objects.", 1 },';
echo '+ { "Andrew Cook", "server: Properly track handle count of objects.", 1 },';
echo '+ { "Andrew Cook", "server: Implement JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.", 1 },';
echo '+ { "Sebastian Lackner", "kernel32/tests: Add tests for waiting on an job object.", 1 },';
echo '+ { "Sebastian Lackner", "server: Implement waiting for job objects.", 1 },';

View File

@ -1,144 +0,0 @@
From 7d8fc002a6adf69f64f635d37b19ddc892283f03 Mon Sep 17 00:00:00 2001
From: Andrew Cook <ariscop@gmail.com>
Date: Thu, 26 Feb 2015 10:51:16 +1100
Subject: server: Properly track handle count of objects.
---
dlls/ntdll/om.c | 2 +-
server/handle.c | 25 +++++++++++++++++++++----
server/object.c | 2 ++
server/object.h | 1 +
server/protocol.def | 1 +
5 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c
index f5f75c6..b337444 100644
--- a/dlls/ntdll/om.c
+++ b/dlls/ntdll/om.c
@@ -77,7 +77,7 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
memset( p, 0, sizeof(*p) );
p->GrantedAccess = reply->access;
p->PointerCount = reply->ref_count;
- p->HandleCount = 1; /* at least one */
+ p->HandleCount = reply->handle_count;
if (used_len) *used_len = sizeof(*p);
}
}
diff --git a/server/handle.c b/server/handle.c
index 0293ed6..3b994c5 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -97,6 +97,22 @@ static inline obj_handle_t handle_global_to_local( obj_handle_t handle )
return handle ^ HANDLE_OBFUSCATOR;
}
+/* grab an object and increment its handle count */
+static struct object *grab_object_for_handle( void *ptr )
+{
+ struct object *obj = (struct object *)ptr;
+ obj->handlecount++;
+ return grab_object( obj );
+}
+
+/* release an object and decrement its handle count */
+static void release_object_from_handle( void *ptr )
+{
+ struct object *obj = (struct object *)ptr;
+ assert( obj->handlecount );
+ obj->handlecount--;
+ release_object( obj );
+}
static void handle_table_dump( struct object *obj, int verbose );
static void handle_table_destroy( struct object *obj );
@@ -166,7 +182,7 @@ static void handle_table_destroy( struct object *obj )
{
struct object *obj = entry->ptr;
entry->ptr = NULL;
- if (obj) release_object( obj );
+ if (obj) release_object_from_handle( obj );
}
free( table->entries );
}
@@ -229,7 +245,7 @@ static obj_handle_t alloc_entry( struct handle_table *table, void *obj, unsigned
table->last = i;
found:
table->free = i + 1;
- entry->ptr = grab_object( obj );
+ entry->ptr = grab_object_for_handle( obj );
entry->access = access;
return index_to_handle(i);
}
@@ -355,7 +371,7 @@ struct handle_table *copy_handle_table( struct process *process, struct process
for (i = 0; i <= table->last; i++, ptr++)
{
if (!ptr->ptr) continue;
- if (ptr->access & RESERVED_INHERIT) grab_object( ptr->ptr );
+ if (ptr->access & RESERVED_INHERIT) grab_object_for_handle( ptr->ptr );
else ptr->ptr = NULL; /* don't inherit this entry */
}
}
@@ -379,7 +395,7 @@ unsigned int close_handle( struct process *process, obj_handle_t handle )
table = handle_is_global(handle) ? global_table : process->handles;
if (entry < table->entries + table->free) table->free = entry - table->entries;
if (entry == table->entries + table->last) shrink_handle_table( table );
- release_object( obj );
+ release_object_from_handle( obj );
return STATUS_SUCCESS;
}
@@ -630,6 +646,7 @@ DECL_HANDLER(get_object_info)
reply->access = get_handle_access( current->process, req->handle );
reply->ref_count = obj->refcount;
+ reply->handle_count = obj->handlecount;
if ((name = get_object_full_name( obj, &reply->total )))
set_reply_data_ptr( name, min( reply->total, get_reply_max_size() ));
release_object( obj );
diff --git a/server/object.c b/server/object.c
index d4afefd..1912576 100644
--- a/server/object.c
+++ b/server/object.c
@@ -207,6 +207,7 @@ void *alloc_object( const struct object_ops *ops )
if (obj)
{
obj->refcount = 1;
+ obj->handlecount = 0;
obj->ops = ops;
obj->name = NULL;
obj->sd = NULL;
@@ -306,6 +307,7 @@ void release_object( void *ptr )
assert( obj->refcount );
if (!--obj->refcount)
{
+ assert( !obj->handlecount );
/* if the refcount is 0, nobody can be in the wait queue */
assert( list_empty( &obj->wait_queue ));
obj->ops->destroy( obj );
diff --git a/server/object.h b/server/object.h
index 3817c75..978baeb 100644
--- a/server/object.h
+++ b/server/object.h
@@ -95,6 +95,7 @@ struct object_ops
struct object
{
unsigned int refcount; /* reference count */
+ unsigned int handlecount; /* handle count */
const struct object_ops *ops;
struct list wait_queue;
struct object_name *name;
diff --git a/server/protocol.def b/server/protocol.def
index c88c970..fdebf29 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3269,6 +3269,7 @@ enum coords_relative
@REPLY
unsigned int access; /* granted access mask */
unsigned int ref_count; /* object ref count */
+ unsigned int handle_count; /* object handle count */
data_size_t total; /* total needed size for name */
VARARG(name,unicode_str); /* object name */
@END
--
2.3.3