Closed
Bug 507030
Opened 16 years ago
Closed 16 years ago
crash (segfault) @ vorbis_book_init_decode when playing corrupted ogg vorbis file
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: keeler, Unassigned)
Details
(Keywords: crash, testcase, Whiteboard: [sg:critical])
Attachments
(2 files)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.12) Gecko/2009070811 Ubuntu/9.04 (jaunty) Firefox/3.0.12
Build Identifier: mozilla-central revision 7149d895e5b3
Segmentation fault when playing corrupted ogg vorbis file (attached).
Reproducible: Always
Steps to Reproduce:
1. Load attached file.
2. Possibly reload the page a couple of times.
Actual Results:
firefox crashes
Expected Results:
some sort of "this file is corrupted" message
![]() |
Reporter | |
Comment 1•16 years ago
|
||
I wasn't able to get a stack trace from firefox for some reason, but here's the stack trace of oggplayer.
![]() |
Reporter | |
Comment 2•16 years ago
|
||
In vorbis_sharedbook.c, we have the following:
(in vorbis_book_init_decode, starting at line 358)
ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries);
ogg_uint32_t **codep=alloca(sizeof(*codep)*n);
if(codes==NULL)goto err_out;
When running the given file, _make_words returns null, causing the program to jump to err_out and call vorbis_book_clear. However, because n is very large, alloca has modified the stack pointer by more than 30 MB, which causes a segfault.
This is very probably exploitable (n is derived from the number of entries in the passed-in static_codebook, which presumably depends on the input file).
One really quick fix would be to move the null check to above the call to alloca, but this doesn't get rid on the underlying problem, which is the unsafe use of alloca.
Updated•16 years ago
|
Whiteboard: [sg:critical]
![]() |
Reporter | |
Comment 3•16 years ago
|
||
Bug poke: is this being worked on?
I could write the patch for the quick fix I proposed above, but I'm not sure what to do about the alloca calls. Should they just be changed to malloc? (with appropriate calls to free, of course)
Comment 4•16 years ago
|
||
xiphmont, the author of the code, is cc'd on the bug. I'm interested in what his thoughts on a fix are,
Comment 5•16 years ago
|
||
This does not crash on trunk for me.
Updated•16 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 6•16 years ago
|
||
WFM [Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a1pre) Gecko/20091020 Minefield/3.7a1pre].
File loads, but won't play. Would be a good testcase/crashtest.
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite?
Resolution: --- → WORKSFORME
Updated•10 years ago
|
Group: core-security → core-security-release
Updated•10 years ago
|
Group: core-security-release
You need to log in
before you can comment on or make changes to this bug.
Description
•