From ac4aaa208f2b746358c2f8ba42f730cfb4d846e1 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Mon, 3 Jun 2024 09:23:48 +0200 Subject: [PATCH] libdrm/iris: check for more than 1 sync object In '_generic_syncobj_wait' check if sync-objetcs exist, return error otherwise. Do not wait because the execution model is synchroneous, meaning no batch buffers are in execution when this function is called (_drm_mutex). issue #5224 --- repos/libports/src/lib/libdrm/ioctl_iris.cc | 24 ++++++--------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/repos/libports/src/lib/libdrm/ioctl_iris.cc b/repos/libports/src/lib/libdrm/ioctl_iris.cc index be73aa32c6..637adccf03 100644 --- a/repos/libports/src/lib/libdrm/ioctl_iris.cc +++ b/repos/libports/src/lib/libdrm/ioctl_iris.cc @@ -1265,31 +1265,19 @@ class Drm::Call " tiemout_nsec=", p.timeout_nsec, " flags=", p.flags); - if (p.count_handles > 1) { - Genode::error(__func__, " count handles > 1 - not supported"); - return -1; - } - uint32_t * handles = reinterpret_cast(p.handles); - bool ok = false; - try { - Sync_obj::Id const id { .value = handles[0] }; - _sync_objects.apply(id, [&](Sync_obj &) { - ok = true; - }); + for (uint32_t i = 0; i < p.count_handles; i++) { + Sync_obj::Id const id { .value = handles[i] }; + /* just make sure id's are valid */ + _sync_objects.apply(id, [](Sync_obj &) {}); + } } catch (Sync_obj::Sync::Unknown_id) { errno = EINVAL; return -1; } - if (ok) { - return 0; - } else - Genode::error("unknown sync object handle ", handles[0]); - - errno = EINVAL; - return -1; + return 0; } int _generic_syncobj_destroy(void *arg)