Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Issue 217023003: Add null checks in navigator.serviceWorker access to fix possible crash (Closed)

Created:
6 years, 9 months ago by kinuko
Modified:
6 years, 8 months ago
CC:
blink-reviews, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, nhiroki, falken, horo+watch_chromium.org, alecflett+watch_chromium.org
Visibility:
Public.

Description

Add null checks in navigator.serviceWorker access to fix possible crash This fixes two possible crash: 1. document->frame() could be null when ServiceWorkerContainerClient::from is called 2. NavigatorServiceWorker.m_serviceWorker could be null in ServiceWorkerContainer::detachClient BUG=355998, 356017 TEST=fast/serviceworker/access-container-with-invalid-context.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170501

Patch Set 1 #

Patch Set 2 : #

Total comments: 12

Patch Set 3 : #

Patch Set 4 : reverted iframe #

Patch Set 5 : reverted iframe change #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -7 lines) Patch
A LayoutTests/fast/serviceworker/access-container-with-invalid-context.html View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
A LayoutTests/fast/serviceworker/access-container-with-invalid-context-expected.txt View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M Source/modules/serviceworkers/NavigatorServiceWorker.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M Source/modules/serviceworkers/ServiceWorkerContainer.cpp View 1 2 3 chunks +17 lines, -3 lines 0 comments Download
M Source/modules/serviceworkers/ServiceWorkerContainerClient.cpp View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
kinuko
Could dominicc@ or someone review this?
6 years, 8 months ago (2014-03-31 03:56:31 UTC) #1
dominicc (has gone to gerrit)
On 2014/03/31 03:56:31, kinuko wrote: > Could dominicc@ or someone review this? Comments inline. Handling ...
6 years, 8 months ago (2014-03-31 04:52:01 UTC) #2
dominicc (has gone to gerrit)
https://codereview.chromium.org/217023003/diff/40001/LayoutTests/fast/serviceworker/access-container-with-invalid-context.html File LayoutTests/fast/serviceworker/access-container-with-invalid-context.html (right): https://codereview.chromium.org/217023003/diff/40001/LayoutTests/fast/serviceworker/access-container-with-invalid-context.html#newcode6 LayoutTests/fast/serviceworker/access-container-with-invalid-context.html:6: testRunner.dumpAsText(); I could be wrong, but isn't dumpAsText the ...
6 years, 8 months ago (2014-03-31 04:52:09 UTC) #3
kinuko
Addressed some but not all. (I'm not unable to create a reliable test for this ...
6 years, 8 months ago (2014-03-31 12:33:04 UTC) #4
dominicc (has gone to gerrit)
LGTM I have more thoughts about tests but let's discuss IRL.
6 years, 8 months ago (2014-03-31 23:19:10 UTC) #5
dominicc (has gone to gerrit)
The CQ bit was checked by dominicc@chromium.org
6 years, 8 months ago (2014-03-31 23:19:14 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kinuko@chromium.org/217023003/150001
6 years, 8 months ago (2014-03-31 23:19:23 UTC) #7
commit-bot: I haz the power
Change committed as 170501
6 years, 8 months ago (2014-04-01 01:30:18 UTC) #8
kinuko
Btw... I converted the test (the crash one) into w3c test mainly for a try ...
6 years, 8 months ago (2014-04-01 03:26:51 UTC) #9
dominicc (has gone to gerrit)
On 2014/04/01 03:26:51, kinuko wrote: > Btw... I converted the test (the crash one) into ...
6 years, 8 months ago (2014-04-01 05:07:43 UTC) #10
kinuko
On 2014/04/01 05:07:43, dominicc wrote: > On 2014/04/01 03:26:51, kinuko wrote: > > Btw... I ...
6 years, 8 months ago (2014-04-01 05:09:13 UTC) #11
dominicc (has gone to gerrit)
6 years, 8 months ago (2014-04-01 11:45:53 UTC) #12
Message was sent while issue was closed.
On 2014/04/01 05:09:13, kinuko wrote:
> The test only crashes with ASAN build.

Ah, of course! Sorry for the spam.

Powered by Google App Engine
This is Rietveld 408576698