Mesa (master): radv: for secure compile exit early from radv_shader_variant_create()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Oct 26 02:39:18 UTC 2019


Module: Mesa
Branch: master
Commit: 07692f703ffe70655f6b3dcb492894d73ce1e972
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=07692f703ffe70655f6b3dcb492894d73ce1e972

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Wed Jul 31 13:57:16 2019 +1000

radv: for secure compile exit early from radv_shader_variant_create()

We don't have permission to be creating shared memory etc.

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_shader.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 06e8edf9ea2..a5ad594207d 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -973,7 +973,14 @@ radv_shader_variant_create(struct radv_device *device,
 	variant->info = binary->info;
 	radv_postprocess_config(device->physical_device, &config, &binary->info,
 				binary->stage, &variant->config);
-	
+
+	if (radv_device_use_secure_compile(device->instance)) {
+		if (binary->type == RADV_BINARY_TYPE_RTLD)
+			ac_rtld_close(&rtld_binary);
+
+		return variant;
+	}
+
 	void *dest_ptr = radv_alloc_shader_memory(device, variant);
 
 	if (binary->type == RADV_BINARY_TYPE_RTLD) {




More information about the mesa-commit mailing list