Title: [259044] trunk/Source/WebKit
Revision
259044
Author
commit-qu...@webkit.org
Date
2020-03-26 08:22:42 -0700 (Thu, 26 Mar 2020)

Log Message

[GTK] Crash in WebKit::LayerTreeHost::LayerTreeHost with bubblewrap sandbox enabled
https://bugs.webkit.org/show_bug.cgi?id=209106

Patch by Michael Catanzaro <mcatanz...@gnome.org> on 2020-03-26
Reviewed by Carlos Garcia Campos.

Don't bind the WaylandCompositor socket unless we're running under Wayland and it's actually
started successfully.

* UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::bindWayland):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (259043 => 259044)


--- trunk/Source/WebKit/ChangeLog	2020-03-26 14:31:28 UTC (rev 259043)
+++ trunk/Source/WebKit/ChangeLog	2020-03-26 15:22:42 UTC (rev 259044)
@@ -1,3 +1,16 @@
+2020-03-26  Michael Catanzaro  <mcatanz...@gnome.org>
+
+        [GTK] Crash in WebKit::LayerTreeHost::LayerTreeHost with bubblewrap sandbox enabled
+        https://bugs.webkit.org/show_bug.cgi?id=209106
+
+        Reviewed by Carlos Garcia Campos.
+
+        Don't bind the WaylandCompositor socket unless we're running under Wayland and it's actually
+        started successfully.
+
+        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
+        (WebKit::bindWayland):
+
 2020-03-26  David Kilzer  <ddkil...@apple.com>
 
         VideoFullscreenManagerProxy::setupFullscreenWithID should message check videoLayerID

Modified: trunk/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp (259043 => 259044)


--- trunk/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp	2020-03-26 14:31:28 UTC (rev 259043)
+++ trunk/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp	2020-03-26 15:22:42 UTC (rev 259044)
@@ -327,6 +327,9 @@
 #if PLATFORM(WAYLAND) && USE(EGL)
 static void bindWayland(Vector<CString>& args)
 {
+    if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::Wayland)
+        return;
+
     const char* display = g_getenv("WAYLAND_DISPLAY");
     if (!display)
         display = "wayland-0";
@@ -335,10 +338,12 @@
     GUniquePtr<char> waylandRuntimeFile(g_build_filename(runtimeDir, display, nullptr));
     bindIfExists(args, waylandRuntimeFile.get(), BindFlags::ReadWrite);
 
-#if PLATFORM(GTK) && !USE(WPE_RENDERER)
-    String displayName = WaylandCompositor::singleton().displayName();
-    waylandRuntimeFile.reset(g_build_filename(runtimeDir, displayName.utf8().data(), nullptr));
-    bindIfExists(args, waylandRuntimeFile.get(), BindFlags::ReadWrite);
+#if !USE(WPE_RENDERER)
+    if (WaylandCompositor::singleton().isRunning()) {
+        String displayName = WaylandCompositor::singleton().displayName();
+        waylandRuntimeFile.reset(g_build_filename(runtimeDir, displayName.utf8().data(), nullptr));
+        bindIfExists(args, waylandRuntimeFile.get(), BindFlags::ReadWrite);
+    }
 #endif
 }
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to