https://bugs.winehq.org/show_bug.cgi?id=55928
Bug ID: 55928 Summary: NtQuerySystemInformation SystemProcessInformation result misaligned Product: Wine Version: 8.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: novae.harpist06@icloud.com Distribution: ---
Created attachment 75493 --> https://bugs.winehq.org/attachment.cgi?id=75493 Reproducer
NtQuerySystemInformation with SystemProcessInformation returns misaligned entries.
Reproducer attached.
Windows output:
Process name: (null) Process name: System Process name: Secure System Process name: Registry ... (trimmed)
Wine output:
Process name: Z Misaligned at entry 1
https://bugs.winehq.org/show_bug.cgi?id=55928
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
https://bugs.winehq.org/show_bug.cgi?id=55928
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Not sure how big the impact is, but yes that's a deviation. Do you know a program that relies on that alignment?
https://bugs.winehq.org/show_bug.cgi?id=55928
--- Comment #2 from novae.harpist06@icloud.com --- Any program as long as you compile it with clang and ubsan. This is how I ran into the issue.
https://bugs.winehq.org/show_bug.cgi?id=55928
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |bernhardu@mailbox.org
--- Comment #3 from Bernhard Übelacker bernhardu@mailbox.org --- I could reproduce it with compiling with this line: clang++ -O0 -g -Wl,/debug -fsanitize=undefined -lntdll main.cpp -o main.exe
Following modification would fix the alignment. Nearby there are similar lines to align the "pos" pointer.
dlls/ntdll/unix/system.c @@ -2527,2 +2527,3 @@ static unsigned int get_system_process_info + (name_len + 1) * sizeof(WCHAR); + proc_len = (proc_len + 7) & ~7; *len += proc_len;