Heap-use-after-free in nsOverflowContinuationTracker::Finish, with -moz-columns
Originally disclosed on Mozilla
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 2 months
Created attachment 682899 Testcase
Reproduces on trunk.
================================================================= ==3869== ERROR: AddressSanitizer: heap-use-after-free on address 0x7facf171c940 at pc 0x7fad10189afe bp 0x7fff43a32a90 sp 0x7fff43a32a88 READ of size 8 at 0x7facf171c940 thread T0 #0 0x7fad10189afd in nsFrameList::FirstChild() const src/layout/base/../generic/nsFrameList.h:214 #1 0x7fad10a06005 in nsOverflowContinuationTracker::Finish(nsIFrame*) src/layout/generic/nsContainerFrame.cpp:1719 #2 0x7fad109a7a57 in nsBlockReflowContext::ReflowBlock(nsRect const&, bool, nsCollapsingMargin&, int, bool, nsLineBox*, nsHTMLReflowState&, unsigned int&, nsBlockReflowState&) src/layout/generic/nsBlockReflowContext.cpp:306 #3 0x7fad10949e9d in nsBlockFrame::ReflowBlockFrame(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:3097 #4 0x7fad1093ebe9 in nsBlockFrame::ReflowLine(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:2476 #5 0x7fad1092a670 in nsBlockFrame::ReflowDirtyLines(nsBlockReflowState&) src/layout/generic/nsBlockFrame.cpp:2284 #6 0x7fad10918fe3 in nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsBlockFrame.cpp:1041 #7 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #8 0x7fad109e6ad3 in nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&, nsColumnSetFrame::ReflowConfig const&, bool, nsCollapsingMargin*, nsColumnSetFrame::ColumnBalanceData&) src/layout/generic/nsColumnSetFrame.cpp:649 #9 0x7fad109eeb11 in nsColumnSetFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsColumnSetFrame.cpp:1032 #10 0x7fad109a7400 in nsBlockReflowContext::ReflowBlock(nsRect const&, bool, nsCollapsingMargin&, int, bool, nsLineBox*, nsHTMLReflowState&, unsigned int&, nsBlockReflowState&) src/layout/generic/nsBlockReflowContext.cpp:268 #11 0x7fad10949e9d in nsBlockFrame::ReflowBlockFrame(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:3097 #12 0x7fad1093ebe9 in nsBlockFrame::ReflowLine(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:2476 #13 0x7fad10925cf7 in nsBlockFrame::ReflowDirtyLines(nsBlockReflowState&) src/layout/generic/nsBlockFrame.cpp:1996 #14 0x7fad10918fe3 in nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsBlockFrame.cpp:1041 #15 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #16 0x7fad109e6ad3 in nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&, nsColumnSetFrame::ReflowConfig const&, bool, nsCollapsingMargin*, nsColumnSetFrame::ColumnBalanceData&) src/layout/generic/nsColumnSetFrame.cpp:649 #17 0x7fad109eeb11 in nsColumnSetFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsColumnSetFrame.cpp:1032 #18 0x7fad109a7400 in nsBlockReflowContext::ReflowBlock(nsRect const&, bool, nsCollapsingMargin&, int, bool, nsLineBox*, nsHTMLReflowState&, unsigned int&, nsBlockReflowState&) src/layout/generic/nsBlockReflowContext.cpp:268 #19 0x7fad10949e9d in nsBlockFrame::ReflowBlockFrame(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:3097 #20 0x7fad1093ebe9 in nsBlockFrame::ReflowLine(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:2476 #21 0x7fad10925cf7 in nsBlockFrame::ReflowDirtyLines(nsBlockReflowState&) src/layout/generic/nsBlockFrame.cpp:1996 #22 0x7fad10918fe3 in nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsBlockFrame.cpp:1041 #23 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #24 0x7fad109e6ad3 in nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&, nsColumnSetFrame::ReflowConfig const&, bool, nsCollapsingMargin*, nsColumnSetFrame::ColumnBalanceData&) src/layout/generic/nsColumnSetFrame.cpp:649 #25 0x7fad109eeb11 in nsColumnSetFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsColumnSetFrame.cpp:1032 #26 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #27 0x7fad10bd7066 in nsCanvasFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsCanvasFrame.cpp:473 #28 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #29 0x7fad10b4e948 in nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState*, bool, bool, nsHTMLReflowMetrics*, bool) src/layout/generic/nsGfxScrollFrame.cpp:433 #30 0x7fad10b534a6 in nsHTMLScrollFrame::ReflowContents(ScrollReflowState*, nsHTMLReflowMetrics const&) src/layout/generic/nsGfxScrollFrame.cpp:533 #31 0x7fad10b57b40 in nsHTMLScrollFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsGfxScrollFrame.cpp:774 #32 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #33 0x7fad10f4692a in ViewportFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsViewportFrame.cpp:202 #34 0x7fad106799bb in PresShell::DoReflow(nsIFrame*, bool) src/layout/base/nsPresShell.cpp:7502 #35 0x7fad106a906d in PresShell::ProcessReflowCommands(bool) src/layout/base/nsPresShell.cpp:7643 #36 0x7fad106a7bbe in PresShell::FlushPendingNotifications(mozFlushType) src/layout/base/nsPresShell.cpp:3883 #37 0x7fad1074e155 in nsRefreshDriver::Notify(nsITimer*) src/layout/base/nsRefreshDriver.cpp:403 #38 0x7fad1cc44123 in nsTimerImpl::Fire() src/xpcom/threads/nsTimerImpl.cpp:485 #39 0x7fad1cc454c1 in nsTimerEvent::Run() src/xpcom/threads/nsTimerImpl.cpp:565 #40 0x7fad1cc081be in nsThread::ProcessNextEvent(bool, bool*) src/xpcom/threads/nsThread.cpp:627 #41 0x7fad1c87de0f in NS_ProcessNextEvent_P(nsIThread*, bool) src/objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:221 #42 0x7fad1afe3516 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) src/ipc/glue/MessagePump.cpp:82 #43 0x7fad1cef0cce in MessageLoop::RunInternal() src/ipc/chromium/src/base/message_loop.cc:215 #44 0x7fad1cef0b15 in MessageLoop::RunHandler() src/ipc/chromium/src/base/message_loop.cc:208 #45 0x7fad1cef09fb in MessageLoop::Run() src/ipc/chromium/src/base/message_loop.cc:182 #46 0x7fad1a3e84d4 in nsBaseAppShell::Run() src/widget/xpwidgets/nsBaseAppShell.cpp:163 #47 0x7fad18f4de12 in nsAppStartup::Run() src/toolkit/components/startup/nsAppStartup.cpp:290 #48 0x7fad0e437f24 in XREMain::XRE_mainRun() src/toolkit/xre/nsAppRunner.cpp:3823 #49 0x7fad0e43dbf9 in XREMain::XRE_main(int, char**, nsXREAppData const*) src/toolkit/xre/nsAppRunner.cpp:3890 #50 0x7fad0e440970 in XRE_main src/toolkit/xre/nsAppRunner.cpp:4084 #51 0x40c0c6 in do_main(int, char**) src/browser/app/nsBrowserApp.cpp:174 #52 0x409900 in main src/browser/app/nsBrowserApp.cpp:279 #53 0x7fad2e64e76c in ?? ??:0 0x7facf171c940 is located 0 bytes inside of 16-byte region [0x7facf171c940,0x7facf171c950) freed by thread T0 here: #0 0x4c3750 in __interceptor_free ??:? #1 0x7fad2c1dc405 in moz_free src/memory/mozalloc/mozalloc.cpp:48 #2 0x7fad10a0da58 in operator delete(void*) src/../../dist/include/mozilla/mozalloc.h:224 #3 0x7fad10a0cef3 in nsContainerFrame::StealFrame(nsPresContext*, nsIFrame*, bool) src/layout/generic/nsContainerFrame.cpp:1212 #4 0x7fad10984dac in nsBlockFrame::StealFrame(nsPresContext*, nsIFrame*, bool) src/layout/generic/nsBlockFrame.cpp:5538 #5 0x7fad10a0f51c in nsContainerFrame::DeleteNextInFlowChild(nsPresContext*, nsIFrame*, bool) src/layout/generic/nsContainerFrame.cpp:1359 #6 0x7fad10986c30 in nsBlockFrame::DeleteNextInFlowChild(nsPresContext*, nsIFrame*, bool) src/layout/generic/nsBlockFrame.cpp:5625 #7 0x7fad109a7ba2 in nsBlockReflowContext::ReflowBlock(nsRect const&, bool, nsCollapsingMargin&, int, bool, nsLineBox*, nsHTMLReflowState&, unsigned int&, nsBlockReflowState&) src/layout/generic/nsBlockReflowContext.cpp:307 #8 0x7fad10949e9d in nsBlockFrame::ReflowBlockFrame(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:3097 #9 0x7fad1093ebe9 in nsBlockFrame::ReflowLine(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:2476 #10 0x7fad10925cf7 in nsBlockFrame::ReflowDirtyLines(nsBlockReflowState&) src/layout/generic/nsBlockFrame.cpp:1996 #11 0x7fad10918fe3 in nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsBlockFrame.cpp:1041 #12 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #13 0x7fad109e6ad3 in nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&, nsColumnSetFrame::ReflowConfig const&, bool, nsCollapsingMargin*, nsColumnSetFrame::ColumnBalanceData&) src/layout/generic/nsColumnSetFrame.cpp:649 #14 0x7fad109eeb11 in nsColumnSetFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsColumnSetFrame.cpp:1032 previously allocated by thread T0 here: #0 0x4c3810 in malloc ??:? #1 0x7fad2c1dc541 in moz_xmalloc src/memory/mozalloc/mozalloc.cpp:54 #2 0x7fad10a0b40f in operator new(unsigned long) src/../../dist/include/mozilla/mozalloc.h:200 #3 0x7fad1094dbbe in nsBlockFrame::ReflowBlockFrame(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:3266 #4 0x7fad1093ebe9 in nsBlockFrame::ReflowLine(nsBlockReflowState&, nsLineList_iterator, bool*) src/layout/generic/nsBlockFrame.cpp:2476 #5 0x7fad1092a670 in nsBlockFrame::ReflowDirtyLines(nsBlockReflowState&) src/layout/generic/nsBlockFrame.cpp:2284 #6 0x7fad10918fe3 in nsBlockFrame::Reflow(nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&) src/layout/generic/nsBlockFrame.cpp:1041 #7 0x7fad10a0566c in nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, nsHTMLReflowMetrics&, nsHTMLReflowState const&, int, int, unsigned int, unsigned int&, nsOverflowContinuationTracker*) src/layout/generic/nsContainerFrame.cpp:952 #8 0x7fad109e6ad3 in nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics&, nsHTMLReflowState const&, unsigned int&, nsColumnSetFrame::ReflowConfig const&, bool, nsCollapsingMargin*, nsColumnSetFrame::ColumnBalanceData&) src/layout/generic/nsColumnSetFrame.cpp:649 Shadow byte and word: 0x1ff59e2e3928: fd 0x1ff59e2e3928: fd fd fd fd fd fd fd fd More shadow bytes: 0x1ff59e2e3908: 00 00 00 00 00 fb fb fb 0x1ff59e2e3910: fa fa fa fa fa fa fa fa 0x1ff59e2e3918: fd fd fd fd fd fd fd fd 0x1ff59e2e3920: fa fa fa fa fa fa fa fa =>0x1ff59e2e3928: fd fd fd fd fd fd fd fd 0x1ff59e2e3930: fa fa fa fa fa fa fa fa 0x1ff59e2e3938: 00 00 00 00 00 00 00 00 0x1ff59e2e3940: fa fa fa fa fa fa fa fa 0x1ff59e2e3948: fd fd fd fd fd fd fd fd Stats: 252M malloced (231M for red zones) by 340183 calls Stats: 46M realloced by 17894 calls Stats: 221M freed by 224349 calls Stats: 186M really freed by 177540 calls Stats: 235M (60247 full pages) mmaped in 447 calls mmaps by size class: 7:102375; 8:45034; 9:13299; 10:5110; 11:8670; 12:1280; 13:960; 14:544; 15:224; 16:784; 17:460; 18:36; 19:35; 20:21; mallocs by size class: 7:196151; 8:83366; 9:22929; 10:9146; 11:19278; 12:2496; 13:1908; 14:1548; 15:413; 16:1467; 17:1349; 18:70; 19:40; 20:22; frees by size class: 7:122554; 8:54394; 9:16555; 10:5987; 11:17304; 12:1710; 13:1495; 14:1365; 15:281; 16:1256; 17:1334; 18:57; 19:38; 20:19; rfrees by size class: 7:99289; 8:43459; 9:10392; 10:4360; 11:13903; 12:1343; 13:996; 14:1255; 15:215; 16:939; 17:1297; 18:49; 19:37; 20:6; Stats: malloc large: 3361 small slow: 4876 ==3869== ABORTING
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 Layout. Mozilla made it public on 27 January 2013 as CVE-2013-0780.
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.