Bugzilla@Mozilla – Bug 528300
Crash [@ txExecutionState::~txExecutionState]
Last modified: 2010-05-09 08:00:17 PDT
Summon comment box
Created attachment 412043 [details] testcase (don't load from bugzilla) Load the testcase and refresh if it doesn't crash right away. EIP is sometimes different, especially when extra fluff is added to the transform and to the original document, so IMO this is exploitable.
Created attachment 412044 [details] stack
WFM unless I save the file locally then open it.
Created attachment 412409 [details] [review] v1 Still need to add the crashtest.
Created attachment 412413 [details] [review] v1
*** Bug 528488 has been marked as a duplicate of this bug. ***
I'll also add the crashtest from bug 528488.
Created attachment 412490 [details] [review] v1.1
Comment on attachment 412490 [details] [review] v1.1 I don't crash on this testcase or the one in bug 528488 with the patch applied.
Comment on attachment 412490 [details] [review] v1.1 So why exactly are we crashing? Is the global-variable code ending up in a bad state or something? While this patch seems like the right thing to do, I'm wondering if we could/should secure more code. r=me anyhow
We bail out early because of an error when trying to get the variable in txExecutionState::getVariable. We don't pop the result handler from the stack. We have code to deal with that, not deleting the unknown handler if an error happens (since the result handler stack will delete it). But evaluateToNumber eats the error return and so we do delete the unknown handler, and then the stacks tries to do that again.
Ah, and we can't pop these as we go up the callstack because it was push by a txInstruction and so we can't pop these guys off as we unwind. Would be nice to get this more stable, but I can't think of a way to do so for now.
Need this crash fix on branch (not yet landed on trunk, need blocking or approval first).
Created attachment 413940 [details] [review] v1.2 Turns out the testcase for bug 528488 exposed a small leak in txExecutionState::getVariable. This is what I landed.
http://hg.mozilla.org/mozilla-central/rev/a727327f9777 http://hg.mozilla.org/releases/mozilla-1.9.2/rev/74188d9e9faf I'll nominate for other branches too.
Comment on attachment 413940 [details] [review] v1.2 Would be nice if you could diff with -u8 r=me
Comment on attachment 413940 [details] [review] v1.2 XSLT crash fix.
Comment on attachment 413940 [details] [review] v1.2 Approved for 1.9.1.7 and 1.9.0.17, a=dveditz for release-drivers
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/7bb736fa5f7a
Verified fixed in 1.9.1 with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8pre) Gecko/20100115 Shiretoko/3.5.8pre (.NET CLR 3.5.30729). Attached testcase crashes in 1.9.1.7 but just shows "Error during XSLT transformation: XSLT Stylesheet (possibly) contains a recursion." in the 1.9.1 current nightly.
Created attachment 423778 [details] [review] 1.8.0 version Affects 1.8.0
Verified for 1.9.0.18 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.16pre) Gecko/2010020215 GranParadiso/3.0.18pre (.NET CLR 3.5.30729) with attached testcase. Results are the same as the 1.9.1.8 verification with a crash in 1.9.0.17 but an XSLT error in 1.9.0.18.