Skip to content
Memory corruption Disclosed report Advanced CVE-2017-5377

SEGV in sk_memset32 from SkLinearGradient::LinearGradientContext::shade4_dx_clamp

Atte Kettunen Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 32 days
  • Paid in 37 days
  • Disclosed after 32 days
Text
Created attachment 8796860
firefox-SEGV-6f9-6f9-6f9-6f4-1ba0-min.html

Tested on:

OS: Ubuntu 16.04.1 LTS

Firefox: ASAN-build moz_source_stamp: f713114b8c8d352b668b3e8052bc51ece4df34e0

prefs.js from https://github.com/MozillaSecurity/fuzzdata/blob/master/settings/firefox/prefs.js

ASAN-trace:

$./firefox firefox-SEGV-6f9-6f9-6f9-6f4-1ba0-min.html 
ATTENTION: default value of option force_s3tc_enable overridden by environment.
ATTENTION: default value of option force_s3tc_enable overridden by environment.
ASAN:DEADLYSIGNAL
=================================================================
==30297==ERROR: AddressSanitizer: SEGV on unknown address 0x7f07ea7d9628 (pc 0x7f0a1fac92aa bp 0x7fff76db3950 sp 0x7fff76db38c0 T0)
    #0 0x7f0a1fac92a9 in sk_memset32 /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkUtils.h:31:19
    #1 0x7f0a1fac92a9 in fill<false> /home/worker/workspace/build/src/gfx/skia/skia/src/effects/gradients/SkLinearGradient.cpp:538
    #2 0x7f0a1fac92a9 in void SkLinearGradient::LinearGradientContext::shade4_dx_clamp<false, false>(unsigned int*, int, float, float, float, float const*) /home/worker/workspace/build/src/gfx/skia/skia/src/effects/gradients/SkLinearGradient.cpp:651
    #3 0x7f0a1fabc2a4 in SkLinearGradient::LinearGradientContext::shade4_clamp(int, int, unsigned int*, int) /home/worker/workspace/build/src/gfx/skia/skia/src/effects/gradients/SkLinearGradient.cpp:750:13
    #4 0x7f0a1fabbd6a in SkLinearGradient::LinearGradientContext::shadeSpan(int, int, unsigned int*, int) /home/worker/workspace/build/src/gfx/skia/skia/src/effects/gradients/SkLinearGradient.cpp:280:9
    #5 0x7f0a1f8152d4 in SkARGB32_Shader_Blitter::blitRect(int, int, int, int) /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkBlitter_ARGB32.cpp:435:17
    #6 0x7f0a1f86643f in antifilldot8(int, int, int, int, SkBlitter*, bool) /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkScan_Antihair.cpp:678:17
    #7 0x7f0a1f864c44 in antifillrect /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkScan_Antihair.cpp:692:5
    #8 0x7f0a1f864c44 in antifillrect /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkScan_Antihair.cpp:765
    #9 0x7f0a1f864c44 in SkScan::AntiFillRect(SkRect const&, SkRegion const*, SkBlitter*) /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkScan_Antihair.cpp:788
    #10 0x7f0a1f86508f in SkScan::AntiFillRect(SkRect const&, SkRasterClip const&, SkBlitter*) /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkScan_Antihair.cpp:807:9
    #11 0x7f0a1fd03658 in SkDraw::drawRect(SkRect const&, SkPaint const&, SkMatrix const*, SkRect const*) const /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkDraw.cpp:877:21
    #12 0x7f0a1fa48072 in SkCanvas::onDrawRect(SkRect const&, SkPaint const&) /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkCanvas.cpp:2109:9
    #13 0x7f0a18029068 in mozilla::gfx::DrawTargetSkia::FillRect(mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits, float> const&, mozilla::gfx::Pattern const&, mozilla::gfx::DrawOptions const&) /home/worker/workspace/build/src/gfx/2d/DrawTargetSkia.cpp:668:3
    #14 0x7f0a186a3a4e in gfxContext::FillAzure(mozilla::gfx::Pattern const&, float) /home/worker/workspace/build/src/gfx/thebes/gfxContext.cpp:1069:5
    #15 0x7f0a186a3428 in gfxContext::Fill(mozilla::gfx::Pattern const&) /home/worker/workspace/build/src/gfx/thebes/gfxContext.cpp:200:3
    #16 0x7f0a18698ab3 in gfxContext::Fill() /home/worker/workspace/build/src/gfx/thebes/gfxContext.cpp:192:3
    #17 0x7f0a1d1514d5 in nsCSSRendering::PaintGradient(nsPresContext*, nsRenderingContext&, nsStyleGradient*, nsRect const&, nsRect const&, nsRect const&, nsSize const&, mozilla::gfx::IntRectTyped<mozilla::CSSPixel> const&, nsSize const&) /home/worker/workspace/build/src/layout/base/nsCSSRendering.cpp:3026:7
    #18 0x7f0a1d167c3b in nsImageRenderer::Draw(nsPresContext*, nsRenderingContext&, nsRect const&, nsRect const&, nsRect const&, nsPoint const&, nsSize const&, mozilla::gfx::IntRectTyped<mozilla::CSSPixel> const&) /home/worker/workspace/build/src/layout/base/nsCSSRendering.cpp:5472:7
    #19 0x7f0a1d145f7a in DrawBackground /home/worker/workspace/build/src/layout/base/nsCSSRendering.cpp:5574:10
.
.
.
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/worker/workspace/build/src/gfx/skia/skia/src/core/SkUtils.h:31:19 in sk_memset32
==30297==ABORTING

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 critical-severity memory corruption bug in Graphics. Mozilla made it public on 2 November 2016 as CVE-2017-5377.

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 Atte Kettunen

View all

62 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.