Added patch to use wrapper functions for syscalls to appease Chromium sandbox (32-bit).

This commit is contained in:
Sebastian Lackner 2015-10-16 03:48:10 +02:00
parent 032bf69aa7
commit 216a2d8994
11 changed files with 2180 additions and 31 deletions

View File

@ -34,11 +34,12 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
-----------------------------------
**Bug fixes and features included in the next upcoming release [3]:**
**Bug fixes and features included in the next upcoming release [4]:**
* Add implementation for IDXGIOutput::GetDesc ([Wine Bug #32006](https://bugs.winehq.org/show_bug.cgi?id=32006))
* Do not check if object was signaled after user APC in server_select
* Show windows version when collecting system info in winedbg
* Use wrapper functions for syscalls to appease Chromium sandbox (32-bit) ([Wine Bug #39403](https://bugs.winehq.org/show_bug.cgi?id=39403))
**Bug fixes and features in Wine Staging 1.7.52 [268]:**

2
debian/changelog vendored
View File

@ -5,6 +5,8 @@ wine-staging (1.7.53) UNRELEASED; urgency=low
* Added patch to implement DSPROPSETID_EAX20_ListenerProperties stub.
* Added patch to implement DSPROPSETID_EAX20_BufferProperties stub.
* Added patch to fix handling of wait interrupted by User APC.
* Added patch to use wrapper functions for syscalls to appease Chromium
sandbox (32-bit).
* Removed patch to mark RegOpenKeyExA, RegCloseKey and RegQueryValueExA as
hotpatchable (accepted upstream).
* Removed patch to mark BitBlt and StretchDIBits as hotpatchable (accepted

View File

@ -1,4 +1,4 @@
From 587d4844b3971d80d46e5641c29844b75756597c Mon Sep 17 00:00:00 2001
From 9b3593fa8fd314cfed362318927450d9d14359e0 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 6 Jun 2015 07:03:33 +0800
Subject: ntdll: Improve stub of NtQueryEaFile.
@ -10,15 +10,15 @@ Based on a patch by Qian Hong.
2 files changed, 98 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index be6b591..8c8e976 100644
index f75463a..d1a7c4c 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -3293,14 +3293,25 @@ NTSTATUS WINAPI NtQueryVolumeInformationFile( HANDLE handle, PIO_STATUS_BLOCK io
* Success: 0. Atrributes read into buffer
@@ -3324,14 +3324,25 @@ NTSTATUS WINAPI SYSCALL(NtQueryVolumeInformationFile)( HANDLE handle, PIO_STATUS
* Failure: An NTSTATUS error code describing the error.
*/
-NTSTATUS WINAPI NtQueryEaFile( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length,
+NTSTATUS WINAPI NtQueryEaFile( HANDLE handle, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length,
DEFINE_SYSCALL_ENTRYPOINT( NtQueryEaFile, 9 );
-NTSTATUS WINAPI SYSCALL(NtQueryEaFile)( HANDLE hFile, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length,
+NTSTATUS WINAPI SYSCALL(NtQueryEaFile)( HANDLE handle, PIO_STATUS_BLOCK iosb, PVOID buffer, ULONG length,
BOOLEAN single_entry, PVOID ea_list, ULONG ea_list_len,
PULONG ea_index, BOOLEAN restart )
{
@ -44,7 +44,7 @@ index be6b591..8c8e976 100644
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 1afb9c8..f13c9a9 100644
index b8f1847..55e34ad 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -79,6 +79,7 @@ static NTSTATUS (WINAPI *pNtQueryDirectoryFile)(HANDLE,HANDLE,PIO_APC_ROUTINE,PV
@ -55,7 +55,7 @@ index 1afb9c8..f13c9a9 100644
static inline BOOL is_signaled( HANDLE obj )
{
@@ -4161,6 +4162,86 @@ static void test_read_write(void)
@@ -4192,6 +4193,86 @@ static void test_read_write(void)
CloseHandle(hfile);
}
@ -142,7 +142,7 @@ index 1afb9c8..f13c9a9 100644
START_TEST(file)
{
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
@@ -4197,6 +4278,7 @@ START_TEST(file)
@@ -4228,6 +4309,7 @@ START_TEST(file)
pNtQueryDirectoryFile = (void *)GetProcAddress(hntdll, "NtQueryDirectoryFile");
pNtQueryVolumeInformationFile = (void *)GetProcAddress(hntdll, "NtQueryVolumeInformationFile");
pNtQueryFullAttributesFile = (void *)GetProcAddress(hntdll, "NtQueryFullAttributesFile");
@ -150,12 +150,12 @@ index 1afb9c8..f13c9a9 100644
test_read_write();
test_NtCreateFile();
@@ -4218,4 +4300,5 @@ START_TEST(file)
@@ -4249,4 +4331,5 @@ START_TEST(file)
test_file_disposition_information();
test_query_volume_information_file();
test_query_attribute_information_file();
+ test_query_ea();
}
--
2.5.1
2.6.1

View File

@ -1 +1,2 @@
Fixes: Improve stub for NtQueryEaFile
Depends: ntdll-Syscall_Wrappers

View File

@ -1,23 +1,23 @@
From becf0b7c08c28e5afee2641b89e29ad8c0952ef8 Mon Sep 17 00:00:00 2001
From 7d4dbe4eccb1c132d31486780bdd3b892ccb08a6 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 16 Oct 2014 23:24:37 +0200
Subject: ntdll: Implement NtQuerySection. (try 2)
Some small modifications by Sebastian Lackner <sebastian@fds-team.de>
---
dlls/ntdll/nt.c | 19 --------
dlls/ntdll/nt.c | 20 --------
dlls/ntdll/ntdll.spec | 4 +-
dlls/ntdll/virtual.c | 95 +++++++++++++++++++++++++++++++++++++
dlls/ntdll/virtual.c | 96 +++++++++++++++++++++++++++++++++++++
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +-
server/mapping.c | 42 ++++++++++++++++
server/protocol.def | 7 +++
6 files changed, 147 insertions(+), 22 deletions(-)
6 files changed, 148 insertions(+), 23 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 2acaa83..490d55f 100644
index e48e6d4..36e3704 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -646,25 +646,6 @@ NTSTATUS WINAPI NtPrivilegeCheck(
@@ -656,26 +656,6 @@ NTSTATUS WINAPI SYSCALL(NtPrivilegeCheck)(
}
/*
@ -27,7 +27,8 @@ index 2acaa83..490d55f 100644
-/******************************************************************************
- * NtQuerySection [NTDLL.@]
- */
-NTSTATUS WINAPI NtQuerySection(
-DEFINE_SYSCALL_ENTRYPOINT( NtQuerySection, 5 );
-NTSTATUS WINAPI SYSCALL(NtQuerySection)(
- IN HANDLE SectionHandle,
- IN SECTION_INFORMATION_CLASS SectionInformationClass,
- OUT PVOID SectionInformation,
@ -66,17 +67,18 @@ index 38422ae..73ae405 100644
@ stdcall ZwQuerySemaphore(long long ptr long ptr) NtQuerySemaphore
@ stdcall ZwQuerySymbolicLinkObject(long ptr ptr) NtQuerySymbolicLinkObject
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 4d4bc3b..bfe53cb 100644
index f30d94a..2145b53 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -2531,6 +2531,101 @@ NTSTATUS WINAPI NtOpenSection( HANDLE *handle, ACCESS_MASK access, const OBJECT_
@@ -2539,6 +2539,102 @@ NTSTATUS WINAPI SYSCALL(NtOpenSection)( HANDLE *handle, ACCESS_MASK access, cons
/***********************************************************************
+ * NtQuerySection (NTDLL.@)
+ */
+NTSTATUS WINAPI NtQuerySection( HANDLE handle, SECTION_INFORMATION_CLASS info_class,
+ PVOID buffer, ULONG len, PULONG ret_len )
+DEFINE_SYSCALL_ENTRYPOINT( NtQuerySection, 5 );
+NTSTATUS WINAPI SYSCALL(NtQuerySection)( HANDLE handle, SECTION_INFORMATION_CLASS info_class,
+ PVOID buffer, ULONG len, PULONG ret_len )
+{
+ HANDLE dup_mapping, shared_file;
+ unsigned protect;

View File

@ -1 +1,2 @@
Fixes: [37338] Support for NtQuerySection
Depends: ntdll-Syscall_Wrappers

View File

@ -0,0 +1 @@
Fixes: [39403] Use wrapper functions for syscalls to appease Chromium sandbox (32-bit)

View File

@ -1,4 +1,4 @@
From 09014908dd815df48eb47e792fa5ad44ba34f5f2 Mon Sep 17 00:00:00 2001
From fc9e2809d5ace76166250a4af312f167c7d40af7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 17 Aug 2015 06:17:33 +0200
Subject: ntdll: Add special handling for \SystemRoot to satisfy MSYS2
@ -9,7 +9,7 @@ Subject: ntdll: Add special handling for \SystemRoot to satisfy MSYS2
1 file changed, 13 insertions(+)
diff --git a/dlls/ntdll/om.c b/dlls/ntdll/om.c
index 6527501..566169a 100644
index c28a82a..ef17b1d 100644
--- a/dlls/ntdll/om.c
+++ b/dlls/ntdll/om.c
@@ -39,6 +39,7 @@
@ -20,8 +20,8 @@ index 6527501..566169a 100644
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
@@ -614,7 +615,9 @@ NTSTATUS WINAPI NtQueryDirectoryObject(HANDLE handle, PDIRECTORY_BASIC_INFORMATI
NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK DesiredAccess,
@@ -623,7 +624,9 @@ DEFINE_SYSCALL_ENTRYPOINT( NtOpenSymbolicLinkObject, 3 );
NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)(OUT PHANDLE LinkHandle, IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes)
{
+ static const WCHAR SystemRootW[] = {'\\','S','y','s','t','e','m','R','o','o','t'};
@ -30,7 +30,7 @@ index 6527501..566169a 100644
TRACE("(%p,0x%08x,%s)\n",LinkHandle, DesiredAccess, debugstr_ObjectAttributes(ObjectAttributes));
if (!LinkHandle) return STATUS_ACCESS_VIOLATION;
@@ -629,6 +632,16 @@ NTSTATUS WINAPI NtOpenSymbolicLinkObject(OUT PHANDLE LinkHandle, IN ACCESS_MASK
@@ -638,6 +641,16 @@ NTSTATUS WINAPI SYSCALL(NtOpenSymbolicLinkObject)(OUT PHANDLE LinkHandle, IN ACC
return STATUS_OBJECT_PATH_SYNTAX_BAD;
}
@ -48,5 +48,5 @@ index 6527501..566169a 100644
{
req->access = DesiredAccess;
--
2.5.0
2.6.1

View File

@ -1,2 +1,3 @@
Fixes: Fix detection of case-insensitive systems in MSYS2
Depends: ntdll-Exception
Depends: ntdll-Syscall_Wrappers

View File

@ -200,6 +200,7 @@ patch_enable_all ()
enable_ntdll_RtlIpStringToAddress="$1"
enable_ntdll_Stack_Fault="$1"
enable_ntdll_Status_Mapping="$1"
enable_ntdll_Syscall_Wrappers="$1"
enable_ntdll_SystemRoot_Symlink="$1"
enable_ntdll_ThreadTime="$1"
enable_ntdll_Threading="$1"
@ -690,6 +691,9 @@ patch_enable ()
ntdll-Status_Mapping)
enable_ntdll_Status_Mapping="$2"
;;
ntdll-Syscall_Wrappers)
enable_ntdll_Syscall_Wrappers="$2"
;;
ntdll-SystemRoot_Symlink)
enable_ntdll_SystemRoot_Symlink="$2"
;;
@ -1837,7 +1841,18 @@ if test "$enable_ntdll_SystemRoot_Symlink" -eq 1; then
if test "$enable_ntdll_Exception" -gt 1; then
abort "Patchset ntdll-Exception disabled, but ntdll-SystemRoot_Symlink depends on that."
fi
if test "$enable_ntdll_Syscall_Wrappers" -gt 1; then
abort "Patchset ntdll-Syscall_Wrappers disabled, but ntdll-SystemRoot_Symlink depends on that."
fi
enable_ntdll_Exception=1
enable_ntdll_Syscall_Wrappers=1
fi
if test "$enable_ntdll_NtQuerySection" -eq 1; then
if test "$enable_ntdll_Syscall_Wrappers" -gt 1; then
abort "Patchset ntdll-Syscall_Wrappers disabled, but ntdll-NtQuerySection depends on that."
fi
enable_ntdll_Syscall_Wrappers=1
fi
if test "$enable_ntdll_Junction_Points" -eq 1; then
@ -1851,6 +1866,13 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
enable_ntdll_NtQueryEaFile=1
fi
if test "$enable_ntdll_NtQueryEaFile" -eq 1; then
if test "$enable_ntdll_Syscall_Wrappers" -gt 1; then
abort "Patchset ntdll-Syscall_Wrappers disabled, but ntdll-NtQueryEaFile depends on that."
fi
enable_ntdll_Syscall_Wrappers=1
fi
if test "$enable_ntdll_Fix_Alignment" -eq 1; then
if test "$enable_ntdll_Virtual_Memory_Stack" -gt 1; then
abort "Patchset ntdll-Virtual_Memory_Stack disabled, but ntdll-Fix_Alignment depends on that."
@ -4023,8 +4045,30 @@ if test "$enable_ntdll_Hide_Wine_Exports" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntdll-Syscall_Wrappers
# |
# | This patchset fixes the following Wine bugs:
# | * [#39403] Use wrapper functions for syscalls to appease Chromium sandbox (32-bit)
# |
# | Modified files:
# | * dlls/ntdll/atom.c, dlls/ntdll/directory.c, dlls/ntdll/env.c, dlls/ntdll/error.c, dlls/ntdll/file.c, dlls/ntdll/loader.c,
# | dlls/ntdll/nt.c, dlls/ntdll/ntdll_misc.h, dlls/ntdll/om.c, dlls/ntdll/process.c, dlls/ntdll/reg.c,
# | dlls/ntdll/resource.c, dlls/ntdll/sec.c, dlls/ntdll/signal_arm.c, dlls/ntdll/signal_arm64.c, dlls/ntdll/signal_i386.c,
# | dlls/ntdll/signal_powerpc.c, dlls/ntdll/signal_x86_64.c, dlls/ntdll/sync.c, dlls/ntdll/thread.c, dlls/ntdll/time.c,
# | dlls/ntdll/virtual.c
# |
if test "$enable_ntdll_Syscall_Wrappers" -eq 1; then
patch_apply ntdll-Syscall_Wrappers/0001-ntdll-Use-wrapper-functions-for-syscalls.patch
(
echo '+ { "Sebastian Lackner", "ntdll: Use wrapper functions for syscalls.", 1 },';
) >> "$patchlist"
fi
# Patchset ntdll-NtQueryEaFile
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-Syscall_Wrappers
# |
# | Modified files:
# | * dlls/ntdll/file.c, dlls/ntdll/tests/file.c
# |
@ -4038,7 +4082,7 @@ fi
# Patchset ntdll-Junction_Points
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-Fix_Free, ntdll-NtQueryEaFile
# | * ntdll-Fix_Free, ntdll-Syscall_Wrappers, ntdll-NtQueryEaFile
# |
# | This patchset fixes the following Wine bugs:
# | * [#12401] Support for Junction Points
@ -4068,6 +4112,9 @@ fi
# Patchset ntdll-NtQuerySection
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-Syscall_Wrappers
# |
# | This patchset fixes the following Wine bugs:
# | * [#37338] Support for NtQuerySection
# |
@ -4159,7 +4206,7 @@ fi
# Patchset ntdll-SystemRoot_Symlink
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * ntdll-Exception
# | * ntdll-Exception, ntdll-Syscall_Wrappers
# |
# | Modified files:
# | * dlls/ntdll/om.c