Bug 184064 - Thread safety issue in IDBFactory' shouldThrowSecurityException()
Summary: Thread safety issue in IDBFactory' shouldThrowSecurityException()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 184059
  Show dependency treegraph
 
Reported: 2018-03-27 18:45 PDT by Chris Dumez
Modified: 2018-03-28 13:37 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.87 KB, patch)
2018-03-27 19:17 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (3.85 KB, patch)
2018-03-28 12:59 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-03-27 18:45:09 PDT
Thread safety issue in IDBFactory' shouldThrowSecurityException(). It is getting called on a non-main thread but uses the SchemeRegistry:
ASSERTION FAILED: isMainThread()
./platform/SchemeRegistry.cpp(118) : URLSchemesMap &WebCore::localURLSchemes()
1   0x25072c88d WTFCrash
2   0x24355e1ca WebCore::localURLSchemes()
3   0x24355e420 WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(WTF::String const&)
4   0x2434597e9 WebCore::SecurityOrigin::isLocal() const
5   0x24345ace2 WebCore::SecurityOrigin::canAccessStorage(WebCore::SecurityOrigin const*, WebCore::SecurityOrigin::ShouldAllowFromThirdParty) const
6   0x24209e0f2 WebCore::SecurityOrigin::canAccessDatabase(WebCore::SecurityOrigin const&) const
7   0x242092e9d WebCore::shouldThrowSecurityException(WebCore::ScriptExecutionContext&)
8   0x242093022 WebCore::IDBFactory::deleteDatabase(WebCore::ScriptExecutionContext&, WTF::String const&)
9   0x24168d8a2 WebCore::jsIDBFactoryPrototypeFunctionDeleteDatabaseBody(JSC::ExecState*, WebCore::JSIDBFactory*, JSC::ThrowScope&)
Comment 1 Chris Dumez 2018-03-27 19:17:27 PDT
Created attachment 336635 [details]
Patch
Comment 2 Ryosuke Niwa 2018-03-27 22:41:35 PDT
Comment on attachment 336635 [details]
Patch

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

> Source/WebCore/ChangeLog:14
> +        methods are often called from background threads, this match make SecurityOrigin::isLocal()

You mean "this match" -> "this patch"?
Comment 3 Chris Dumez 2018-03-28 12:59:32 PDT
Created attachment 336701 [details]
Patch
Comment 4 WebKit Commit Bot 2018-03-28 13:36:08 PDT
Comment on attachment 336701 [details]
Patch

Clearing flags on attachment: 336701

Committed r230044: <https://trac.webkit.org/changeset/230044>
Comment 5 WebKit Commit Bot 2018-03-28 13:36:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-03-28 13:37:23 PDT
<rdar://problem/38969800>