Closed Bug 1259572 Opened 10 years ago Closed 8 years ago

Lots of crashes that look like they might be exploitable under nsSubDocumentFrame::DestroyFrom calling GetDocumentFromView

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox48 --- wontfix
firefox49 --- wontfix
firefox-esr45 --- affected
firefox50 --- wontfix
firefox51 --- wontfix
firefox52 --- wontfix
firefox-esr52 --- affected
firefox53 --- fix-optional
firefox54 --- ?
firefox55 --- ?

People

(Reporter: bzbarsky, Assigned: tnikkel)

References

Details

(4 keywords)

Crash Data

Attachments

(1 file)

jesup asked me to file this, based on this crash-stats bit: https://crash-stats.mozilla.com/signature/?product=Firefox&address=~e5e5&signature=GetDocumentFromView&_columns=date&_columns=product&_columns=version&_columns=build_id&_columns=platform&_columns=reason&_columns=address&page=1#reports Looks like we end up crashing on this bit: nsIFrame* f = aView->GetFrame(); Is it possible that in DestroyFrom mInnerView->GetFirstChild() was a garbage pointer?
Flags: needinfo?
Flags: needinfo?(tnikkel)
Flags: needinfo?(cpearce)
Flags: needinfo?
possibly sec-critical if we find a reliable reproducer, starting with sec-high for now.
Group: core-security → layout-core-security
Patch in bug 1260531 might help with this.
tnikkel is better placed to help with this than I.
Flags: needinfo?(cpearce)
This seems likely related to bug 1261175. Either way, the work that happens for that bug is likely to help here, so I'll post updates to that bug.
A decent chance bug 1265577 fixes this.
Depends on: 1265577
I see one crash on 50 in the last 7 days: https://crash-stats.mozilla.com/report/index/7c19fcd8-778b-4fec-99f2-0e42f2160708 ...but none on 49. There are still a good number on 48.
There are still a good number of similar looking crashes in 50, and a handful in 51. I don't know if there's some release only issue, or if we fixed it somewhere.
Crash Signature: [@ GetDocumentFromView ]
Timothy, it seems you had an idea as to what bugs might or might not fix this. Care to take a look again? :)
Assignee: nobody → tnikkel
Current crashrate across all versions is ~50/day, so not rare
Mass wontfix for bugs affecting firefox 52.
Flags: needinfo?(tnikkel)
tnikkel - obviously the bug you referenced didn't fix this... can you have another look? thanks
Flags: needinfo?(tnikkel)
Yes, I wrote a prototype patch for what I wanted to do recently. Turning it into something landable requires thinking through a lot of complex interactions which I haven't had time to do.
Given this is somewhere between sec-high, and sec-critical, let's put this on the radar to get fixed soon (preferably 55 and uplift to 54?). I'll fix-optional it for 53. Crash-stats shows that this goes back to around Fx 24 or earlier.
Timothy, did you have a chance to work on this bug?
I haven't had a chance to touch the prototype patch at all. Besides cleaning up this patch here is what needs to be done: Besides in this patch, there are three other places in the code that touch root views that might conflict with this patch. nsDocShell::RestoreFromHistory plucks a view from its current location and places a different view in its place. nsDocumentViewer::MakeWindow creates a new root view and inserts it. nsDocumentViewer::Destory plucks a root view from the hierarchy and stashes it in the bf cache. We need to check the following scenarios: 1) subdocumentframe stores one detached view 2) subdocumentframe stores one detached view, that view gets destroyed 3) subdocumentframe stores two or more detached views 4) subdocumentframe stores two or more detached views, they all get destroyed 5) subdocumentframe stores two or more detached views, the first one gets destroyed 6) subdocumentframe stores two or more detached views, the second one gets destroyed and then each one of the above six followed by one (or more) of the three places from the previous paragraph, and then nsSubDocumentFrame::Init or nsHideViewer::Run runs. It's not easy because I don't know how to trigger these conditions, but I think it is precisely these conditions happening which are the cause of this bug. If we don't get the interactions right then at best we don't fix the bug, at worst we make it worse.
(In reply to Timothy Nikkel (:tnikkel) from comment #16) > It's not easy because I don't know how to trigger these conditions, but I > think it is precisely these conditions happening which are the cause of this > bug. If we don't get the interactions right then at best we don't fix the > bug, at worst we make it worse. Timothy, would someone else who works on that code be a helpful guide here? If not, do you think we should wade through crash report URLs and try to find something reproducible?
Crashes in the signature and the query in comment 0 are only affecting old versions. Seems to have been fixed for all currently supported versions of firefox (ESR-52 and later)
Group: layout-core-security
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Flags: needinfo?(tnikkel)
Product: Core → Core Graveyard
Component: Layout: HTML Frames → Layout: Images
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: