http://bugs.winehq.org/show_bug.cgi?id=24125
Summary: Data Execution Prevention additions missing Product: Wine Version: unspecified Platform: All URL: http://msdn.microsoft.com/en-us/library/bb736299%28v=V S.85%29.aspx OS/Version: All Status: UNCONFIRMED Severity: minor Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: amartinson@codeweavers.com
SetProcessDEPPolicy, GetProcessDEPPolicy, and GetSystemDEPPolicy were added for XP in SP3 and for Vista in SP1. Wine set to XP reports as SP3, but is missing these.
http://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #1 from Austin English austinenglish@gmail.com 2010-08-24 18:04:25 --- Do you have an app that depends on these being implemented?
http://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #2 from Adam Martinson amartinson@codeweavers.com 2010-08-25 20:45:42 --- (In reply to comment #1)
Do you have an app that depends on these being implemented?
Nope, came across this while working on .NET 4.0, but it dies at the same place with stubbed functions, so this is probably just a minor API-compliance issue.
http://bugs.winehq.org/show_bug.cgi?id=24125
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED URL|http://msdn.microsoft.com/e | |n-us/library/bb736299%28v=V | |S.85%29.aspx | Component|kernel32 |-unknown Platform|All |Other Resolution| |INVALID OS/Version|All |other
--- Comment #3 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-26 02:15:51 --- There is no point in filing reports for theoretical issues.
http://bugs.winehq.org/show_bug.cgi?id=24125
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-26 02:16:02 --- Closing.
http://bugs.winehq.org/show_bug.cgi?id=24125
rk rk@ercatec.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rk@ercatec.net
--- Comment #5 from rk rk@ercatec.net 2013-11-09 09:30:02 CST --- http://appdb.winehq.org/objectManager.php?sClass=version&iId=28138
APB Reloaded needs GetProcessDEPPolicy and GetSystemDEPPolicy to return different values than the current stubs. (I guess it checks those in an attempt to prevent cheating/hacking).
So an actual implementation could be of advantage.
http://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #6 from rk rk@ercatec.net 2013-11-09 09:34:27 CST --- Created attachment 46486 --> http://bugs.winehq.org/attachment.cgi?id=46486 changed stubs to make APB Reloaded work
http://bugs.winehq.org/show_bug.cgi?id=24125
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Version|unspecified |1.7.6 Keywords| |download URL| |www.gamersfirst.com/ CC| |focht@gmx.net Component|-unknown |kernel32 Platform|Other |x86-64 Resolution|INVALID | Ever Confirmed|0 |1 Summary|Data Execution Prevention |APB Reloaded 1.x (MMORPG) |additions missing |needs better | |GetSystemDEPPolicy() and | |GetProcessDEPPolicy() | |implementation Severity|minor |normal OS/Version|other |Linux
--- Comment #7 from Anastasius Focht focht@gmx.net 2013-11-09 11:22:31 CST --- Hello folks,
reopening and changing summary for comment #5 (game depends on this).
GetProcessDEPPolicy() can be implemented using ntdll.NtQueryInformationProcess() with 'ProcessExecuteFlags' class which currently returns hard-coded MEM_EXECUTE_OPTION_DISABLE flags.
Here is some code from chromium how the API is used: https://src.chromium.org/svn/trunk/src/sandbox/win/src/process_mitigations_t...
--- snip --- SBOX_TESTS_COMMAND int CheckDep(int argc, wchar_t **argv) { GetProcessDEPPolicyFunction get_process_dep_policy = reinterpret_cast<GetProcessDEPPolicyFunction>( ::GetProcAddress(::GetModuleHandleW(L"kernel32.dll"), "GetProcessDEPPolicy")); if (get_process_dep_policy) { BOOL is_permanent = FALSE; DWORD dep_flags = 0;
if (!get_process_dep_policy(::GetCurrentProcess(), &dep_flags, &is_permanent)) { return SBOX_TEST_FIRST_ERROR; }
if (!(dep_flags & PROCESS_DEP_ENABLE) || !is_permanent) return SBOX_TEST_SECOND_ERROR;
} else { NtQueryInformationProcessFunction query_information_process = NULL; ResolveNTFunctionPtr("NtQueryInformationProcess", &query_information_process); if (!query_information_process) return SBOX_TEST_NOT_FOUND;
ULONG size = 0; ULONG dep_flags = 0; if (!SUCCEEDED(query_information_process(::GetCurrentProcess(), ProcessExecuteFlags, &dep_flags, sizeof(dep_flags), &size))) { return SBOX_TEST_THIRD_ERROR; }
const int MEM_EXECUTE_OPTION_ENABLE = 1; const int MEM_EXECUTE_OPTION_DISABLE = 2; const int MEM_EXECUTE_OPTION_ATL7_THUNK_EMULATION = 4; const int MEM_EXECUTE_OPTION_PERMANENT = 8; dep_flags &= 0xff;
if (dep_flags != (MEM_EXECUTE_OPTION_DISABLE | MEM_EXECUTE_OPTION_PERMANENT)) { return SBOX_TEST_FOURTH_ERROR; } }
return SBOX_TEST_SUCCEEDED; } --- snip ---
SetProcessDEPPolicy() should be implemented using same mechanism (those API are only for 32-bit).
MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/bb736299%28v=vs.85%2...
SystemDEPPolicy() is just a read-only field, maybe it could be made a registry setting to allow it to be tweaked per WINEPREFIX?
Regards
http://bugs.winehq.org/show_bug.cgi?id=24125
mikachu@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mikachu@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=24125
Thomas Kowaliczek linuxdonald@posteo.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |linuxdonald@posteo.de
http://bugs.winehq.org/show_bug.cgi?id=24125
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEW URL|www.gamersfirst.com/ |http://setup.gamersfirst.co | |m/live/current/GamersFirst_ | |LIVE!_Setup_EN.exe
--- Comment #8 from Anastasius Focht focht@gmx.net --- Hello folks,
adjusting download link. Obviously still present.
http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/kernel32/process.c#l38...
$ sha1sum APB_GamersFirst_LIVE_Setup_EN.exe 4725fb4bd00f7b7308fa6365c9d755954f7a1f94 APB_GamersFirst_LIVE_Setup_EN.exe
$ du -sh APB_GamersFirst_LIVE_Setup_EN.exe 13M APB_GamersFirst_LIVE_Setup_EN.exe
$ wine --version wine-1.7.19-47-g704d169
Regards
http://bugs.winehq.org/show_bug.cgi?id=24125
hanska2@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hanska2@luukku.com
--- Comment #9 from hanska2@luukku.com --- I downloaded the installer from provided link. How should I notice that it isnt working?
It starts fine 1.7.22...
http://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #10 from Anastasius Focht focht@gmx.net --- Created attachment 49239 --> http://bugs.winehq.org/attachment.cgi?id=49239 APB Reloaded 1.x Wine 1.7.23 DEP error
Hello folks,
still present, attaching screenshot with DEP error as proof.
--- quote --- I downloaded the installer from provided link. How should I notice that it isnt working?
It starts fine 1.7.22... --- quote ---
I doubt that ... you neither did a full install nor ran the real client.
~6GB download with 7GB full install.
Prerequisites automatically installed by bootstrapper in 32-bit WINEPREFIX:
* .NET 2.0 Framework * Punkbuster * VC++ 2008 runtime * VC++ 2010 runtime * VC++ 2012 runtime (bug 17273 -> kill installer)
The updater was blocked until now by bug 37001 before updating/running the client.
$ wine --version wine-1.7.23-82-g0703567
Regards
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #11 from Richard Karolyi rk.wine@ercatec.net --- Created attachment 51697 --> https://bugs.winehq.org/attachment.cgi?id=51697 changed stubs for APB Reloaded for recent 1.7.* wine (reverts some new implementation)
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #12 from Anastasius Focht focht@gmx.net --- Hello Richard,
thanks for your effort.
Unfortunately to be included in Wine this needs a more serious approach.
See my comment #5 which contains some hints.
Alternatively you could ask the folks at Wine-Staging (http://www.wine-staging.com/). I'm sure they will gladly take over, providing a proper implementation for inclusion into Wine-Staging and later upstream Wine.
Regards
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #13 from Richard Karolyi rk.wine@ercatec.net --- (In reply to Anastasius Focht from comment #12)
Hello Richard,
thanks for your effort.
Unfortunately to be included in Wine this needs a more serious approach.
See my comment #5 which contains some hints.
Alternatively you could ask the folks at Wine-Staging (http://www.wine-staging.com/). I'm sure they will gladly take over, providing a proper implementation for inclusion into Wine-Staging and later upstream Wine.
Regards
Hello Anastasius!
Those uploads are not meant for inclusion to begin with, since they don't implement anything (that's why I call them "changed stubs", rather than patches or implementations).
Those I uploaded merely as workarounds so that users can run the affected application even before a proper and working implementation makes it into Wine.
I did indeed read your hints in comment #7 before. But since I'm not too knowledgeable when it comes to DEP, Wine and all the OS-dependent implementations this particular issue would need, I won't attempt to write an implementation worth of inclusion any time soon - this is just beyond my abilities.
Considering that this doesn't seem to affect many applications or any popular application, I expect there will be more years passing by (5 passed already) until a proper implementation happens - if ever at all.
So yeah, my upload is just for those who want to run the application right now (e.g. those recently asking for help on the appdb page of the Application)
Nonetheless I appreciate your reply :)
https://bugs.winehq.org/show_bug.cgi?id=24125
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de, | |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=24125
Olivier F. R. Dierick o.dierick@piezo-forte.be changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |o.dierick@piezo-forte.be
--- Comment #14 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- Created attachment 55558 --> https://bugs.winehq.org/attachment.cgi?id=55558 proposed patchset 1/3
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #15 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- Created attachment 55559 --> https://bugs.winehq.org/attachment.cgi?id=55559 proposed patchset 2/3
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #16 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- Created attachment 55561 --> https://bugs.winehq.org/attachment.cgi?id=55561 proposed patchset 3/3
This is the patchset I've come up with.
It makes Wine read the system DEP setting from the registry, and set DEP policies to appropriate values when the application queries them.
Global DEP system policy is set in [HKCU\Software\Wine\Boot.ini]. The setting is read from a string value named NoExecute. If it contains a valid DEP flag, this value is used, otherwise it defaults to OptIn.
DEP system policies may be set individually for those applications defined on the application tab in winecfg. It will search for them in [HKCU\Software\Wine\AppDefaults<whatever.exe>\Boot.ini]. If found, that value overrides the global settings.
I designed this so that it could be extended for other boot.ini flags.
https://bugs.winehq.org/show_bug.cgi?id=24125
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=24125
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED Staged patchset| |https://github.com/wine-sta | |ging/wine-staging/tree/mast | |er/patches/kernel32-SetProc | |essDEPPolicy
https://bugs.winehq.org/show_bug.cgi?id=24125
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://setup.gamersfirst.co |https://web.archive.org/web |m/live/current/GamersFirst_ |/20170711145254/http://setu |LIVE!_Setup_EN.exe |p.gamersfirst.com/live/curr | |ent/GamersFirst_LIVE!_Setup | |_EN.exe
--- Comment #17 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable link from Internet Archive.
https://web.archive.org/web/20170711145254/http://setup.gamersfirst.com/live...
Unfortunately this web-installer doesn't work anymore, it reports 'GameID doesn't exist in manifest'.
The current one which downloads APB 1.20.x
https://web.archive.org/web/20170608102756/http://downloaders.reloadedtech.c...
Unfortunately none of the APB 1.20.x executables reference the API.
--- snip --- $ grep -ralZ DEPPolicy .wine/drive_c/ | xargs -r0i bash -c "echo "{}" && winedump -j import "{}" | grep DEPPolicy" .wine/drive_c/windows/syswow64/PresentationHost.exe .wine/drive_c/windows/syswow64/gecko/2.47/wine_gecko/xul.dll .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Extended/SetupUtility.exe .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Extended/netfx_extended.mzz .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Extended/Setup.exe .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Client/netfx_core.mzz .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Client/SetupUtility.exe .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Client/Windows6.1-KB958488-v6001-x64.msu .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Client/Setup.exe .wine/drive_c/windows/Microsoft.NET/Framework64/v4.0.30319/SetupCache/Client/Windows6.0-KB956250-v6001-x64.msu .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/aspnet_wp.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/ilasm.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/csc.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/ngen.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/vbc.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/aspnet_regiis.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/cvtres.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/aspnet_state.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/AppLaunch.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/mscorsvw.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/regtlibv12.exe .wine/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/ServiceModelReg.exe .wine/drive_c/windows/Microsoft.NET/NETFXRepair.exe .wine/drive_c/windows/system32/PresentationHost.exe .wine/drive_c/windows/system32/gecko/2.47/wine_gecko/xul.dll --- snip ---
So this game can't be used anymore for reproduce unless someone has a snapshot from an old state. Keeping the bug still open until it gets merged to mainline since several people put considerable effort into investigation and patchset.
$ sha1sum APB_Reloaded_Downloader.exe cf662be0ef988717c01f7a28b6844c0e663a0e9f APB_Reloaded_Downloader.exe
$ du -sh APB_Reloaded_Downloader.exe 2.8M APB_Reloaded_Downloader.exe
$ wine --version wine-4.11-192-g90a1e5d943
Regards
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #18 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- Hello,
I have a better patchset in the works that takes into account the comments I had from the former Staging team.
The second iteration implements the core functions in ntdll rather than kernel32. I also have to add some conformance tests.
I'll update the staged patchset when it is ready, though it may be long before I do as I'm currently very busy running my business.
Regards.
https://bugs.winehq.org/show_bug.cgi?id=24125
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #19 from Zebediah Figura z.figura12@gmail.com --- Do we know for sure that there are applications which depend on GetSystemDEPPolicy() returning different values?
If so, do these applications just not work on some Windows machines?
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #20 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- (In reply to Zebediah Figura from comment #19)
Do we know for sure that there are applications which depend on GetSystemDEPPolicy() returning different values?
If so, do these applications just not work on some Windows machines?
Hello,
Thanks for reviving interest into this bug.
I did a bit of research and found this: https://support.esea.net/hc/en-us/articles/360008891153-Error-117-DEP-Data-E...
I registered and downloaded the client to test, and hit error 1006: https://support.esea.net/hc/en-us/articles/360008741974-Error-1006-1008-114-...
"Error #1006: A system monitor program has been found running in you system. After closing the program please relaunch the ESEA Client."
So, maybe that application could be used to reproduce the issue, but it is blocked by that error. I'll file a bug for it.
I don't know yet if it looks for GetSystemDEPPolicy() or GetProcessDEPPolicy() values. I can't remember which function APB Reloaded was expecting 'AlwaysOn' from. I know no other application that requires non-default system/process DEP policy values.
ESEA client is an anti-cheat software for an eponymous community of online games players.
$ sha256sum ESEAClientInstall.exe 2ac0cc7554ee4dcab0f93ec63fde232cb7a6b6106ae79c3b40361e3a7b720035 ESEAClientInstall.exe
$ du -b ESEAClientInstall.exe 165862120 ESEAClientInstall.exe
Regards.
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #21 from Zebediah Figura z.figura12@gmail.com --- Sure, I figured as much from comment 6. My question is, is there any reason not to just always return AlwaysOn from GetSystemDEPPolicy(), and not bother with Wine-internal configuration?
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #22 from Olivier F. R. Dierick o.dierick@piezo-forte.be --- (In reply to Zebediah Figura from comment #21)
Sure, I figured as much from comment 6. My question is, is there any reason not to just always return AlwaysOn from GetSystemDEPPolicy(), and not bother with Wine-internal configuration?
Hello,
It is difficult to say since this requires enabling AlwaysOn and check if it breaks any application. I think nobody ever did that.
I could give it a try with the applications available to me.
I could also search the web for DEP issues that requires disabling DEP.
I already found that an older version of MDaemon required OptOut for some services, but I don't know if that version is still available or if it is a realistic use case. https://www.altn.com/Support/FAQ/FAQResults/?Number=306
Most program certainly don't care about DEP policy, though, and always returning AlwaysOn would sure simplify things.
Regards.
https://bugs.winehq.org/show_bug.cgi?id=24125
--- Comment #23 from Gijs Vermeulen gijsvrm@gmail.com --- The Staging patches seem to have been superseeded by:
https://source.winehq.org/git/wine.git/commit/b3d00c3340e5a0d19d0b708a1c434b1ccb1bc04d https://source.winehq.org/git/wine.git/commit/246e2356e5a178ca7e56d350cbc5cdaecc8538ab https://source.winehq.org/git/wine.git/commit/b62921245238412709d4e9f8a3548d37864d0d5d
Were those enough to call this fixed?
https://bugs.winehq.org/show_bug.cgi?id=24125
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |ABANDONED Status|STAGED |RESOLVED
--- Comment #24 from Zebediah Figura z.figura12@gmail.com --- (In reply to Gijs Vermeulen from comment #23)
The Staging patches seem to have been superseeded by:
https://source.winehq.org/git/wine.git/commit/ b3d00c3340e5a0d19d0b708a1c434b1ccb1bc04d https://source.winehq.org/git/wine.git/commit/ 246e2356e5a178ca7e56d350cbc5cdaecc8538ab https://source.winehq.org/git/wine.git/commit/ b62921245238412709d4e9f8a3548d37864d0d5d
Were those enough to call this fixed?
Well, APB seems to have required AlwaysOn, which we still don't report. But given comment 17 I don't think it's possible to reproduce this with APB anymore, so I'm resolving as ABANDONED.
https://bugs.winehq.org/show_bug.cgi?id=24125
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #25 from Austin English austinenglish@gmail.com --- Closing.