--- src/egl/main/eglglobals.c 2026-07-31 12:37:10.386068628 +0000 +++ src/egl/main/eglglobals.c 2026-07-31 12:37:10.394068831 +0000 @@ -134,6 +134,17 @@ if (p == NULL) return EGL_FALSE; + /* The zero page is never dereferenceable, and mincore() alone cannot + * be relied upon to say so: on Darwin, the __PAGEZERO segment is a + * genuine (PROT_NONE) mapping, so mincore() succeeds on it. Small + * integers - e.g. the wl_egl_window version field, which the Wayland + * platform probes with this function - must not be mistaken for + * dereferenceable pointers. The !HAVE_MINCORE branch below already + * applies this same assumption. + */ + if (addr < page_size) + return EGL_FALSE; + /* align addr to page_size */ addr &= ~(page_size - 1);