Module: Mesa
Branch: staging/18.1
Commit: 9e5757809a22c78af550a97e45478ca1c66b08ed
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e5757809a22c78af550a97e45478ca1c66b08ed

Author: Jan Vesely <[email protected]>
Date:   Mon Jul 16 21:22:22 2018 -0400

radeonsi: Refuse to accept code with unhandled relocations

They might lead to unrecoverable GPU hang.
Signed-off-by: Jan Vesely <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Cc: [email protected]
(cherry picked from commit 9baacf3fa7065fdb35cc3a70c977913d235ad93a)

---

 src/gallium/drivers/radeonsi/si_compute.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_compute.c 
b/src/gallium/drivers/radeonsi/si_compute.c
index 8ac5b262c4..e8fe8526a7 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -221,6 +221,12 @@ static void *si_create_compute_state(
                        const amd_kernel_code_t *code_object =
                                si_compute_get_code_object(program, 0);
                        code_object_to_config(code_object, 
&program->shader.config);
+                       if (program->shader.binary.reloc_count != 0) {
+                               fprintf(stderr, "Error: %d unsupported 
relocations\n",
+                                       program->shader.binary.reloc_count);
+                               FREE(program);
+                               return NULL;
+                       }
                } else {
                        si_shader_binary_read_config(&program->shader.binary,
                                     &program->shader.config, 0);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to