From a580edefe1857dab5e0d422b07feec201f2d876b Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 25 May 2023 10:07:30 +1000 Subject: [PATCH] Rebase against e10da7ab2e3d151c8347802600862aa608672f6f. --- ...art-the-initial-process-through-start.patch | 12 ++++++------ ...ate-processes-if-requested-in-CreateP.patch | 18 +++++++++--------- staging/upstream-commit | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/patches/server-default_integrity/0005-ntdll-Always-start-the-initial-process-through-start.patch b/patches/server-default_integrity/0005-ntdll-Always-start-the-initial-process-through-start.patch index 08b944af..096525c6 100644 --- a/patches/server-default_integrity/0005-ntdll-Always-start-the-initial-process-through-start.patch +++ b/patches/server-default_integrity/0005-ntdll-Always-start-the-initial-process-through-start.patch @@ -1,4 +1,4 @@ -From b1fa0df72c80753864dd001f45278f45c162bb2e Mon Sep 17 00:00:00 2001 +From 643461bc989bd848363241dcfa04187e8d3a84d1 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 21 May 2021 21:52:06 -0500 Subject: [PATCH] ntdll: Always start the initial process through start.exe. @@ -9,10 +9,10 @@ Signed-off-by: Zebediah Figura 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c -index 3c178350f2b..eb7a1d6c7e5 100644 +index 30782a70eb0..959bafb28b7 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c -@@ -1901,6 +1901,7 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module ) +@@ -1909,6 +1909,7 @@ static void init_peb( RTL_USER_PROCESS_PARAMETERS *params, void *module ) */ static RTL_USER_PROCESS_PARAMETERS *build_initial_params( void **module ) { @@ -20,11 +20,11 @@ index 3c178350f2b..eb7a1d6c7e5 100644 static const WCHAR valueW[] = {'1',0}; static const WCHAR pathW[] = {'P','A','T','H'}; RTL_USER_PROCESS_PARAMETERS *params = NULL; -@@ -1929,29 +1930,8 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params( void **module ) +@@ -1937,29 +1938,8 @@ static RTL_USER_PROCESS_PARAMETERS *build_initial_params( void **module ) add_registry_environment( &env, &env_pos, &env_size ); env[env_pos++] = 0; -- status = load_main_exe( NULL, main_argv[1], curdir, &image, module ); +- status = load_main_exe( NULL, main_argv[1], curdir, 0, &image, module ); - if (!status) - { - char *loader; @@ -53,5 +53,5 @@ index 3c178350f2b..eb7a1d6c7e5 100644 main_wargv = build_wargv( get_dos_path( image )); cmdline = build_command_line( main_wargv ); -- -2.40.0 +2.40.1 diff --git a/patches/server-default_integrity/0006-kernelbase-Elevate-processes-if-requested-in-CreateP.patch b/patches/server-default_integrity/0006-kernelbase-Elevate-processes-if-requested-in-CreateP.patch index 710489b7..240c3169 100644 --- a/patches/server-default_integrity/0006-kernelbase-Elevate-processes-if-requested-in-CreateP.patch +++ b/patches/server-default_integrity/0006-kernelbase-Elevate-processes-if-requested-in-CreateP.patch @@ -1,4 +1,4 @@ -From 71aba24d166ee16f6ea52d1b63acabccf0532514 Mon Sep 17 00:00:00 2001 +From 1eaa73714299df810d22a727e8053679d5e89f64 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 18 Apr 2021 17:46:35 -0500 Subject: [PATCH] kernelbase: Elevate processes if requested in @@ -10,7 +10,7 @@ Signed-off-by: Zebediah Figura 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c -index 35381f409e9..e64076cb860 100644 +index 54a524abe04..7365bee9425 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -30,6 +30,7 @@ @@ -21,7 +21,7 @@ index 35381f409e9..e64076cb860 100644 #include "kernelbase.h" #include "wine/debug.h" -@@ -414,6 +415,54 @@ BOOL WINAPI DECLSPEC_HOTPATCH CloseHandle( HANDLE handle ) +@@ -431,6 +432,54 @@ BOOL WINAPI DECLSPEC_HOTPATCH CloseHandle( HANDLE handle ) } @@ -76,16 +76,16 @@ index 35381f409e9..e64076cb860 100644 /********************************************************************** * CreateProcessAsUserA (kernelbase.@) */ -@@ -500,7 +549,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR +@@ -517,7 +566,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR WCHAR *p, *tidy_cmdline = cmd_line; RTL_USER_PROCESS_PARAMETERS *params = NULL; RTL_USER_PROCESS_INFORMATION rtl_info; - HANDLE parent = 0, debug = 0; + HANDLE parent = 0, debug = 0, elevated_token = NULL; ULONG nt_flags = 0; + USHORT machine = 0; NTSTATUS status; - -@@ -608,6 +657,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR +@@ -629,6 +678,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR if (flags & CREATE_BREAKAWAY_FROM_JOB) nt_flags |= PROCESS_CREATE_FLAGS_BREAKAWAY; if (flags & CREATE_SUSPENDED) nt_flags |= PROCESS_CREATE_FLAGS_SUSPENDED; @@ -93,9 +93,9 @@ index 35381f409e9..e64076cb860 100644 + token = elevated_token = get_elevated_token(); + status = create_nt_process( token, debug, process_attr, thread_attr, - nt_flags, params, &rtl_info, parent, handle_list, job_list ); + nt_flags, params, &rtl_info, parent, machine, handle_list, job_list ); switch (status) -@@ -649,7 +701,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR +@@ -670,7 +722,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR TRACE( "started process pid %04lx tid %04lx\n", info->dwProcessId, info->dwThreadId ); } @@ -106,5 +106,5 @@ index 35381f409e9..e64076cb860 100644 if (tidy_cmdline != cmd_line) HeapFree( GetProcessHeap(), 0, tidy_cmdline ); return set_ntstatus( status ); -- -2.34.1 +2.40.1 diff --git a/staging/upstream-commit b/staging/upstream-commit index d70394d2..515bca9d 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -f266dc094a9b4fbe95792ed706891609901834e3 +e10da7ab2e3d151c8347802600862aa608672f6f