Summary: | [WPE] Send client host fd and library name as web process creation parameters | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||||
Component: | WPE WebKit | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bugs-noreply, zan | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=194216 | ||||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2019-02-11 00:35:03 PST
Created attachment 361666 [details]
Patch
Comment on attachment 361666 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361666&action=review > Source/WebKit/WebProcess/glib/WebProcessGLib.cpp:53 > + if (!parameters.implementationLibraryName.isNull()) isEmpty() here, should avoid potential problems of passing empty strings to wpe_loader_init(). Comment on attachment 361666 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361666&action=review >> Source/WebKit/WebProcess/glib/WebProcessGLib.cpp:53 >> + if (!parameters.implementationLibraryName.isNull()) > > isEmpty() here, should avoid potential problems of passing empty strings to wpe_loader_init(). It's a CString not a String, so we don't have isEmpty there. We could explicitly check data()[0] != '\0' but I don't think it's needed for something sent the from the UI process. The only reason we are checking this is because wpe_loader_get_loaded_implementation_library_name() is new api, so when libwpe < 0.2 we receive a null string here. Comment on attachment 361666 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=361666&action=review >>> Source/WebKit/WebProcess/glib/WebProcessGLib.cpp:53 >>> + if (!parameters.implementationLibraryName.isNull()) >> >> isEmpty() here, should avoid potential problems of passing empty strings to wpe_loader_init(). > > It's a CString not a String, so we don't have isEmpty there. We could explicitly check data()[0] != '\0' but I don't think it's needed for something sent the from the UI process. The only reason we are checking this is because wpe_loader_get_loaded_implementation_library_name() is new api, so when libwpe < 0.2 we receive a null string here. The condition here should prevent wpe_loader_init() misbehaving. Currently it only covers a null CString, which is fine. But a non-null CString with a strlen() of 0 will pass the condition, but the dlopen() call in wpe_loader_init() will end up returning a handle to the process executable, which is not desired. More than depending on what the UIProcess sends over IPC here, it should be preferable to validate arguments properly on the spot. Created attachment 361677 [details]
Patch
Created attachment 362489 [details]
Patch for landing
Committed r241816: <https://trac.webkit.org/changeset/241816> |