From b77f59286f6d288d5c3776d98dcc8f7b6424fe85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 9 Jun 2022 10:54:30 +0200 Subject: [PATCH] gpu/intel: abort client on accounting mismatch Issue #4525. --- repos/os/src/drivers/gpu/intel/main.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/repos/os/src/drivers/gpu/intel/main.cc b/repos/os/src/drivers/gpu/intel/main.cc index 793db9be0d..3a56b1cb7e 100644 --- a/repos/os/src/drivers/gpu/intel/main.cc +++ b/repos/os/src/drivers/gpu/intel/main.cc @@ -1524,8 +1524,17 @@ class Gpu::Session_component : public Genode::Session_object void withdraw(size_t caps, size_t ram) { - _cap_quota_guard.withdraw(Cap_quota { caps }); - _ram_quota_guard.withdraw(Ram_quota { ram }); + try { + _cap_quota_guard.withdraw(Cap_quota { caps }); + _ram_quota_guard.withdraw(Ram_quota { ram }); + } catch (... /* intentional catch-all */) { + /* + * At this point something in the accounting went wrong + * and as quick-fix let the client abort rather than the + * multiplexer. + */ + throw Service_denied(); + } } void replenish(size_t caps, size_t ram)