http://bugs.winehq.org/show_bug.cgi?id=58293
Bug ID: 58293 Summary: Regression caused by switch to realloc which doesn't zero added memory Product: Wine Version: 10.7 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wintrust Assignee: wine-bugs@winehq.org Reporter: twhitehead@gmail.com Distribution: ---
Created attachment 78644 --> http://bugs.winehq.org/attachment.cgi?id=78644 Log showing run with and without reverting 6db69d0 under wine 10.7
In wine 8 `LibOVR.dll` (the shim) would load `LibOVRRT32_1.dll` (the Oculus API). In wine 9 and later this is no longer the case. Reverting 6db69d0 (wintrust: Use CRT allocation function) makes it work again.
Looking over this commit I expect the issue is the switch from ``` static void* WINTRUST_ReAlloc(void *ptr, DWORD cb) __WINE_ALLOC_SIZE(2); static void* WINTRUST_ReAlloc(void *ptr, DWORD cb) { return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ptr, cb); } ``` which zeros added memory to realloc which does not. Presumably this is resulting in some field being populated with garbage, and that makes `LibOVR.dll` unhappy when it verifies the signatures on `LibOVRRT32_1.dll`.
I put more details and a test program in the following github repo
https://github.com/twhitehead/issue-wine-ovrf
http://bugs.winehq.org/show_bug.cgi?id=58293
--- Comment #1 from Tyson Whitehead twhitehead@gmail.com --- That should have been
https://github.com/twhitehead/issue-wine-ovr
http://bugs.winehq.org/show_bug.cgi?id=58293
Tyson Whitehead twhitehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alexhenrie24@gmail.com, | |twhitehead@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=58293
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Hardware|x86-64 |x86 Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #2 from Alex Henrie alexhenrie24@gmail.com --- I feel honored that you produced such a detailed tribute to my error. Please try this patch: https://gitlab.winehq.org/wine/wine/-/merge_requests/8171
http://bugs.winehq.org/show_bug.cgi?id=58293
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |6db69d0281543a240e1dd5ec0b0 | |b7d841dc8f4cf Keywords| |regression, source URL| |https://github.com/twhitehe | |ad/issue-wine-ovr
http://bugs.winehq.org/show_bug.cgi?id=58293
--- Comment #3 from Tyson Whitehead twhitehead@gmail.com --- Yup. That has it. `LibOVRRT32_1.dll` get loaded under wine 10.7 patched with you patch like it used to under wine 8
``` 0024:trace:wintrust:WinVerifyTrust returning 00000000 ... 0024:trace:loaddll:build_module Loaded L"Z:\home\tyson\issue-wine-ovr\LibOVRRT32_1.dll" at 7A280000: native ... 29/05 07:40:37.992 {INFO} [Kernel:Default] [CAPI] LibOVR module is located at Z:\home\tyson\issue-wine-ovr\LibOVRRT32_1.dll 29/05 07:40:37.993 {INFO} [Kernel:System] Graceful shutdown: OnThreadDestroy 29/05 07:40:37.993 {INFO} [Kernel:System] Graceful shutdown: OnSystemDestroy 29/05 07:40:37.993 {INFO} [Kernel:System] Graceful shutdown: Stopping logger ... ```
Thanks very much! :)
http://bugs.winehq.org/show_bug.cgi?id=58293
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |c04dc136dd7a5aa679dcdd22535 | |fd96e25426174
--- Comment #4 from Alex Henrie alexhenrie24@gmail.com --- Fixed by https://gitlab.winehq.org/wine/wine/-/commit/c04dc136dd7a5aa679dcdd22535fd96...
Thanks again for the bug report.
http://bugs.winehq.org/show_bug.cgi?id=58293
--- Comment #5 from Tyson Whitehead twhitehead@gmail.com --- NP. Thanks for the quick fix!