Closed
Bug 1135878
Opened 10 years ago
Closed 10 years ago
owned_critical_section UAF in wasapi_stream_init()
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox37 | --- | unaffected |
firefox38 | --- | fixed |
firefox39 | --- | fixed |
firefox-esr31 | --- | unaffected |
b2g-v1.4 | --- | unaffected |
b2g-v2.0 | --- | unaffected |
b2g-v2.1 | --- | unaffected |
b2g-v2.2 | --- | unaffected |
b2g-master | --- | fixed |
People
(Reporter: karlt, Assigned: kinetik)
References
Details
(Keywords: csectype-uaf, sec-critical)
Attachments
(1 file)
7.30 KB,
patch
|
padenot
:
review+
abillings
:
approval-mozilla-aurora+
abillings
:
sec-approval+
|
Details | Diff | Splinter Review |
At https://hg.mozilla.org/mozilla-central/annotate/056c556b41b2/media/libcubeb/src/cubeb_wasapi.cpp#l1137
an auto_lock is created with a copy of the pointer in stm->stream_reset_lock.
When setup_wasapi_stream fails, it calls wasapi_stream_destroy(stm).
e.g. https://hg.mozilla.org/mozilla-central/annotate/056c556b41b2/media/libcubeb/src/cubeb_wasapi.cpp#l971
That deletes the object referenced by stm->stream_reset_lock
https://hg.mozilla.org/mozilla-central/annotate/056c556b41b2/media/libcubeb/src/cubeb_wasapi.cpp#l1193
On return to wasapi_stream_init(), the auto_lock destructor tries to leave the
CRITICAL_SECTION that has been Delete()d using the pointer to the
owned_critical_section that has been deleted.
Reporter | ||
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Move wasapi_stream_destroy outside of setup_wasapi_stream, since it should only be called when the stream is being allocated. In all other error cases, the library caller is expected to destroy the stream after an error.
Also change the render loop's callback from STOPPED to ERROR.
Updated•10 years ago
|
Attachment #8568269 -
Flags: review?(padenot) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Updated•10 years ago
|
Keywords: sec-critical
Assignee | ||
Comment 5•10 years ago
|
||
(In reply to Al Billings [:abillings] from comment #4)
> Was this trunk only?
Yes.
Flags: needinfo?(kinetik)
Comment 6•10 years ago
|
||
Based on the blocking bugs, it looks like it also affects 38. Let me know if that's not the case, or just set the 38 flag to disabled.
status-firefox37:
--- → unaffected
status-firefox38:
--- → affected
status-firefox39:
--- → affected
status-firefox-esr31:
--- → unaffected
Assignee | ||
Comment 7•10 years ago
|
||
Comment on attachment 8568269 [details] [diff] [review]
bug1135878_v0.patch
Sorry, I'm confused and wrong, since we've just branched this *does* affect aurora. :(
Approval Request Comment
[Feature/regressing bug #]: bug 1127213
[User impact if declined]: crash/UAF
[Describe test coverage new/current, TreeHerder]: n/a
[Risks and why]: low
[String/UUID change made/needed]: none
Attachment #8568269 -
Flags: approval-mozilla-aurora?
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Comment 9•10 years ago
|
||
Not to be a PITA but can you set sec-approval? and answer the template questions?
Assignee | ||
Comment 10•10 years ago
|
||
Comment on attachment 8568269 [details] [diff] [review]
bug1135878_v0.patch
I'm not sure I would consider this a security bug... I think Karl was being overly cautious filing it as one. I'd be interesting in hearing how this could lead to an exploit.
[Security approval request comment]
How easily could an exploit be constructed based on the patch?
Seems difficult to me, requires finding a way to invoke error handling path, which depends on state of OS audio stack... and then building a controllable exploit from it.
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?
It's not obvious how one would construct an exploit from the changes made in the patch.
Which older supported branches are affected by this flaw?
Only aurora/38.
If not all supported branches, which bug introduced the flaw?
Bug 1127213.
Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be?
Exact same patch applies to trunk and aurora.
How likely is this patch to cause regressions; how much testing does it need?
Low risk, fairly simple changes to error handling.
Attachment #8568269 -
Flags: sec-approval?
Comment 11•10 years ago
|
||
Seems straightforward enough to just land, especially since we just branched.
Updated•10 years ago
|
Attachment #8568269 -
Flags: sec-approval?
Attachment #8568269 -
Flags: sec-approval+
Attachment #8568269 -
Flags: approval-mozilla-aurora?
Attachment #8568269 -
Flags: approval-mozilla-aurora+
Assignee | ||
Comment 12•10 years ago
|
||
Updated•10 years ago
|
status-b2g-v1.4:
--- → unaffected
status-b2g-v2.0:
--- → unaffected
status-b2g-v2.1:
--- → unaffected
status-b2g-v2.2:
--- → unaffected
status-b2g-master:
--- → fixed
Updated•10 years ago
|
Group: core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•