Closed
Bug 873335
Opened 12 years ago
Closed 12 years ago
Use-after-free with expando on WebAudio script processor node
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
Tracking | Status | |
---|---|---|
firefox22 | --- | unaffected |
firefox23 | - | disabled |
firefox24 | --- | fixed |
firefox-esr17 | --- | unaffected |
b2g18 | --- | unaffected |
People
(Reporter: jruderman, Assigned: ehsan.akhgari)
References
Details
(5 keywords, Whiteboard: [adv-main24-])
Attachments
(7 files)
1. Install https://www.squarefree.com/extensions/domFuzzLite3.xpi
2. Set
user_pref("media.webaudio.enabled", true);
3. Run under ASan
4. Load the testcase
5. Quit Firefox
It's possible this is the same as bug 872394, but it's hard to know since that bug doesn't have a testcase.
Updated•12 years ago
|
Assignee | ||
Comment 1•12 years ago
|
||
Jesse, how can I reproduce this? I tried running the test case with the extension installed in an ASAN build but nothing was reported by ASAN.
Reporter | ||
Comment 2•12 years ago
|
||
I can reproduce on my Mac Mini but not on my MacBook Pro???
Reporter | ||
Comment 3•12 years ago
|
||
Maybe it's 10.7-only???
Comment 4•12 years ago
|
||
What does the ASAN report look like?
Assignee | ||
Comment 5•12 years ago
|
||
Yeah, I've fixed a number of bugs by just looking at the stacks from the ASAN report! :-)
Assignee | ||
Comment 6•12 years ago
|
||
Another question, is your ASAN build debug or optimized? I tried with a debug ASAN build.
Reporter | ||
Comment 7•12 years ago
|
||
I can only reproduce with my *non-debug* ASan build.
Reporter | ||
Comment 8•12 years ago
|
||
Comment 9•12 years ago
|
||
Works also with a debug / O1 build on MacOS 10.8
The stack for re-use is the same as in bug 872394
The test case attached here works for me reliable.
Reporter | ||
Comment 10•12 years ago
|
||
Christoph, since you can reproduce in an ASan debug build, can you attach an ASan log that includes all three stacks? (alloc, free, reuse)
Comment 11•12 years ago
|
||
alloc: obj-ff64-asan-opt/dom/bindings/AudioContextBinding.cpp:423
static bool
createScriptProcessor(JSContext* cx, JSHandleObject obj, mozilla::dom::AudioContext* self, unsigned argc, JS::Value* vp)
{
[...]
* result = self->CreateScriptProcessor(arg0, arg1, arg2, rv);
[...]
}
free: content/media/webaudio/AudioNode.cpp:40
NS_IMETHODIMP_(nsrefcnt)
AudioNode::Release()
{
if (mRefCnt.get() == 1) {
// We are about to be deleted, disconnect the object from the graph before
// the derived type is destroyed.
DisconnectFromGraph();
}
* nsrefcnt r = nsDOMEventTargetHelper::Release();
NS_LOG_RELEASE(this, r, "AudioNode");
return r;
}
re-use: /content/media/webaudio/AudioContext.cpp:439
void
AudioContext::Shutdown()
{
[...]
// Stop all script processor nodes, to make sure that they release
// their self-references.
nsTArray<ScriptProcessorNode*> spNodes;
GetHashtableElements(mScriptProcessorNodes, spNodes);
for (uint32_t i = 0; i < spNodes.Length(); ++i) {
* spNodes[i]->Stop();
}
[...]
}
and then
content/media/webaudio/AudioNode.h:80
[...]
void Drop(T* t)
{
if (mRefCnt > 0) {
* --mRefCnt;
if (mRefCnt == 0) {
t->Release();
}
}
[...]
Tested with m-i changeset: 132237:37b8fa6c1c92
Comment 12•12 years ago
|
||
Ok, this appears to be fixed in m-i changeset: 132521:0a830609f619
I can not reproduce it anymore.
Comment 13•12 years ago
|
||
Pardon, it is still reproducible with a few page reloads; have hit it also during the fuzzing process again.
Assignee | ||
Comment 14•12 years ago
|
||
Sigh, I bet this is the exact copy of bug 865550 only for ScriptProcessorNode. :(
Assignee | ||
Comment 15•12 years ago
|
||
Attachment #752280 -
Flags: review?(continuation)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → ehsan
Updated•12 years ago
|
Attachment #752280 -
Flags: review?(continuation) → review+
Assignee | ||
Comment 16•12 years ago
|
||
Christoph confirmed on IRC that this fixes the bug, so I landed the patch:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0cec5ad76246
Comment 17•12 years ago
|
||
I did?
Assignee | ||
Comment 18•12 years ago
|
||
(In reply to Christoph Diehl [:cdiehl] from comment #17)
> I did?
No, decoder did, sorry!
Comment 19•12 years ago
|
||
I believe the underlying problem is not fixed here.
Tested with m-i changeset: 132549:7cb2f5c6ef8e
Assignee | ||
Comment 20•12 years ago
|
||
(In reply to Christoph Diehl [:cdiehl] from comment #19)
> Created attachment 752741 [details]
> callstack-after-patch-v1
>
> I believe the underlying problem is not fixed here.
>
> Tested with m-i changeset: 132549:7cb2f5c6ef8e
I can't reproduce this using an optimized ASAN build. Could you please give me some information on how I can repro?
Flags: needinfo?(cdiehl)
Comment 21•12 years ago
|
||
It happened for me only one time after a long fuzzing run. Even though I called CC and GC explicitly in each testcase, none of the generated testcases was able to reproduce this particular crash.
Flags: needinfo?(cdiehl)
Assignee | ||
Comment 22•12 years ago
|
||
Hmm, OK. Looking at the stack, I cannot imagine how this could be happening. But if it is happening, it's definitely a different bug. Please file a new bug if you can find a way to reproduce it.
Thanks!
Comment 23•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
status-firefox24:
--- → fixed
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Comment 24•12 years ago
|
||
How far back does this need to be backported?
status-b2g18:
--- → unaffected
status-firefox22:
--- → affected
status-firefox23:
--- → affected
status-firefox-esr17:
--- → unaffected
tracking-firefox22:
--- → ?
tracking-firefox23:
--- → ?
Assignee | ||
Comment 25•12 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #24)
> How far back does this need to be backported?
23 and 24.
Assignee | ||
Comment 26•12 years ago
|
||
Well, 23. :-)
Updated•12 years ago
|
tracking-firefox22:
? → ---
Updated•12 years ago
|
Assignee | ||
Comment 27•11 years ago
|
||
Mass moving Web Audio bugs to the Web Audio component. Filter on duckityduck.
Component: Video/Audio → Web Audio
Comment 28•11 years ago
|
||
No longer tracking for FF23
Updated•11 years ago
|
Whiteboard: [adv-main24-]
Updated•10 years ago
|
Group: core-security
Assignee | ||
Comment 29•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Flags: in-testsuite? → in-testsuite+
Comment 30•5 years ago
|
||
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a27f986b6507
Add a crashtest based on the test case for the bug
Comment 31•5 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•