]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Disable all output leasing due to a wlroots UAF
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Fri, 4 Jul 2025 22:19:33 +0000 (00:19 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 6 Jul 2025 18:59:43 +0000 (19:59 +0100)
include/common/macros.h
src/output.c

index 38ab45de00d3f1fbb525bb8b053a2e63ba39eb44..2522626163dceafee08ca39f57d41f50875595d2 100644 (file)
@@ -3,6 +3,7 @@
 #define LABWC_MACROS_H
 
 #include <limits.h>
+#include <wlr/version.h>
 
 /**
  * ARRAY_SIZE() - Get the number of elements in array.
@@ -61,4 +62,7 @@
 #define BOUNDED_INT(a) ((a) < INT_MAX && (a) > INT_MIN)
 #endif
 
+#define LAB_WLR_VERSION_AT_LEAST(major, minor, micro) \
+       (WLR_VERSION_NUM >= (((major) << 16) | ((minor) << 8) | (micro)))
+
 #endif /* LABWC_MACROS_H */
index 85157c7dbfcb2728d030e9c8596be56e6c7c30f8..3b4a26caacf94de84fbe7c24e27eab229654cce4 100644 (file)
@@ -445,11 +445,20 @@ handle_new_output(struct wl_listener *listener, void *data)
         * to use planes and present directly.
         * This is also useful for debugging the DRM parts of
         * another compositor.
+        *
+        * All drm leasing is disabled due to a UAF bug in wlroots.
+        * We assume that the fix will be backported to 0.19.1 and thus
+        * check for a version >= 0.19.1. See following link for the fix status:
+        * https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5104
+        *
+        * TODO: remove once labwc starts tracking 0.20.x and the fix has been merged.
         */
+#if LAB_WLR_VERSION_AT_LEAST(0, 19, 1)
        if (server->drm_lease_manager && wlr_output_is_drm(wlr_output)) {
                wlr_drm_lease_v1_manager_offer_output(
                        server->drm_lease_manager, wlr_output);
        }
+#endif
 
        /*
         * Don't configure any non-desktop displays, such as VR headsets;