[PATCH 0/1] MR10516: ntdll: Disable userfaultfd support on Android.
userfaultfd is available as a syscall on Android and is used by some system components, but it is not accessible to regular application processes. Since Android 8.0, seccomp filters applied to app processes block this syscall, resulting in a fatal SIGSYS instead of a recoverable error. Wine runs inside the Android app sandbox, so attempting to use userfaultfd leads to an immediate crash during startup. This change disables userfaultfd usage on Android to avoid invoking a forbidden syscall. I am aware that platform-specific macros are generally discouraged. I would appreciate guidance on a more appropriate way to handle this condition if there is a preferred abstraction or runtime check. With this change, Wine successfully starts on the `Google Play Intel x86 Atom System Image` (API 26) in the Android Emulator, although there are still rendering issues (inverted colors, AVD does not work well with BGRA buffers). <details> <summary>Screenshot</summary> {width=883 height=600} </details> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10516
From: Twaik Yont <9674930+twaik@users.noreply.github.com> userfaultfd is present as a syscall on Android and is used by some system components, but it is not available to regular application processes. Since Android 8.0, app processes are restricted by seccomp filters which block userfaultfd, causing a fatal SIGSYS instead of returning an error. Wine runs in the app sandbox on Android, so attempting to use userfaultfd leads to an immediate crash. Disable its use on Android to avoid invoking a forbidden syscall. Signed-off-by: Twaik Yont <9674930+twaik@users.noreply.github.com> --- dlls/ntdll/unix/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index a3b75ba6f81..9297a5f3798 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -73,7 +73,7 @@ #undef host_page_size #endif -#if defined(HAVE_LINUX_USERFAULTFD_H) && defined(HAVE_LINUX_FS_H) +#if defined(HAVE_LINUX_USERFAULTFD_H) && defined(HAVE_LINUX_FS_H) && !defined(__ANDROID__) # include <linux/userfaultfd.h> # include <linux/fs.h> #if defined(UFFD_FEATURE_WP_ASYNC) && defined(PM_SCAN_WP_MATCHING) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10516
participants (2)
-
Twaik Yont -
Twaik Yont (@twaik)