Skip to content
Disclosed report CVE-2012-0470

ASAN: Heap-buffer-overflow WRITE of size 1 at nsSVGFEDiffuseLightingElement::LightPixel

Atte Kettunen Follow

Originally disclosed on Mozilla

  • Fixed in 22 hours
  • Paid in 16 months
  • Disclosed after 22 hours

Created attachment 604258 Repro-file

==5860== ERROR: AddressSanitizer heap-buffer-overflow on address 0x7f23312cdda8 at pc 0x7f235665c341 bp 0x7fff1d8b5550 sp 0x7fff1d8b5548 WRITE of size 1 at 0x7f23312cdda8 thread T0 #0 0x7f235665c341 in nsSVGFEDiffuseLightingElement::LightPixel(float const*, float const*, unsigned int, unsigned char*) /home/attekett/src/content/svg/content/src/nsSVGFilters.cpp:5298 #1 0x7f235665ace9 in nsSVGFELightingElement::Filter(nsSVGFilterInstance*, nsTArray<nsSVGFE::Image const*, nsTArrayDefaultAllocator> const&, nsSVGFE::Image const*, nsIntRect const&) /home/attekett/src/content/svg/content/src/nsSVGFilters.cpp:5094 #2 0x7f23565acf04 in nsSVGFilterInstance::Render(gfxASurface**) /home/attekett/src/layout/svg/base/src/nsSVGFilterInstance.cpp:529 #3 0x7f23565a7a93 in nsSVGFilterFrame::FilterPaint(nsRenderingContext*, nsIFrame*, nsSVGFilterPaintCallback*, nsIntRect const*) /home/attekett/src/layout/svg/base/src/nsSVGFilterFrame.cpp:264 #4 0x7f23565df61f in nsSVGUtils::PaintFrameWithEffects(nsRenderingContext*, nsIntRect const*, nsIFrame*) /home/attekett/src/layout/svg/base/src/nsSVGUtils.cpp:1141 #5 0x7f23565a2f8e in nsSVGDisplayContainerFrame::PaintSVG(nsRenderingContext*, nsIntRect const*) /home/attekett/src/layout/svg/base/src/nsSVGContainerFrame.cpp:175 #6 0x7f23565ceb59 in nsSVGOuterSVGFrame::Paint(nsDisplayListBuilder const*, nsRenderingContext*, nsRect const&, nsPoint) /home/attekett/src/layout/svg/base/src/nsSVGOuterSVGFrame.cpp:672 #7 0x7f23565ce8bb in nsDisplaySVG::Paint(nsDisplayListBuilder*, nsRenderingContext*) /home/attekett/src/layout/svg/base/src/nsSVGOuterSVGFrame.cpp:566 #8 0x7f23556aa9de in mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*) /home/attekett/src/layout/base/FrameLayerBuilder.cpp:2250 #9 0x7f235747013b in mozilla::layers::BasicThebesLayer::PaintBuffer(gfxContext*, nsIntRegion const&, nsIntRegion const&, nsIntRegion const&, bool, void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:570 #10 0x7f23574696db in mozilla::layers::BasicShadowableThebesLayer::PaintBuffer(gfxContext*, nsIntRegion const&, nsIntRegion const&, nsIntRegion const&, bool, void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:2395 #11 0x7f23574627b5 in mozilla::layers::BasicThebesLayer::PaintThebes(gfxContext*, void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:770 #12 0x7f23574671fa in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:1951 #13 0x7f2357467356 in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:1967 #14 0x7f2357467356 in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:1967 #15 0x7f2357465af1 in mozilla::layers::BasicLayerManager::EndTransactionInternal(void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::LayerManager::EndTransactionFlags) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:1658 #16 0x7f235746db49 in mozilla::layers::BasicShadowLayerManager::EndTransaction(void ()(mozilla::layers::ThebesLayer, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::LayerManager::EndTransactionFlags) /home/attekett/src/gfx/layers/basic/BasicLayers.cpp:3398 #17 0x7f23557607f7 in nsLayoutUtils::PaintFrame(nsRenderingContext*, nsIFrame*, nsRegion const&, unsigned int, unsigned int) /home/attekett/src/layout/base/nsLayoutUtils.cpp:1852 #18 0x7f235579ccfd in PresShell::Paint(nsIView*, nsIWidget*, nsRegion const&, nsIntRegion const&, bool) /home/attekett/src/layout/base/nsPresShell.cpp:5409 #19 0x7f23560513e4 in nsViewManager::Refresh(nsView*, nsIWidget*, nsIntRegion const&, bool) /home/attekett/src/view/src/nsViewManager.cpp:376 #20 0x7f23560531e4 in nsViewManager::DispatchEvent(nsGUIEvent*, nsIView*, nsEventStatus*) /home/attekett/src/view/src/nsViewManager.cpp:813 #21 0x7f235604dd61 in HandleEvent /home/attekett/src/view/src/nsView.cpp:159 #22 0x7f2356d813fb in nsWindow::DispatchEvent(nsGUIEvent*, nsEventStatus&) /home/attekett/src/widget/gtk2/nsWindow.cpp:524 #23 0x7f2356d95a92 in expose_event_cb /home/attekett/src/widget/gtk2/nsWindow.cpp:5393 #24 0x7f2351dae578 in _gtk_marshal_BOOLEAN__BOXED /build/buildd/gtk+2.0-2.24.4/gtk/gtkmarshalers.c:90 0x7f23312cdda8 is located 0 bytes to the right of 40-byte region [0x7f23312cdd80,0x7f23312cdda8) allocated by thread T0 here: #0 0x40cf8c in posix_memalign ??:0 #1 0x7f23573f0dec in TryAllocAlignedBytes /home/attekett/src/gfx/thebes/gfxImageSurface.cpp:117 #2 0x7f23573f0a8a in gfxImageSurface::gfxImageSurface(nsIntSize const&, gfxASurface::gfxImageFormat) /home/attekett/src/gfx/thebes/gfxImageSurface.cpp:139 ==5860== ABORTING Stats: 56M malloced (83M for red zones) by 243696 calls Stats: 3M realloced by 15734 calls Stats: 33M freed by 132010 calls Stats: 0M really freed by 0 calls Stats: 176M (45077 full pages) mmaped in 44 calls mmaps by size class: 8:229362; 9:24573; 10:8190; 11:8188; 12:2048; 13:1024; 14:768; 15:256; 16:256; 17:64; 18:64; 19:8; 20:4; mallocs by size class: 8:207343; 9:20575; 10:6910; 11:5610; 12:1534; 13:763; 14:511; 15:145; 16:203; 17:34; 18:60; 19:5; 20:3; frees by size class: 8:110634; 9:11973; 10:4318; 11:2910; 12:920; 13:593; 14:367; 15:112; 16:138; 17:29; 18:11; 19:3; 20:2; rfrees by size class: Stats: malloc large: 102 small slow: 971 Shadow byte and word: 0x1fe466259bb5: fb 0x1fe466259bb0: 00 00 00 00 00 fb fb fb More shadow bytes: 0x1fe466259b90: 00 00 00 00 00 00 00 00 0x1fe466259b98: 00 fb fb fb fb fb fb fb 0x1fe466259ba0: fa fa fa fa fa fa fa fa 0x1fe466259ba8: fa fa fa fa fa fa fa fa =>0x1fe466259bb0: 00 00 00 00 00 fb fb fb 0x1fe466259bb8: fb fb fb fb fb fb fb fb 0x1fe466259bc0: fa fa fa fa fa fa fa fa 0x1fe466259bc8: fa fa fa fa fa fa fa fa 0x1fe466259bd0: 00 fb fb fb fb fb fb fb

The original report as published on Mozilla's Bugzilla, by Atte Kettunen. 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 security bug in SVG. Mozilla made it public on 9 March 2012 as CVE-2012-0470.

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

More by Atte Kettunen

View all

62 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.