Heap-use-after-free in nsAnimationManager::BuildAnimations
Originally disclosed on Mozilla
- Fixed in 33 days
- Paid in 45 days
- Disclosed after 33 days
Created attachment 775067 Testcase
Need to install fuzzPriv extension [https://www.squarefree.com/extensions/domFuzzLite3.xpi]. Usually reproduces in one try, but do try with reload if it does not.
==1210==ERROR: AddressSanitizer: heap-use-after-free on address 0x61900d449420 at pc 0x7f183c1696ee bp 0x7fff6f500cd0 sp 0x7fff6f500cc8 READ of size 8 at 0x61900d449420 thread T0 #0 0x7f183c1696ed in nsTArray_base<nsTArrayInfallibleAllocator, nsTArray_CopyElements<nsISupports*> >::Length() const ../../../../dist/include/nsTArray.h:371 #1 0x7f183c1695d1 in nsCOMArray_base::Count() const ../../../../dist/include/nsCOMArray.h:95 #2 0x7f18448ee188 in mozilla::css::GroupRule::StyleRuleCount() const ../../dist/include/mozilla/css/GroupRule.h:54 #3 0x7f18448e8895 in nsAnimationManager::BuildAnimations(nsStyleContext*, nsTArray<ElementAnimation>&) layout/style/nsAnimationManager.cpp:783 #4 0x7f18448e4f78 in nsAnimationManager::CheckAnimationRule(nsStyleContext*, mozilla::dom::Element*) layout/style/nsAnimationManager.cpp:568 #5 0x7f1844e8b9ba in nsStyleSet::GetContext(nsStyleContext*, nsRuleNode*, nsRuleNode*, nsIAtom*, nsCSSPseudoElements::Type, mozilla::dom::Element*, unsigned int) layout/style/nsStyleSet.cpp:833 #6 0x7f1844e9496a in nsStyleSet::ResolveStyleFor(mozilla::dom::Element*, nsStyleContext*, TreeMatchContext&) layout/style/nsStyleSet.cpp:1205 #7 0x7f1843daf486 in nsFrameManager::ReResolveStyleContext(nsPresContext*, nsIFrame*, nsIContent*, nsStyleChangeList*, nsChangeHint, nsChangeHint, nsRestyleHint, mozilla::css::RestyleTracker&, nsFrameManager::DesiredA11yNotifications, nsTArray<nsIContent*>&, TreeMatchContext&) layout/base/nsFrameManager.cpp:1256 #8 0x7f1843db79d9 in nsFrameManager::ComputeStyleChangeFor(nsIFrame*, nsStyleChangeList*, nsChangeHint, mozilla::css::RestyleTracker&, bool) layout/base/nsFrameManager.cpp:1695 #9 0x7f1843a81991 in nsCSSFrameConstructor::RestyleElement(mozilla::dom::Element*, nsIFrame*, nsChangeHint, mozilla::css::RestyleTracker&, bool) layout/base/nsCSSFrameConstructor.cpp:8340 #10 0x7f18439d12d2 in mozilla::css::RestyleTracker::ProcessOneRestyle(mozilla::dom::Element*, nsRestyleHint, nsChangeHint) layout/base/RestyleTracker.cpp:122 #11 0x7f18439ccf11 in mozilla::css::RestyleTracker::DoProcessRestyles() layout/base/RestyleTracker.cpp:209 #12 0x7f1843aa6a06 in mozilla::css::RestyleTracker::ProcessRestyles() layout/base/RestyleTracker.h:217 #13 0x7f1843aa6397 in nsCSSFrameConstructor::ProcessPendingRestyles() layout/base/nsCSSFrameConstructor.cpp:12071 #14 0x7f1843f384cc in PresShell::FlushPendingNotifications(mozilla::ChangesToFlush) layout/base/nsPresShell.cpp:3858 #15 0x7f1843f37087 in PresShell::FlushPendingNotifications(mozFlushType) layout/base/nsPresShell.cpp:3743 #16 0x7f1845a8456e in nsDocument::FlushPendingNotifications(mozFlushType) content/base/src/nsDocument.cpp:7085 #17 0x7f184b9d1391 in nsDocLoader::DocLoaderIsEmpty(bool) uriloader/base/nsDocLoader.cpp:709 #18 0x7f184b9d5b2b in nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, tag_nsresult) uriloader/base/nsDocLoader.cpp:639 #19 0x7f184b9d71ea in non-virtual thunk to nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, tag_nsresult) uriloader/base/nsDocLoader.cpp:643 #20 0x7f1841e32480 in nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, tag_nsresult) netwerk/base/src/nsLoadGroup.cpp:684 #21 0x7f1845a98575 in nsDocument::DoUnblockOnload() content/base/src/nsDocument.cpp:7965 #22 0x7f1845a97fcb in nsDocument::UnblockOnload(bool) content/base/src/nsDocument.cpp:7893 #23 0x7f1845a3b713 in nsDocument::DispatchContentLoadedEvents() content/base/src/nsDocument.cpp:4680 #24 0x7f1845b52b1a in nsRunnableMethodImpl<void (nsDocument::)(), true>::Run() ../../../dist/include/nsThreadUtils.h:350 #25 0x7f18416e2feb in nsThread::ProcessNextEvent(bool, bool) xpcom/threads/nsThread.cpp:621 #26 0x7f18412fdd22 in NS_ProcessNextEvent(nsIThread*, bool) objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:238 #27 0x7f183cffea89 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:81 #28 0x7f1841aa3bfb in MessageLoop::RunInternal() ipc/chromium/src/base/message_loop.cc:219 #29 0x7f1841aa3a4e in MessageLoop::RunHandler() ipc/chromium/src/base/message_loop.cc:212 #30 0x7f1841aa3939 in MessageLoop::Run() ipc/chromium/src/base/message_loop.cc:186 #31 0x7f184d36ce1e in nsBaseAppShell::Run() widget/xpwidgets/nsBaseAppShell.cpp:163 #32 0x7f184bf10ae0 in nsAppStartup::Run() toolkit/components/startup/nsAppStartup.cpp:269 #33 0x7f183c115aeb in XREMain::XRE_mainRun() toolkit/xre/nsAppRunner.cpp:3853 #34 0x7f183c11a89d in XREMain::XRE_main(int, char**, nsXREAppData const*) toolkit/xre/nsAppRunner.cpp:3921 #35 0x7f183c11d4d5 in XRE_main toolkit/xre/nsAppRunner.cpp:4123 #36 0x42a0d7 in do_main(int, char**, nsIFile*) browser/app/nsBrowserApp.cpp:272 #37 0x4270e1 in main browser/app/nsBrowserApp.cpp:632 #38 0x7f18602ad76c in #39 0x426854 in _start 0x61900d449420 is located 32 bytes inside of 72-byte region [0x61900d449400,0x61900d449448) freed by thread T0 here: #0 0x41a5f2 in __interceptor_free #1 0x7f185e2096de in moz_free memory/mozalloc/mozalloc.cpp:48 #2 0x7f1844aec3b9 in operator delete(void*) ../../dist/include/mozilla/mozalloc.h:225 #3 0x7f1844aec3b9 in nsCSSKeyframesRule::~nsCSSKeyframesRule() layout/style/nsCSSRules.cpp:2454 #4 0x7f1844ab7122 in mozilla::css::GroupRule::DeleteCycleCollectable() layout/style/nsCSSRules.cpp:568 #5 0x7f1844b14928 in mozilla::css::GroupRule::cycleCollection::DeleteCycleCollectableImpl(void*) ../../dist/include/mozilla/css/GroupRule.h:39 #6 0x7f18417aad7f in SnowWhiteKiller::~SnowWhiteKiller() xpcom/base/nsCycleCollector.cpp:2173 #7 0x7f184176837e in SnowWhiteKiller::~SnowWhiteKiller() xpcom/base/nsCycleCollector.cpp:2168 #8 0x7f184175c525 in nsCycleCollector::FreeSnowWhite(bool) xpcom/base/nsCycleCollector.cpp:2280 #9 0x7f184175a984 in nsCycleCollectorRunner::Collect(ccType, nsCycleCollectorResults*, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:1171 #10 0x7f1841773500 in nsCycleCollector::Collect(ccType, nsCycleCollectorResults*, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:2883 #11 0x7f184177a715 in nsCycleCollector_collect(bool, nsCycleCollectorResults*, nsICycleCollectorListener*) xpcom/base/nsCycleCollector.cpp:3312 #12 0x7f1848a0fae2 in nsJSContext::CycleCollectNow(nsICycleCollectorListener*, int, bool) dom/base/nsJSEnvironment.cpp:2566 #13 0x7f184873af46 in nsDOMWindowUtils::CycleCollect(nsICycleCollectorListener*, int) dom/base/nsDOMWindowUtils.cpp:1203 #14 0x7f1841838bbb in NS_InvokeByIndex xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:162 #15 0x7f184b4caa70 in CallMethodHelper::Invoke() js/xpconnect/src/XPCWrappedNative.cpp:2795 #16 0x7f184b4caa70 in CallMethodHelper::Call() js/xpconnect/src/XPCWrappedNative.cpp:2133 #17 0x7f184b4caa70 in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) js/xpconnect/src/XPCWrappedNative.cpp:2099 #18 0x7f184b5231df in XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) js/xpconnect/src/XPCWrappedNativeJSOps.cpp:1315 #19 0x7f1854cc4acc in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:225 #20 0x7f1854cc4acc in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:478 #21 0x7f1854ca3c90 in Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:2503 #22 0x7f1854c525d6 in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:435 #23 0x7f1854cc5157 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:497 #24 0x7f1854cc9013 in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:528 #25 0x7f1855e25d13 in js::DirectProxyHandler::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jsproxy.cpp:451 #26 0x7f185617e722 in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jswrapper.cpp:446 #27 0x7f1855e9400e in js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) js/src/jsproxy.cpp:2633 #28 0x7f1855eb16ca in proxy_Call(JSContext*, unsigned int, JS::Value*) js/src/jsproxy.cpp:3205 #29 0x7f1854cc43dc in js::CallJSNative(JSContext*, int ()(JSContext, unsigned int, JS::Value*), JS::CallArgs const&) js/src/jscntxtinlines.h:225 #30 0x7f1854cc43dc in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:471 #31 0x7f1854ca3c90 in Interpret(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:2503 #32 0x7f1854c525d6 in js::RunScript(JSContext*, js::RunState&) js/src/vm/Interpreter.cpp:435 #33 0x7f1854cc5157 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) js/src/vm/Interpreter.cpp:497 #34 0x7f1854cc9013 in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::MutableHandleJS::Value) js/src/vm/Interpreter.cpp:528 previously allocated by thread T0 here: #0 0x41a6d2 in malloc #1 0x7f185e209825 in moz_xmalloc memory/mozalloc/mozalloc.cpp:54 #2 0x7f18449ee3f3 in operator new(unsigned long) ../../dist/include/mozilla/mozalloc.h:201 #3 0x7f18449ee3f3 in (anonymous namespace)::CSSParserImpl::ParseKeyframesRule(void ()(mozilla::css::Rule, void*), void*) layout/style/nsCSSParser.cpp:2624 #4 0x7f18449e59ef in (anonymous namespace)::CSSParserImpl::ParseAtRule(void ()(mozilla::css::Rule, void*), void*, bool) layout/style/nsCSSParser.cpp:1673 #5 0x7f184492dd6e in (anonymous namespace)::CSSParserImpl::ParseSheet(nsAString_internal const&, nsIURI*, nsIURI*, nsIPrincipal*, unsigned int, bool) layout/style/nsCSSParser.cpp:988 #6 0x7f184492cdcf in nsCSSParser::ParseSheet(nsAString_internal const&, nsIURI*, nsIURI*, nsIPrincipal*, unsigned int, bool) layout/style/nsCSSParser.cpp:10870 #7 0x7f184485ef6c in mozilla::css::Loader::ParseSheet(nsAString_internal const&, mozilla::css::SheetLoadData*, bool&) layout/style/Loader.cpp:1628 #8 0x7f184485cc97 in mozilla::css::SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader*, nsISupports*, tag_nsresult, nsAString_internal const&) layout/style/Loader.cpp:938 #9 0x7f184485f8fb in non-virtual thunk to mozilla::css::SheetLoadData::OnStreamComplete(nsIUnicharStreamLoader*, nsISupports*, tag_nsresult, nsAString_internal const&) layout/style/Loader.cpp:941 #10 0x7f184203714e in nsUnicharStreamLoader::OnStopRequest(nsIRequest*, nsISupports*, tag_nsresult) netwerk/base/src/nsUnicharStreamLoader.cpp:99 #11 0x7f1841d57c17 in nsBaseChannel::OnStopRequest(nsIRequest*, nsISupports*, tag_nsresult) netwerk/base/src/nsBaseChannel.cpp:737 #12 0x7f1841d5810a in non-virtual thunk to nsBaseChannel::OnStopRequest(nsIRequest*, nsISupports*, tag_nsresult) netwerk/base/src/nsBaseChannel.cpp:752 #13 0x7f1841e1e61c in nsInputStreamPump::OnStateStop() netwerk/base/src/nsInputStreamPump.cpp:623 #14 0x7f1841e1ae7c in nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) netwerk/base/src/nsInputStreamPump.cpp:395 #15 0x7f1841e1eaa2 in non-virtual thunk to nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) netwerk/base/src/nsInputStreamPump.cpp:439 #16 0x7f18415bfcdc in nsInputStreamReadyEvent::Run() xpcom/io/nsStreamUtils.cpp:82 #17 0x7f18416e2feb in nsThread::ProcessNextEvent(bool, bool*) xpcom/threads/nsThread.cpp:621 #18 0x7f18412fdd22 in NS_ProcessNextEvent(nsIThread*, bool) objdir-ff-asan-sym/xpcom/build/nsThreadUtils.cpp:238 #19 0x7f183cffea89 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) ipc/glue/MessagePump.cpp:81 #20 0x7f1841aa3bfb in MessageLoop::RunInternal() ipc/chromium/src/base/message_loop.cc:219 #21 0x7f1841aa3a4e in MessageLoop::RunHandler() ipc/chromium/src/base/message_loop.cc:212 #22 0x7f1841aa3939 in MessageLoop::Run() ipc/chromium/src/base/message_loop.cc:186 #23 0x7f184d36ce1e in nsBaseAppShell::Run() widget/xpwidgets/nsBaseAppShell.cpp:163 #24 0x7f184bf10ae0 in nsAppStartup::Run() toolkit/components/startup/nsAppStartup.cpp:269 #25 0x7f183c115aeb in XREMain::XRE_mainRun() toolkit/xre/nsAppRunner.cpp:3853 #26 0x7f183c11a89d in XREMain::XRE_main(int, char**, nsXREAppData const*) toolkit/xre/nsAppRunner.cpp:3921 #27 0x7f183c11d4d5 in XRE_main toolkit/xre/nsAppRunner.cpp:4123 #28 0x42a0d7 in do_main(int, char**, nsIFile*) browser/app/nsBrowserApp.cpp:272 #29 0x4270e1 in main browser/app/nsBrowserApp.cpp:632 #30 0x7f18602ad76c in Shadow bytes around the buggy address: 0x0c3281a81230: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a81240: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a81250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a81260: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a81270: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c3281a81280: fd fd fd fd[fd]fd fd fd fd fa fa fa fa fa fa fa 0x0c3281a81290: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a812a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a812b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a812c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c3281a812d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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 righ 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 ==1210==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 15 August 2013 as CVE-2013-1722.
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.