Closed
Bug 1052089
Opened 11 years ago
Closed 11 years ago
Streamline XPConnect singleton scopes and remove lazy instantiation
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
People
(Reporter: billm, Assigned: bholley)
References
Details
Attachments
(9 files)
|
2.73 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
|
5.36 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
|
2.20 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
|
1.27 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
|
1.39 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
|
1.13 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
|
6.10 KB,
patch
|
billm
:
review+
gkrizsanits
:
feedback+
|
Details | Diff | Splinter Review |
|
21.76 KB,
patch
|
billm
:
review+
gkrizsanits
:
feedback+
|
Details | Diff | Splinter Review |
|
18.45 KB,
patch
|
billm
:
review+
gkrizsanits
:
feedback+
|
Details | Diff | Splinter Review |
This will be useful for some extra CPOW security that we need.
| Assignee | ||
Comment 1•11 years ago
|
||
| Assignee | ||
Updated•11 years ago
|
Summary: Rename JunkScope and safe JS context scope to PrivilegedJunkScope and UnprivilegedJunkScope → Streamline XPConnect singleton scopes and remove lazy instantiation
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bobbyholley
| Assignee | ||
Comment 2•11 years ago
|
||
| Assignee | ||
Comment 3•11 years ago
|
||
This is green.
| Assignee | ||
Comment 4•11 years ago
|
||
And earlier version of these patches called nsContentUtils::GetSystemPrincipal()
too early, which returned null, and caused xpc::CreateSandboxObject to create
an nsNullPrincipal. Let's avoid having that happen again.
Attachment #8474050 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 5•11 years ago
|
||
nsContentUtils isn't ready by this point.
Attachment #8474051 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 6•11 years ago
|
||
This causes problems when used too early in startup.
Attachment #8474052 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 7•11 years ago
|
||
Attachment #8474053 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8474054 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 9•11 years ago
|
||
This prevents the JS engine from trying to fire off debugger notifications and
do other complicated things when we create this thing early in startup in the
upcoming patches.
Attachment #8474055 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 10•11 years ago
|
||
We've had some problems with GetJunkScope returning null and causing crashes in
the past, but I'm now pretty convinced that just null-checking it isn't the
answer. Rather than creating it lazily, we should create it at a defined point
in startup. Any problems will then be much more reproducible, and we can track
them down and fix them.
Attachment #8474056 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 11•11 years ago
|
||
These two things ended up getting mushed together in my tree.
Attachment #8474057 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 12•11 years ago
|
||
Attachment #8474058 -
Flags: review?(gkrizsanits)
| Assignee | ||
Comment 13•11 years ago
|
||
Comment on attachment 8474056 [details] [diff] [review]
Part 7 - Infallibly init singleton scopes in the XPCJSRuntime constructor. v1
I'm flagging Bill for review on this stuff because he's the one blocked on it, but I'm also flagging gabor for feedback on the last 3 patches just to make sure he's in the loop.
Attachment #8474056 -
Flags: feedback?(gkrizsanits)
| Assignee | ||
Updated•11 years ago
|
Attachment #8474057 -
Flags: feedback?(gkrizsanits)
| Assignee | ||
Updated•11 years ago
|
Attachment #8474058 -
Flags: feedback?(gkrizsanits)
Comment 14•11 years ago
|
||
Comment on attachment 8474055 [details] [diff] [review]
Part 6 - Make the junk scope invisible to the debugger and Components-less. v1
Review of attachment 8474055 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/xpconnect/src/XPCJSRuntime.cpp
@@ +3557,5 @@
> if (!mJunkScope) {
> AutoSafeJSContext cx;
> SandboxOptions options;
> options.sandboxName.AssignLiteral("XPConnect Junk Compartment");
> + options.invisibleToDebugger = true;
why invisible to the debugger?
Updated•11 years ago
|
Attachment #8474056 -
Flags: feedback?(gkrizsanits) → feedback+
Comment 15•11 years ago
|
||
Comment on attachment 8474057 [details] [diff] [review]
Part 8 - Rename JunkScope to PrivilegedJunkScope and remove fallibility of singleton scope access. v1
Review of attachment 8474057 [details] [diff] [review]:
-----------------------------------------------------------------
PrivilegedJunkScope sounds super weird... but I don't have any good/better name idea either.
Attachment #8474057 -
Flags: feedback?(gkrizsanits) → feedback+
Updated•11 years ago
|
Attachment #8474058 -
Flags: review?(wmccloskey)
Attachment #8474058 -
Flags: review?(gkrizsanits)
Attachment #8474058 -
Flags: feedback?(gkrizsanits)
Attachment #8474058 -
Flags: feedback+
| Reporter | ||
Updated•11 years ago
|
Attachment #8474050 -
Flags: review?(wmccloskey) → review+
| Assignee | ||
Comment 16•11 years ago
|
||
(In reply to Gabor Krizsanits [:krizsa :gabor] from comment #14)
> why invisible to the debugger?
See comment 9.
| Reporter | ||
Updated•11 years ago
|
Attachment #8474051 -
Flags: review?(wmccloskey) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8474052 -
Flags: review?(wmccloskey) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8474053 -
Flags: review?(wmccloskey) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8474054 -
Flags: review?(wmccloskey) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8474055 -
Flags: review?(wmccloskey) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8474056 -
Flags: review?(wmccloskey) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8474057 -
Flags: review?(wmccloskey) → review+
| Reporter | ||
Comment 17•11 years ago
|
||
Comment on attachment 8474058 [details] [diff] [review]
Part 9 - Swap out the SafeJSContextGlobal for the new UnprivilegedJunkScope. v1
Review of attachment 8474058 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/xpconnect/src/XPCJSRuntime.cpp
@@ +3548,5 @@
>
> + // Create the Unprivileged Junk Scope.
> + SandboxOptions unprivilegedJunkScopeOptions;
> + unprivilegedJunkScopeOptions.sandboxName.AssignLiteral("XPConnect Junk Compartment");
> + unprivilegedJunkScopeOptions.invisibleToDebugger = true;
Does this one need Components?
Attachment #8474058 -
Flags: review?(wmccloskey) → review+
| Assignee | ||
Comment 18•11 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #17)
> Does this one need Components?
It won't get one regardless of the boolean value, because it's not system or expanded principal.
Thanks for the reviews!
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/7741d78f083a
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/d0d758777e46
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/9b163c0d80d0
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/6cb6404e5d91
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/550074532758
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/58e2167bcef6
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/c4f5dcb57924
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/2a2883202fff
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/621470d025e7
Comment 19•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7741d78f083a
https://hg.mozilla.org/mozilla-central/rev/d0d758777e46
https://hg.mozilla.org/mozilla-central/rev/9b163c0d80d0
https://hg.mozilla.org/mozilla-central/rev/6cb6404e5d91
https://hg.mozilla.org/mozilla-central/rev/550074532758
https://hg.mozilla.org/mozilla-central/rev/58e2167bcef6
https://hg.mozilla.org/mozilla-central/rev/c4f5dcb57924
https://hg.mozilla.org/mozilla-central/rev/2a2883202fff
https://hg.mozilla.org/mozilla-central/rev/621470d025e7
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Updated•11 years ago
|
Flags: qe-verify-
You need to log in
before you can comment on or make changes to this bug.
Description
•