Closed
Bug 851416
Opened 13 years ago
Closed 13 years ago
Use-after-free with SVG and privacy.sanitize.sanitizeOnShutdown
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla22
| Tracking | Status | |
|---|---|---|
| firefox19 | --- | unaffected |
| firefox20 | --- | unaffected |
| firefox21 | --- | unaffected |
| firefox22 | + | fixed |
| firefox23 | --- | disabled |
| firefox-esr17 | --- | unaffected |
| b2g18 | --- | unaffected |
| b2g18-v1.0.0 | --- | unaffected |
| b2g18-v1.0.1 | --- | unaffected |
People
(Reporter: jruderman, Assigned: seth)
References
Details
(5 keywords, Whiteboard: [adv-main22-])
Attachments
(4 files)
1. Create a new profile
2. Set:
user_pref("privacy.sanitize.sanitizeOnShutdown", true);
3. Download the testcase as q4-a.html
4. Fix the path in the testcase.
5. Run firefox -profile ~/pxa/ q4-a.html
6. Quit Firefox
Result:
Crash [@ nsNodeUtils::ParentChainChanged] or
Crash [@ nsNodeUtils::LastRelease]
| Reporter | ||
Comment 1•13 years ago
|
||
| Reporter | ||
Comment 2•13 years ago
|
||
Comment 3•13 years ago
|
||
Might be webidl changes. If this is a regression then a regression range would likely be useful.
| Reporter | ||
Comment 4•13 years ago
|
||
The first bad revision is:
changeset: http://hg.mozilla.org/mozilla-central/rev/1cf12e699dc7
user: Seth Fowler
date: Thu Feb 28 12:02:31 2013 -0800
summary: Bug 846028 - Coalesce invalidations in VectorImage. r=dholbert
Blocks: 846028
Keywords: regression
| Assignee | ||
Comment 5•13 years ago
|
||
I'll take a look at this.
Updated•13 years ago
|
Assignee: nobody → seth
| Assignee | ||
Comment 6•13 years ago
|
||
So bug 846028 causes SVGRootRenderingObserver to stay out of the rendering observer list for the SVG root element it's watching from the time when some initial invalidation happens until the time when VectorImage::Draw is called. Unfortunately this test case shows that this can cause it to miss important messages - in particular it misses a call to nsSVGRenderingObserver::NotifyEvictedFromRenderingObserverList, which (logically enough) is only called if you're in the rendering observer list, but also has the effect of removing you from the _mutation_ observer list. SVGrootRenderingObserver thus isn't removed from the mutation observer list at the right time in certain circumstances, leading to the crash.
Perhaps this behavior should not cause a crash, and if not we can fix the API design in a separate bug, but for this bug I think reimplementing bug 846028 in a way that's safer with the current API is the right way to go. Patch shortly.
| Assignee | ||
Comment 7•13 years ago
|
||
Here's the fix. We ensure that SVGRootRenderingObserver always gets added back to the rendering observer list, one way or another. If we send an invalidation, VectorImage::Draw will take care of it as before. The new thing is that if we _don't_ send an invalidation, we go ahead and add ourselves back right there in SVGRootRenderingObserver::DoUpdate. With this patch applied I can't reproduce the testcase crash anymore.
Attachment #726375 -
Flags: review?(dholbert)
| Assignee | ||
Comment 8•13 years ago
|
||
Try job here: https://tbpl.mozilla.org/?tree=Try&rev=4b54557545a7
Updated•13 years ago
|
Attachment #726375 -
Flags: review?(dholbert) → review+
| Assignee | ||
Comment 9•13 years ago
|
||
Thanks for the super fast review, Daniel!
Fortunately, this doesn't affect anything but nightly AFAICT. Will push in if things look good on try.
Comment 10•13 years ago
|
||
> user_pref("privacy.sanitize.sanitizeOnShutdown", true);
Looking at the patch, I'm guessing this bug can occur also without that pref?
Just that it make crashing more reliable?
> Crash [@ nsNodeUtils::ParentChainChanged] or
> Crash [@ nsNodeUtils::LastRelease]
I'll assume the worst and flag as csec-uaf unless someone thinks otherwise.
status-b2g18:
--- → unaffected
status-b2g18-v1.0.0:
--- → unaffected
status-b2g18-v1.0.1:
--- → unaffected
status-firefox19:
--- → unaffected
status-firefox20:
--- → unaffected
status-firefox21:
--- → unaffected
status-firefox22:
--- → affected
status-firefox-esr17:
--- → unaffected
Keywords: csec-uaf,
sec-critical
OS: Mac OS X → All
Hardware: x86_64 → All
Comment 11•13 years ago
|
||
Seth, it looks like this is ready to land; or did you find some problem?
Flags: needinfo?(seth)
| Assignee | ||
Comment 12•13 years ago
|
||
Mats, yeah, I think it's pretty likely that this bug could occur without the pref. And indeed, try looks OK and it's ready to land. I'll push it in now.
Flags: needinfo?(seth)
Updated•13 years ago
|
tracking-firefox22:
--- → +
| Assignee | ||
Comment 13•13 years ago
|
||
Sorry it took so long to actually push; inbound was closed earlier.
https://hg.mozilla.org/integration/mozilla-inbound/rev/e152c2763cad
tracking-firefox22:
+ → ---
| Assignee | ||
Comment 14•13 years ago
|
||
Hmm, and I reset that flag. I don't understand why that happens. It's not like this was a mid-air collision.... Sorry, but I don't appear to have the permissions to fix it.
Comment 15•13 years ago
|
||
All us mere mortals can do is request it, and then those with god-like powers can +/- it. ;-)
tracking-firefox21:
--- → ?
Comment 16•13 years ago
|
||
(In reply to Robert Kaiser (:kairo@mozilla.com) from comment #15)
> All us mere mortals can do is request it, and then those with god-like
> powers can +/- it. ;-)
I guess you meant to nominate for tracking-firefox22 here, so going ahead and setting the right flags here
Updated•13 years ago
|
tracking-firefox21:
? → ---
tracking-firefox22:
--- → +
Comment 17•13 years ago
|
||
(In reply to bhavana bajaj [:bajaj] from comment #16)
> I guess you meant to nominate for tracking-firefox22 here, so going ahead
> and setting the right flags here
Gah, was late at night for me, sorry. Thanks for doing the right thing there. :)
Comment 18•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Updated•13 years ago
|
Flags: in-testsuite?
Updated•13 years ago
|
Whiteboard: [adv-main22-]
Updated•12 years ago
|
Group: core-security
Comment 19•12 years ago
|
||
status-firefox23:
--- → disabled
You need to log in
before you can comment on or make changes to this bug.
Description
•