Closed
Bug 307989
Opened 19 years ago
Closed 19 years ago
Crash [@ GetWrapperFor] [@ nsIView::GetViewFor] dragging selection within evil changing document
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect, P1)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: dbaron)
References
Details
(Keywords: crash, verified1.8.0.2, verified1.8.1, Whiteboard: [sg:critical?][patch][rft-dl] trunk(1.9) only)
Crash Data
Attachments
(1 file)
3.28 KB,
patch
|
roc
:
review+
roc
:
superreview+
timr
:
approval-aviary1.0.8-
timr
:
approval-aviary1.0.9?
timr
:
approval1.7.13-
dveditz
:
approval1.8.0.1-
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20050910
Firefox/1.6a1
Steps to reproduce:
1. Open the very evil testcase.
2. Select some text and start dragging it. (You can use the keyboard to select
all before dragging with the mouse.)
3. Wait until the page changes.
4. Drop.
Result: More often than not, the browser crashes [@ nsIView::GetViewFor] [@
GetWrapperFor]. The top of the stack is a random address. I'm pretty sure this
is exploitable.
TB9234593K, TB9234571Z
Please keep this security-sensitive until a Firefox release with this fix has
gone out and both bug 306663 and bug 306939 have become public.
Reporter | ||
Comment 1•19 years ago
|
||
Reporter | ||
Updated•19 years ago
|
Whiteboard: [sg:fix]
Reporter | ||
Comment 2•19 years ago
|
||
I can't get it to crash on Windows. On Windows, the script is paused until I
drop what I'm dragging.
Reporter | ||
Updated•19 years ago
|
Flags: blocking1.8b5?
Updated•19 years ago
|
Flags: blocking1.8b5? → blocking1.8b5+
Comment 3•19 years ago
|
||
ROC, can you help us look into these crashes?
I can't get it to crash on Linux.
Comment 5•19 years ago
|
||
Pulling off 1.5b2 list for now. Mac-only, requires a specific set of steps to
cause. Putting on Josh A. radar to see if there is an easy fix
Assignee: nobody → joshmoz
Flags: blocking1.8b5+ → blocking1.8b5-
Reporter | ||
Comment 6•19 years ago
|
||
Still crashes using Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
rv:1.9a1) Gecko/20051018 Firefox/1.6a1. TB10831987H
Updated•19 years ago
|
Assignee: joshmoz → dbaron
Assignee | ||
Comment 7•19 years ago
|
||
The problem here is that the nsMouseEvent cached in the nsSelection object is pointing to a stale widget. We should probably store some information other than an nsMouseEvent in the *DelayedCaretData functions, i.e., store something like what we do with the result in the one user of GetDelayedCaretData. (There are multiple implementations, since one forwards to the other.)
Assignee | ||
Comment 8•19 years ago
|
||
So this code is called only when you click in a selection and don't move far enough for the movement to be considered a drag.
What we currently do is use the coordinates of the click start to call GetContentAndOffsetsFromPoint in the frame in which the click ends. (You can move a few pixels without starting a drag, enough to get to a different line in a textarea.)
We could fix this by doing the GetContentAndOffsetsFromPoint call up front and thus being consistent about using the start coordinates of the click. But that seems silly, since one usually uses the end coordinates of a click. The thing is, we normally do do selection for movements that aren't large enough to be considered a drag, so there really isn't a normal behavior for where to place a caret when the start and end of the click are at two different points -- normally you'd end up with a selection. But I think it seems like it would be fine to just use the end coordinate of the click, which removes the need for storing any of this information at all.
Assignee | ||
Comment 9•19 years ago
|
||
Attachment #206040 -
Flags: superreview?(roc)
Attachment #206040 -
Flags: review?(roc)
Assignee | ||
Comment 10•19 years ago
|
||
(And thanks to Sicking for helping debug this.)
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Whiteboard: [sg:fix] → [sg:fix][patch]
Comment on attachment 206040 [details] [diff] [review]
patch
I wonder if we really need the delayed caret data at all.
Attachment #206040 -
Flags: superreview?(roc)
Attachment #206040 -
Flags: superreview+
Attachment #206040 -
Flags: review?(roc)
Attachment #206040 -
Flags: review+
Assignee | ||
Comment 12•19 years ago
|
||
Fix checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•19 years ago
|
Attachment #206040 -
Flags: approval1.8.1?
Attachment #206040 -
Flags: approval1.8.0.1?
Comment 13•19 years ago
|
||
Let's bake a couple more days on the trunk and then consider for 1.8.0.1.
Updated•19 years ago
|
Flags: blocking1.8.1+
Flags: blocking1.8.0.1+
Whiteboard: [sg:fix][patch] → [sg:critical?][patch]
Updated•19 years ago
|
Attachment #206040 -
Flags: approval1.8.1?
Attachment #206040 -
Flags: approval1.8.1+
Attachment #206040 -
Flags: approval1.8.0.1?
Attachment #206040 -
Flags: approval1.8.0.1+
Assignee | ||
Comment 14•19 years ago
|
||
So, when I tried to merge the nsFrame.cpp changes, I discovered that the code is different on the branch -- I think different enough that the crash bug is not present and this fix won't actually do anything useful. I want to double-check this a little more carefully, later, though.
Comment 15•19 years ago
|
||
I'm not seeing a crash on the 1.8 branch -- can someone else confirm that? If it's not crashing this doesn't need to block 1.8.0.x
Keywords: qawanted
Comment 16•19 years ago
|
||
May not happen on 1.8 branch, slip nomination to 1.8.0.2 for reconsideration whether we need this or not.
Flags: blocking1.8.0.2?
Flags: blocking1.8.0.1-
Flags: blocking1.8.0.1+
Updated•19 years ago
|
Attachment #206040 -
Flags: approval1.8.1?
Attachment #206040 -
Flags: approval1.8.1+
Attachment #206040 -
Flags: approval1.8.0.2?
Attachment #206040 -
Flags: approval1.8.0.1-
Attachment #206040 -
Flags: approval1.8.0.1+
Updated•19 years ago
|
Flags: testcase+
Updated•19 years ago
|
Attachment #206040 -
Flags: approval1.8.1? → branch-1.8.1?(roc)
Assignee | ||
Comment 17•19 years ago
|
||
I think we should take just the nsSelection.cpp half of the patch on the branches -- doing so would turn any crash that exists (but I don't think it does) from something potentially exploitable into a null dereference.
I don't see a need to attach a new patch for that, but if somebody thinks I need to, let me know.
Comment 18•19 years ago
|
||
Can't really a= the wrong patch, but a=dveditz on 1.8.0.2 for the proposed smaller patch
Flags: blocking1.8.0.2? → blocking1.8.0.2+
Assignee | ||
Updated•19 years ago
|
Attachment #206040 -
Flags: branch-1.8.1?(roc)
Attachment #206040 -
Flags: approval1.8.0.2?
Assignee | ||
Comment 19•19 years ago
|
||
nsSelection.cpp change checked in to MOZILLA_1_8_BRANCH and MOZILLA_1_8_0_BRANCH
Keywords: fixed1.8.0.2,
fixed1.8.1
Comment 20•19 years ago
|
||
Does this still need qawanted? It looks like comment #15 wanted QA on the 1.8. But we already have a fix on 1.8.1 branch so it looks like we past that now.
Assignee | ||
Comment 21•19 years ago
|
||
Only half the fix was landed on the branches; that fix would either (a) have no effects or (b) turn a rare potentially exploitable crash into a slightly more common null dereference crash. I think it's probably safe to assume it's (a) unless somebody reports the crash, although some testing that that's actually the case could be useful.
Comment 22•19 years ago
|
||
davel or bclary- can you look at dbaron's comment 21 an provide some testing there?
Comment 23•19 years ago
|
||
I've looked at the code, and talked briefly to dbaron, and I'm not sure that there is a good way to do directed testing regarding the patch that landed on the branch.
If we're concerned about this fix, then I one sugestion I have is that we instrument the code (perhaps by setting the widget pointer to a known bad address rather than nsnull), then do a manual mouse-event torture-test with caret-browsing on and off.
Do we have trace or static analysis tools that can figure out the lifecycle (possible or actual) of event objects? That kind of thing would help direct our testing.
Comment 24•19 years ago
|
||
removing qawanted keyword - we'll verify using the test case and poking around if we have the opportunity
Keywords: qawanted
Updated•19 years ago
|
Whiteboard: [sg:critical?][patch] → [sg:critical?][patch][rft-dl]
Comment 25•19 years ago
|
||
verified on 1.8.0.2 using Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060301 Firefox/1.5.0.1. Unable to crashy despite repeated manipulations of the evil test case. Hopefully it isn't poised to take over the world. Adding relevant keyword.
Keywords: fixed1.8.0.2 → verified1.8.0.2
Whiteboard: [sg:critical?][patch][rft-dl] → [sg:critical?][patch]
Comment 26•19 years ago
|
||
Comment on attachment 206040 [details] [diff] [review]
patch
The nsSelection.cpp part of this patch was the only part checked in elsewhere, and it still applies cleanly to the older branch. It would be good to take for the reasons cited in comment 17.
Attachment #206040 -
Flags: approval1.7.13?
Attachment #206040 -
Flags: approval-aviary1.0.8?
Updated•19 years ago
|
Whiteboard: [sg:critical?][patch] → [sg:critical?][patch][rft-dl]
Comment 27•19 years ago
|
||
Comment on attachment 206040 [details] [diff] [review]
patch
We are already past code freeze and the general testing is done. "-" for 1.0.8. "?" for 1.0.9.
Attachment #206040 -
Flags: approval1.7.13?
Attachment #206040 -
Flags: approval1.7.13-
Attachment #206040 -
Flags: approval-aviary1.0.9?
Attachment #206040 -
Flags: approval-aviary1.0.8?
Attachment #206040 -
Flags: approval-aviary1.0.8-
Updated•19 years ago
|
Flags: blocking1.7.14?
Flags: blocking-aviary1.0.9?
Updated•19 years ago
|
Flags: blocking1.7.14?
Flags: blocking-aviary1.0.9?
Whiteboard: [sg:critical?][patch][rft-dl] → [sg:critical?][patch][rft-dl] trunk(1.9) only
Comment 28•18 years ago
|
||
verified on 1.8.1 using Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1b1) Gecko/20060810 BonEcho/2.0b1. Unable to crash despite
repeated manipulations of the evil test case. Adding keyword.
Keywords: fixed1.8.1 → verified1.8.1
Updated•18 years ago
|
Flags: in-testsuite+ → in-testsuite?
Updated•18 years ago
|
Group: security
Updated•13 years ago
|
Crash Signature: [@ GetWrapperFor]
[@ nsIView::GetViewFor]
You need to log in
before you can comment on or make changes to this bug.
Description
•