Skip to content
Memory corruption Disclosed report

Heap-use-after-free in mozilla::MediaStream::ChangeExplicitBlockerCount

Abhishek Arya Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 13 days
  • Paid in 26 days
  • Disclosed after 13 days
Text
Created attachment 8355065
Testcase

==25265==ERROR: AddressSanitizer: heap-use-after-free on address 0x614000109790 at pc 0x7f93a8898469 bp 0x7f9389bd6310 sp 0x7f9389bd6308
READ of size 8 at 0x614000109790 thread T36 (MediaStreamGrph)
    #0 0x7f93a8898468 in mozilla::MediaStream::ChangeExplicitBlockerCount(int)::Message::Run() content/media/MediaStreamGraph.cpp:1656
    #1 0x7f93a886f10e in mozilla::MediaStreamGraphImpl::RunThread() content/media/MediaStreamGraph.cpp:1127
    #2 0x7f93a8899529 in mozilla::(anonymous namespace)::MediaStreamGraphInitThreadRunnable::Run() content/media/MediaStreamGraph.cpp:1350
    #3 0x7f93a4f7abcb in nsThread::ProcessNextEvent(bool, bool*) xpcom/threads/nsThread.cpp:634
    #4 0x7f93a4e56ae1 in NS_ProcessNextEvent(nsIThread*, bool) xpcom/glue/nsThreadUtils.cpp:263
    #5 0x7f93a57733e1 in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:301
    #6 0x7f93a56e38d3 in MessageLoop::Run() ipc/chromium/src/base/message_loop.cc:226
    #7 0x7f93a4f779a3 in nsThread::ThreadFunc(void*) xpcom/threads/nsThread.cpp:258
    #8 0x7f93b1dd7407 in _pt_root nsprpub/pr/src/pthreads/ptthread.c:205
    #9 0x43bf60 in __asan::AsanThread::ThreadStart(unsigned long) _asan_rtl_
    #10 0x7f93b6367e99 in start_thread /build/buildd/eglibc-2.15/nptl/pthread_create.c:308
    #11 0x7f93b54763fc in ?? /build/buildd/eglibc-2.15/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:112
0x614000109790 is located 336 bytes inside of 392-byte region [0x614000109640,0x6140001097c8)
freed by thread T36 (MediaStreamGrph) here:
    #0 0x433c25 in __interceptor_free _asan_rtl_
    #1 0x7f93a888f5af in nsTArray_Impl<nsRefPtr<mozilla::MediaStream>, nsTArrayInfallibleAllocator>::RemoveElementsAt(unsigned int, unsigned int) content/media/MediaStreamGraph.h:291
previously allocated by thread T0 here:
    #0 0x433d85 in malloc _asan_rtl_
    #1 0x7f93af3f1408 in moz_xmalloc memory/mozalloc/mozalloc.cpp:52
Thread T36 (MediaStreamGrph) created by T0 here:
    #0 0x414c9e in __interceptor_pthread_create _asan_rtl_
    #1 0x7f93b1dd3378 in _PR_CreateThread nsprpub/pr/src/pthreads/ptthread.c:445
    #2 0x7f93b1dd2ec7 in PR_CreateThread nsprpub/pr/src/pthreads/ptthread.c:528
Shadow bytes around the buggy address:
  0x0c28800192a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c28800192b0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
  0x0c28800192c0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c28800192d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c28800192e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c28800192f0: fd fd[fd]fd fd fd fd fd fd fa fa fa fa fa fa fa
  0x0c2880019300: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c2880019310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2880019320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2880019330: 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa
  0x0c2880019340: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:     fa
  Heap right redzone:    fb
  Freed heap region:     fd
  Stack left redzone:    f1
  Stack mid redzone:     f2
  Stack right redzone:   f3
  Stack partial redzone: f4
  Stack after return:    f5
  Stack use after scope: f8
  Global redzone:        f9
  Global init order:     f6
  Poisoned by user:      f7
  ASan internal:         fe
==25265==ABORTING

The original report as published on Mozilla's Bugzilla, by Abhishek Arya. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A critical-severity memory corruption bug in Audio/Video. Mozilla made it public on 14 January 2014.

About Memory corruption

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Abhishek Arya

View all

130 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.