From 2771ab8cee5da83948b7bf06f2f7963623599659 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 19 Sep 2021 21:25:14 -0500 Subject: [PATCH] ntdll-Zero_mod_name: Remove patch. After examining the code several times I'm convinced that, according to the C specification, it shouldn't have any effect. That said, it's supposed to be for Cygwin, and bug 47812 describes a rather insane thing that Cygwin does with the stack. If Cygwin is accessing overwritten stack memory, then it seems reasonable that something like this patch set has an effect. Bug 47812 is fixed now, though, so let's remove this patch. --- ...01-ntdll-Initialize-mod_name-to-zero.patch | 25 ------------------- patches/ntdll-Zero_mod_name/definition | 1 - patches/patchinstall.sh | 13 ---------- 3 files changed, 39 deletions(-) delete mode 100644 patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch delete mode 100644 patches/ntdll-Zero_mod_name/definition diff --git a/patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch b/patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch deleted file mode 100644 index 880df61e..00000000 --- a/patches/ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a3c5b5c3650ff03c7be30364af37c4bc146f77d2 Mon Sep 17 00:00:00 2001 -From: Qian Hong -Date: Wed, 9 Sep 2015 05:31:18 +0800 -Subject: [PATCH] ntdll: Initialize mod_name to zero. - ---- - dlls/ntdll/loader.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c -index 60a02fd093c..bf16562be55 100644 ---- a/dlls/ntdll/loader.c -+++ b/dlls/ntdll/loader.c -@@ -1399,6 +1399,8 @@ static NTSTATUS MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved - unix_funcs->init_builtin_dll( wm->ldr.DllBase ); - if (!entry) return STATUS_SUCCESS; - -+ memset( mod_name, 0, sizeof(mod_name) ); -+ - if (TRACE_ON(relay)) - { - size_t len = min( wm->ldr.BaseDllName.Length, sizeof(mod_name)-sizeof(WCHAR) ); --- -2.33.0 - diff --git a/patches/ntdll-Zero_mod_name/definition b/patches/ntdll-Zero_mod_name/definition deleted file mode 100644 index c84b4bd2..00000000 --- a/patches/ntdll-Zero_mod_name/definition +++ /dev/null @@ -1 +0,0 @@ -#Fixes: Fixes random crashes of Cygwin/MSYS2 for some compilers diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 05f3c583..4f461e07 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -170,7 +170,6 @@ patch_enable_all () enable_ntdll_Serial_Port_Detection="$1" enable_ntdll_Syscall_Emulation="$1" enable_ntdll_WRITECOPY="$1" - enable_ntdll_Zero_mod_name="$1" enable_ntdll_ext4_case_folder="$1" enable_ntoskrnl_Stubs="$1" enable_nvapi_Stub_DLL="$1" @@ -552,9 +551,6 @@ patch_enable () ntdll-WRITECOPY) enable_ntdll_WRITECOPY="$2" ;; - ntdll-Zero_mod_name) - enable_ntdll_Zero_mod_name="$2" - ;; ntdll-ext4-case-folder) enable_ntdll_ext4_case_folder="$2" ;; @@ -2869,15 +2865,6 @@ if test "$enable_ntdll_Syscall_Emulation" -eq 1; then patch_apply ntdll-Syscall_Emulation/0001-ntdll-Support-x86_64-syscall-emulation.patch fi -# Patchset ntdll-Zero_mod_name -# | -# | Modified files: -# | * dlls/ntdll/loader.c -# | -if test "$enable_ntdll_Zero_mod_name" -eq 1; then - patch_apply ntdll-Zero_mod_name/0001-ntdll-Initialize-mod_name-to-zero.patch -fi - # Patchset ntdll-ext4-case-folder # | # | This patchset fixes the following Wine bugs: