From f7f5ac7a97a94d0acc01b09002ebf3d465755911 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 4 Jan 2024 15:01:26 +0100 Subject: [PATCH] Mark DRM lease protocol privileged Allowing sandboxed clients to request DRM leases has security implications. (cherry picked from commit c5fd8c050f7ddbfe3e5b7abc8f5f6ace3a3c5307) --- sway/server.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sway/server.c b/sway/server.c index 217c9ac9..9edc8bfc 100644 --- a/sway/server.c +++ b/sway/server.c @@ -75,6 +75,17 @@ static void handle_drm_lease_request(struct wl_listener *listener, void *data) { #endif static bool is_privileged(const struct wl_global *global) { +#if WLR_HAS_DRM_BACKEND + if (server.drm_lease_manager != NULL) { + struct wlr_drm_lease_device_v1 *drm_lease_dev; + wl_list_for_each(drm_lease_dev, &server.drm_lease_manager->devices, link) { + if (drm_lease_dev->global == global) { + return true; + } + } + } +#endif + return global == server.output_manager_v1->global || global == server.output_power_manager_v1->global ||