Bug 194777

Summary: Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
Product: WebKit Reporter: John Wilander <wilander>
Component: WebCore Misc.Assignee: John Wilander <wilander>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, commit-queue, dbates, esprehn+autocc, ews-watchlist, ggaren, kangil.han, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

John Wilander
Reported 2019-02-18 08:53:53 PST
We should check that the document has a frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess().
Attachments
Patch (1.86 KB, patch)
2019-02-18 09:16 PST, John Wilander
no flags
Patch (9.54 KB, patch)
2019-02-18 13:20 PST, John Wilander
no flags
Patch for landing (9.69 KB, patch)
2019-02-18 14:29 PST, John Wilander
no flags
John Wilander
Comment 1 2019-02-18 08:54:04 PST
John Wilander
Comment 2 2019-02-18 09:16:11 PST
Chris Dumez
Comment 3 2019-02-18 10:59:02 PST
Comment on attachment 362301 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=362301&action=review > Source/WebCore/ChangeLog:9 > + No new tests. I think we should try and write a test as explained offline.
John Wilander
Comment 4 2019-02-18 13:20:20 PST
Geoffrey Garen
Comment 5 2019-02-18 14:18:52 PST
Comment on attachment 362321 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=362321&action=review r=me > Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:590 > + RELEASE_ASSERT(sessionID.isValid()); I'm not sure it's good practice to include a RELEASE_ASSERT in a fix for a null pointer dereference. That increases the chances that the crash rate will go up rather than down after the fix. For example, if we ever wanted to merge this fix onto a release branch, instead of saying "it's just a null check" we would say "it's a null check and possibly a new way to crash". That's a much more muddled risk/reward discussion. How about an ASSERT with early return?
John Wilander
Comment 6 2019-02-18 14:21:29 PST
(In reply to Geoffrey Garen from comment #5) > Comment on attachment 362321 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=362321&action=review > > r=me Thanks! > > Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:590 > > + RELEASE_ASSERT(sessionID.isValid()); > > I'm not sure it's good practice to include a RELEASE_ASSERT in a fix for a > null pointer dereference. That increases the chances that the crash rate > will go up rather than down after the fix. For example, if we ever wanted to > merge this fix onto a release branch, instead of saying "it's just a null > check" we would say "it's a null check and possibly a new way to crash". > That's a much more muddled risk/reward discussion. > > How about an ASSERT with early return? I'm actually of the same opinion but Chris wants us to find other bad call sites (if there are any). Chris, care to weigh in?
Chris Dumez
Comment 7 2019-02-18 14:23:58 PST
(In reply to John Wilander from comment #6) > (In reply to Geoffrey Garen from comment #5) > > Comment on attachment 362321 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=362321&action=review > > > > r=me > > Thanks! > > > > Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:590 > > > + RELEASE_ASSERT(sessionID.isValid()); > > > > I'm not sure it's good practice to include a RELEASE_ASSERT in a fix for a > > null pointer dereference. That increases the chances that the crash rate > > will go up rather than down after the fix. For example, if we ever wanted to > > merge this fix onto a release branch, instead of saying "it's just a null > > check" we would say "it's a null check and possibly a new way to crash". > > That's a much more muddled risk/reward discussion. > > > > How about an ASSERT with early return? > > I'm actually of the same opinion but Chris wants us to find other bad call > sites (if there are any). Chris, care to weigh in? I am OK with ASSERT() with early return. I actually thought this is what we eventually agreed on offline but I probably wasn't clear I changed my mind.
John Wilander
Comment 8 2019-02-18 14:24:51 PST
(In reply to Chris Dumez from comment #7) > (In reply to John Wilander from comment #6) > > (In reply to Geoffrey Garen from comment #5) > > > Comment on attachment 362321 [details] > > > Patch > > > > > > View in context: > > > https://bugs.webkit.org/attachment.cgi?id=362321&action=review > > > > > > r=me > > > > Thanks! > > > > > > Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:590 > > > > + RELEASE_ASSERT(sessionID.isValid()); > > > > > > I'm not sure it's good practice to include a RELEASE_ASSERT in a fix for a > > > null pointer dereference. That increases the chances that the crash rate > > > will go up rather than down after the fix. For example, if we ever wanted to > > > merge this fix onto a release branch, instead of saying "it's just a null > > > check" we would say "it's a null check and possibly a new way to crash". > > > That's a much more muddled risk/reward discussion. > > > > > > How about an ASSERT with early return? > > > > I'm actually of the same opinion but Chris wants us to find other bad call > > sites (if there are any). Chris, care to weigh in? > > I am OK with ASSERT() with early return. I actually thought this is what we > eventually agreed on offline but I probably wasn't clear I changed my mind. OK, I will fix this and land. Thanks, both of you.
John Wilander
Comment 9 2019-02-18 14:29:44 PST
Created attachment 362335 [details] Patch for landing
WebKit Commit Bot
Comment 10 2019-02-18 15:14:03 PST
Comment on attachment 362335 [details] Patch for landing Clearing flags on attachment: 362335 Committed r241743: <https://trac.webkit.org/changeset/241743>
WebKit Commit Bot
Comment 11 2019-02-18 15:14:05 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.