Bug 262100

Summary: [GTK] webkit2gtk crashes at runtime when GDS mitigation is enabled
Product: WebKit Reporter: CodingCellist <thomas-e-hansen+webkitbugzilla>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: kkinnunen
Priority: P2    
Version: Other   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
systemd-logs of a crashing startup (GDS mitigation enabled) using builtins for avx(2) detection (behaviour is the same on unmodified install)
none
Attempted, NON-FIXING patch none

Description CodingCellist 2023-09-26 00:40:22 PDT
Created attachment 467871 [details]
systemd-logs of a crashing startup (GDS mitigation enabled) using builtins for avx(2) detection (behaviour is the same on unmodified install)

When the Gather Data Sampling (GDS) mitigation in the Linux kernel is enabled, webkit2gtk will crash due to incomplete AVX2 enumeration. The mitigation is known to cause problems in these cases [1].

I tried rebuilding webkit2gtk while using the `__builtin_cpu_supports` functions instead of the bitshift checks in `JavaScriptCore/assembler/MacroAssemblerX86Common.cpp:collectCPUFeatures`, but unfortunately this does not seem to be sufficient to fix the issue. There are some further logs and discussion on the Arch bug tracker [2].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=553a5c03e90a6087e88f8ff878335ef0621536fb
[2]: https://bugs.archlinux.org/task/79444
Comment 1 CodingCellist 2023-09-26 00:42:51 PDT
Created attachment 467872 [details]
Attempted, NON-FIXING patch