Title: [289614] releases/WebKitGTK/webkit-2.34/Source/WebKit
- Revision
- 289614
- Author
- [email protected]
- Date
- 2022-02-11 02:14:36 -0800 (Fri, 11 Feb 2022)
Log Message
Merge r289608 - [WPE][GTK] BubblewrapLauncher leaks D-Bus proxy sockets
https://bugs.webkit.org/show_bug.cgi?id=201771
Reviewed by Michael Catanzaro.
xdg-dbus-proxy removes the socket when the sync fd is closed by the application. In most of the cases the
xdg-dbus-proxy process is killed before the sync fd is closed and the socket file is leaked. We should
explicitly close the sync fd.
* UIProcess/Launcher/glib/XDGDBusProxy.cpp:
(WebKit::XDGDBusProxy::XDGDBusProxy): Save the sync fd.
(WebKit::XDGDBusProxy::~XDGDBusProxy): Close the sync fd is needed.
(WebKit::XDGDBusProxy::launch const): Return the sync fd.
* UIProcess/Launcher/glib/XDGDBusProxy.h:
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog (289613 => 289614)
--- releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog 2022-02-11 10:14:32 UTC (rev 289613)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/ChangeLog 2022-02-11 10:14:36 UTC (rev 289614)
@@ -1,3 +1,20 @@
+2022-02-11 Carlos Garcia Campos <[email protected]>
+
+ [WPE][GTK] BubblewrapLauncher leaks D-Bus proxy sockets
+ https://bugs.webkit.org/show_bug.cgi?id=201771
+
+ Reviewed by Michael Catanzaro.
+
+ xdg-dbus-proxy removes the socket when the sync fd is closed by the application. In most of the cases the
+ xdg-dbus-proxy process is killed before the sync fd is closed and the socket file is leaked. We should
+ explicitly close the sync fd.
+
+ * UIProcess/Launcher/glib/XDGDBusProxy.cpp:
+ (WebKit::XDGDBusProxy::XDGDBusProxy): Save the sync fd.
+ (WebKit::XDGDBusProxy::~XDGDBusProxy): Close the sync fd is needed.
+ (WebKit::XDGDBusProxy::launch const): Return the sync fd.
+ * UIProcess/Launcher/glib/XDGDBusProxy.h:
+
2022-02-10 Carlos Garcia Campos <[email protected]>
[GTK][WPE] Refactor the XDGDBusProxy launcher to simplify it and fix some issues
Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/Launcher/glib/XDGDBusProxy.cpp (289613 => 289614)
--- releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/Launcher/glib/XDGDBusProxy.cpp 2022-02-11 10:14:32 UTC (rev 289613)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/Launcher/glib/XDGDBusProxy.cpp 2022-02-11 10:14:36 UTC (rev 289614)
@@ -86,9 +86,15 @@
m_path = CString(path, pathEnd - path);
}
- launch(allowPortals);
+ m_syncFD = launch(allowPortals);
}
+XDGDBusProxy::~XDGDBusProxy()
+{
+ if (m_syncFD != -1)
+ close(m_syncFD);
+}
+
CString XDGDBusProxy::makeProxy() const
{
GUniquePtr<char> appRunDir(g_build_filename(g_get_user_runtime_dir(), BASE_DIRECTORY, nullptr));
@@ -118,7 +124,7 @@
return proxySocketTemplate.get();
}
-void XDGDBusProxy::launch(bool allowPortals) const
+int XDGDBusProxy::launch(bool allowPortals) const
{
int syncFds[2];
if (pipe(syncFds) == -1)
@@ -207,6 +213,8 @@
char out;
if (read(syncFds[0], &out, 1) != 1)
g_error("Failed to fully launch dbus-proxy: %s", g_strerror(errno));
+
+ return syncFds[0];
}
} // namespace WebKit
Modified: releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/Launcher/glib/XDGDBusProxy.h (289613 => 289614)
--- releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/Launcher/glib/XDGDBusProxy.h 2022-02-11 10:14:32 UTC (rev 289613)
+++ releases/WebKitGTK/webkit-2.34/Source/WebKit/UIProcess/Launcher/glib/XDGDBusProxy.h 2022-02-11 10:14:36 UTC (rev 289614)
@@ -37,6 +37,7 @@
public:
enum class Type { SessionBus, AccessibilityBus };
XDGDBusProxy(Type, bool = false);
+ ~XDGDBusProxy();
const CString& proxyPath() const { return m_proxyPath; }
const CString& path() const { return m_path; }
@@ -43,12 +44,13 @@
private:
CString makeProxy() const;
- void launch(bool) const;
+ int launch(bool) const;
Type m_type;
CString m_dbusAddress;
CString m_proxyPath;
CString m_path;
+ int m_syncFD { -1 };
};
} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes