mesa/src
Kenneth Graunke 4e3297f7d4 egl/x11: calloc dri2_surf so it's properly zeroed
Commit 2282ec0a refactored drawable creation across various platforms
into a new dri2_create_drawable helper function.

The GBM code in platform_drm.c code passed in dri2_surf->gbm_surf as the
loaderPrivate, while most other backends passed in dri2_surf directly.

To try and handle this, the patch checked if dri2_surf->gbm_surf was
non-NULL, and if so, presumed that the caller is the DRM platform and
we should use the dri2_surf->gbm_surf pointer.

This worked for most platforms, which calloc their dri2_surf structure,
zeroing the data.  Unfortunately, platform_x11.c used malloc, leaving
most of the dri2_surf as garbage.  In particular, dri2_surf->gbm_surf
was often non-NULL, causing dri2_create_drawable to try and use it,
passing a garbage pointer to the createNewDrawable hook, usually leading
to a SIGBUS or SIGSEGV when trying to dereference that bad pointer.

Since most callers calloc the data, make platform_x11.c follow suit.

Fixes crashes with i915_dri.so when running dEQP-GLES2.

Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2019-06-06 22:45:27 -07:00
..
amd ac/nir: Remove stale TODO 2019-06-06 17:14:28 +02:00
broadcom v3d: fix scheduling dependency tracking for ALU with small immediates 2019-06-06 08:16:43 +02:00
compiler glsl/loop_analysis: Don't search for NULL variables in the hash table 2019-06-06 00:27:53 +00:00
egl egl/x11: calloc dri2_surf so it's properly zeroed 2019-06-06 22:45:27 -07:00
etnaviv etnaviv: etnaviv_bo_cache_test: Use /dev/dri/renderD128 by default 2019-06-05 08:58:05 +00:00
freedreno nir: Combine lower_fmod16/32 back into a single lower_fmod. 2019-06-05 16:45:12 -07:00
gallium tests/graw: use C99 print conversion specifier for 32 bit builds 2019-06-06 14:39:41 -07:00
gbm gbm: gbm_bo_get_handle_for_plane fallback to nonplanar handle 2019-05-15 18:27:30 +01:00
getopt
glx glx: Fix error message when no driverName is available 2019-06-04 15:28:12 -07:00
gtest delete autotools .gitignore files 2019-04-29 21:17:19 +00:00
hgl haiku: Fix hgl dispatch build. Tested under meson/scons. 2019-04-02 16:06:00 -05:00
imgui imgui: delete demo file 2019-05-21 14:40:22 +01:00
intel anv: allow NV12 <--> AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 inter-op 2019-06-06 09:20:03 -07:00
loader Delete autotools 2019-04-15 13:44:29 -07:00
mapi mesa/main: Expose EXT_clip_control and related enums and the function 2019-06-06 12:25:17 +02:00
mesa mesa/main: Expose EXT_clip_control and related enums and the function 2019-06-06 12:25:17 +02:00
util util/hash_table: Assert that keys are not reserved pointers 2019-06-06 00:27:53 +00:00
vulkan vulkan: Update the XML and headers to 1.1.110 2019-06-04 17:30:51 +00:00
meson.build build: Build etnaviv drm 2019-06-05 08:58:05 +00:00
SConscript