Skip to content
Disclosed report

OOB write relating to mozilla::gfx::AlphaBoxBlur::Blur

Abhishek Arya Follow

Originally disclosed on Mozilla

  • Fixed in 2 days
  • Paid in 49 days
  • Disclosed after 2 days
Text
Created attachment 685471
Testcase

Reproduces on trunk, run testcase and wait for 15-20 sec for animation to run.
ASAN isn't able to unwind the stack inside the system library, so someone needs to use valgrind to get the full crash stack.

=================================================================
==32251== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7fa5178f404f at pc 0x4c00c5 bp 0x7fff072c0540 sp 0x7fff072bfd08
WRITE of size 1 at 0x7fa5178f404f thread T0
    #0 0x4c00c4 in memcpy
    #1 0x7fa5503dec2f in ?? /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
0x7fa5178f404f is located 15 bytes inside of 145414803-byte region [0x7fa5178f4040,0x7fa5203a1ad3)
freed by thread T0 here:
    #0 0x4c37d0 in __interceptor_free
    #1 0x7fa57026d405 in moz_free /usr/local/google/home/aarya/firefox/src/memory/mozalloc/mozalloc.cpp:48
    #2 0x7fa5652a6ffe in operator delete[](void*) /usr/local/google/home/aarya/firefox/src/../../dist/include/mozilla/mozalloc.h:236
    #3 0x7fa5652a6ffe in mozilla::gfx::AlphaBoxBlur::Blur() /usr/local/google/home/aarya/firefox/src/gfx/2d/Blur.cpp:523
    #4 0x7fa5611dfefc in gfxAlphaBoxBlur::Paint(gfxContext*, gfxPoint const&) /usr/local/google/home/aarya/firefox/src/gfx/thebes/gfxBlur.cpp:86
    #5 0x7fa5542e0453 in nsContextBoxBlur::DoPaint() /usr/local/google/home/aarya/firefox/src/layout/base/nsCSSRendering.cpp:4821
    #6 0x7fa5542db0e6 in nsCSSRendering::PaintBoxShadowOuter(nsPresContext*, nsRenderingContext&, nsIFrame*, nsRect const&, nsRect const&) /usr/local/google/home/aarya/firefox/src/layout/base/nsCSSRendering.cpp:1345
    #7 0x7fa5544382e0 in nsDisplayBoxShadowOuter::Paint(nsDisplayListBuilder*, nsRenderingContext*) /usr/local/google/home/aarya/firefox/src/layout/base/nsDisplayList.cpp:2370
    #8 0x7fa554118506 in mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*) /usr/local/google/home/aarya/firefox/src/layout/base/FrameLayerBuilder.cpp:3274
    #9 0x7fa561591d3f in mozilla::layers::BasicThebesLayer::PaintBuffer(gfxContext*, nsIntRegion const&, nsIntRegion const&, nsIntRegion const&, bool, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicThebesLayer.h:94
    #10 0x7fa5615913ee in mozilla::layers::BasicShadowableThebesLayer::PaintBuffer(gfxContext*, nsIntRegion const&, nsIntRegion const&, nsIntRegion const&, bool, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicThebesLayer.cpp:402
    #11 0x7fa561589fab in mozilla::layers::BasicThebesLayer::PaintThebes(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicThebesLayer.cpp:189
    #12 0x7fa56158ea4a in mozilla::layers::BasicShadowableThebesLayer::PaintThebes(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicThebesLayer.cpp:303
    #13 0x7fa56158f433 in non-virtual thunk to mozilla::layers::BasicShadowableThebesLayer::PaintThebes(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicThebesLayer.cpp:314
    #14 0x7fa5615187c5 in mozilla::layers::BasicLayerManager::PaintSelfOrChildren(mozilla::layers::PaintContext&, gfxContext*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicLayerManager.cpp:827
    #15 0x7fa561515c05 in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*, mozilla::layers::ReadbackProcessor*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicLayerManager.cpp:936
previously allocated by thread T0 here:
    #0 0x4c3890 in malloc
    #1 0x7fa57026d541 in moz_xmalloc /usr/local/google/home/aarya/firefox/src/memory/mozalloc/mozalloc.cpp:54
    #2 0x7fa5652a0cb3 in operator new[](unsigned long) /usr/local/google/home/aarya/firefox/src/../../dist/include/mozilla/mozalloc.h:212
    #3 0x7fa5652a0cb3 in mozilla::gfx::AlphaBoxBlur::AlphaBoxBlur(mozilla::gfx::Rect const&, mozilla::gfx::IntSize const&, mozilla::gfx::IntSize const&, mozilla::gfx::Rect const*, mozilla::gfx::Rect const*) /usr/local/google/home/aarya/firefox/src/gfx/2d/Blur.cpp:388
    #4 0x7fa5611de818 in gfxAlphaBoxBlur::Init(gfxRect const&, nsIntSize const&, nsIntSize const&, gfxRect const*, gfxRect const*) /usr/local/google/home/aarya/firefox/src/gfx/thebes/gfxBlur.cpp:52
    #5 0x7fa5542dfd2e in nsContextBoxBlur::Init(nsRect const&, int, int, int, gfxContext*, nsRect const&, gfxRect const*, unsigned int) /usr/local/google/home/aarya/firefox/src/layout/base/nsCSSRendering.cpp:4794
    #6 0x7fa5542d9eed in nsCSSRendering::PaintBoxShadowOuter(nsPresContext*, nsRenderingContext&, nsIFrame*, nsRect const&, nsRect const&) /usr/local/google/home/aarya/firefox/src/layout/base/nsCSSRendering.cpp:1269
    #7 0x7fa5544382e0 in nsDisplayBoxShadowOuter::Paint(nsDisplayListBuilder*, nsRenderingContext*) /usr/local/google/home/aarya/firefox/src/layout/base/nsDisplayList.cpp:2370
    #8 0x7fa554118506 in mozilla::FrameLayerBuilder::DrawThebesLayer(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*) /usr/local/google/home/aarya/firefox/src/layout/base/FrameLayerBuilder.cpp:3274
    #9 0x7fa561591d3f in mozilla::layers::BasicThebesLayer::PaintBuffer(gfxContext*, nsIntRegion const&, nsIntRegion const&, nsIntRegion const&, bool, void (*)(mozilla::layers::ThebesLayer*, gfxContext*, nsIntRegion const&, nsIntRegion const&, void*), void*) /usr/local/google/home/aarya/firefox/src/gfx/layers/basic/BasicThebesLayer.h:94
Shadow byte and word:
  0x1ff4a2f1e809: fa
  0x1ff4a2f1e808: fa fa fa fa fa fa fa fa
More shadow bytes:
  0x1ff4a2f1e7e8: fa fa fa fa fa fa fa fa
  0x1ff4a2f1e7f0: fa fa fa fa fa fa fa fa
  0x1ff4a2f1e7f8: fa fa fa fa fa fa fa fa
  0x1ff4a2f1e800: fa fa fa fa fa fa fa fa
=>0x1ff4a2f1e808: fa fa fa fa fa fa fa fa
  0x1ff4a2f1e810: fa fa fa fa fa fa fa fa
  0x1ff4a2f1e818: fa fa fa fa fa fa fa fa
  0x1ff4a2f1e820: fa fa fa fa fa fa fa fa
  0x1ff4a2f1e828: fa fa fa fa fa fa fa fa
Stats: 585M malloced (355M for red zones) by 346309 calls
Stats: 38M realloced by 22393 calls
Stats: 422M freed by 218373 calls
Stats: 421M really freed by 216578 calls
Stats: 703M (180045 full pages) mmaped in 440 calls
  mmaps   by size class: 7:147420; 8:40940; 9:15345; 10:6132; 11:6120; 12:2304; 13:1024; 14:704; 15:192; 16:576; 17:452; 18:30; 19:37; 20:22; 21:1; 23:1; 24:1; 26:1; 29:2;
  mallocs by size class: 7:229244; 8:57275; 9:27694; 10:10274; 11:11194; 12:3648; 13:2000; 14:2047; 15:325; 16:990; 17:1493; 18:51; 19:42; 20:26; 21:1; 23:1; 24:1; 26:1; 29:2;
  frees   by size class: 7:143922; 8:28027; 9:21238; 10:6961; 11:9083; 12:2733; 13:1795; 14:1867; 15:218; 16:947; 17:1476; 18:38; 19:40; 20:23; 21:1; 23:1; 24:1; 26:1; 29:1;
  rfrees  by size class: 7:142502; 8:27785; 9:21214; 10:6910; 11:9071; 12:2724; 13:1776; 14:1867; 15:218; 16:933; 17:1472; 18:38; 19:40; 20:23; 21:1; 23:1; 24:1; 26:1; 29:1;
Stats: malloc large: 2933 small slow: 4833
==32251== 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 high-severity security bug in Graphics. Mozilla made it public on 29 November 2012.

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

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

Same bug class and techniques, clearest first.