[Webkit-unassigned] [Bug 224390] [CoreIPC] Crash in logDiagnosticMessage code

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 9 14:42:35 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224390

--- Comment #5 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 425649
  --> https://bugs.webkit.org/attachment.cgi?id=425649
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425649&action=review

>>> Source/WebKit/UIProcess/WebPageProxy.cpp:7169
>>>  void WebPageProxy::logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample shouldSample)
>> 
>> Also note that these function are not only called by IPC. They are also called directly from within the UIProcess. If the check was cheap, I don't think this would be an issue. However, isAllASCII is not that cheap so maybe we want to do the check only in the IPC case. On way would be to introduce a new IPC::ASCIIString class with its own IPC decoder that does the isAllASCII() check and use that type in messages.in.
> 
> Another way, which is more code but would have no cost would be to use an enum for the message keys instead of a String. We'd only need to convert the enum to a String when we actually call the client.

Per Slack discussion, the easiest way to restrict the check and thus the runtime cost to IPC is probably:
```
Like keep logDiagnosticMessage() as is and public. Add a private logDiagnosticMessageFromWebProcess() that does the MESSAGE_CHECK() and then calls logDiagnosticMessage(). Then rename the IPC message to logDiagnosticMessageFromWebProcess() in WebPageProxy.messages.in
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210409/803bad23/attachment.htm>


More information about the webkit-unassigned mailing list