Mark Kettenis <[email protected]> writes:
> As reported by several people, mesa contains code that violates W^X.
> As a result glxgears aborts when using the swrast driver. The diff
> below disables the offending code. The code seems to deal the absence
> of W|X memory just fine. There is a fallback path that is also used
> on SELinux systems.
>
> Note that the existing code would have worked just fine if mmap
> returned MAP_FAILED for W^X violations instead of terminating the
> program. Not entirely sure what the long-term plans are.
[...]
> Index: src/mesa/main/execmem.c
> ===================================================================
> RCS file: /cvs/xenocara/lib/mesa/src/mesa/main/execmem.c,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 execmem.c
> --- src/mesa/main/execmem.c 22 Nov 2015 02:39:37 -0000 1.1.1.1
> +++ src/mesa/main/execmem.c 20 Jun 2016 20:08:40 -0000
> @@ -36,7 +36,15 @@
>
>
>
> -#if defined(__linux__) || defined(__OpenBSD__) || defined(_NetBSD__) ||
> defined(__sun) || defined(__HAIKU__)
> +#if defined(__OpenBSD__)
> +
> +static int
> +init_heap(void)
> +{
> + return 0;
> +}
The #ifdef excludes the definition of _mesa_exec_malloc and
_mesa_exec_free.
xlock:/usr/X11R6/lib/modules/dri/i915_dri.so: undefined symbol
'_mesa_exec_malloc'
xlock:/usr/X11R6/lib/modules/dri/i915_dri.so: undefined symbol
'_mesa_exec_free'
libGL error: unable to load driver: i915_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i915
> +
> +#elif defined(__linux__) || defined(_NetBSD__) || defined(__sun) ||
> defined(__HAIKU__)
>
> /*
> * Allocate a large block of memory which can hold code then dole it out
>
--
jca | PGP: 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE