Bug 204377

Summary: Protect MessageReceivers when possible while they are processing incoming IPC messages
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, benjamin, commit-queue, ddkilzer, eric.carlson, ews-watchlist, ggaren, glenn, jer.noble, jiewen_tan, philipj, rniwa, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2019-11-19 14:31:39 PST
Protect WebProcessProxy / WebPageProxy while they are processing incoming IPC messages for extra safety.
It is a common mistake to call client delegates and failing to protect |this| while doing so. Client code can destroy the WebProcessProxy / WebPageProxy pretty easily, leading to crashes.
Comment 1 Chris Dumez 2019-11-19 14:33:53 PST
Created attachment 383905 [details]
Patch
Comment 2 Chris Dumez 2019-11-19 14:44:48 PST
Comment on attachment 383905 [details]
Patch

Trying out an alternative proposal from Brady.
Comment 3 Chris Dumez 2019-11-19 15:09:00 PST
Created attachment 383911 [details]
Patch
Comment 4 Chris Dumez 2019-11-19 16:32:26 PST
Comment on attachment 383911 [details]
Patch

Clearing flags on attachment: 383911

Committed r252655: <https://trac.webkit.org/changeset/252655>
Comment 5 Chris Dumez 2019-11-19 16:32:28 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-11-19 16:33:21 PST
<rdar://problem/57341959>