mesa/src/intel
José Roberto de Souza 44b4fee786 iris: Avoid read of uninitialized value in blorp_clear_stencil_as_rgba()
In clear_depth_stencil() stencil_surf is defined but not initiaized.
Then in the same function if stencil_mask is calculated and if != 0
stencil_surf is initialized.
But blorp_clear_stencil_as_rgba() access stencil_surf before checking
stencil_mask, what could cause a read of a uninitialized valued.

clear_depth_stencil()
	struct blorp_surf stencil_surf;
	...
	uint8_t stencil_mask = clear_stencil && stencil_res ? 0xff : 0;
	if (stencil_mask) {
		...
		iris_blorp_surf_for_resource(&stencil_surf);
	}
	...
	blorp_clear_depth_stencil(stencil_mask, stencil_surf)
		blorp_clear_stencil_as_rgba(stencil_mask, stencil)
			if (surf->surf->format ...)
				....

Just inverting the order and checking stencil_mask first in
blorp_clear_stencil_as_rgba() fixes the issue.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27390>
2024-01-31 22:29:31 +00:00
..
blorp iris: Avoid read of uninitialized value in blorp_clear_stencil_as_rgba() 2024-01-31 22:29:31 +00:00
ci ci: always skip dEQP-VK.info.device_extensions 2024-01-31 16:48:16 +00:00
common util: rename __check_suid() to __normal_user() 2024-01-30 12:45:54 +00:00
compiler tree-wide: use __normal_user() everywhere instead of writing the check manually 2024-01-30 12:45:54 +00:00
dev intel: Skip ioctls for querying device info when hardware is unsupported 2024-01-25 09:57:24 +00:00
ds intel/ds: track predication of blorp operations 2024-01-26 13:39:01 +00:00
genxml intel/genxml/xe2: Remove L3ALLOC 2024-01-18 14:16:17 +00:00
isl isl,blorp,anv: introduce ISL_TILING_64_XE2 for Xe2+ platforms 2024-01-24 17:01:48 +01:00
nullhw-layer meson: support installation tags 2023-09-11 13:00:45 +00:00
perf intel: Remove unused ALIGN macro 2023-12-07 02:30:53 +00:00
tools intel: Skip ioctls for querying device info when hardware is unsupported 2024-01-25 09:57:24 +00:00
vulkan anv: use workaround framework for Wa_22018402687 2024-01-31 21:24:14 +00:00
vulkan_hasvk intel/hasvk: assume() we don't get ISL_NUM_FORMATS 2024-01-31 18:59:16 +00:00
meson.build intel: Only build perf if drivers or tools are enabled 2023-08-31 21:53:19 +00:00