New issue
Advanced search Search tips

Issue 724991 link

Starred by 1 user

Issue metadata

Status: Verified
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Use-of-uninitialized-value in sse41::blit_row_s32a_opaque

Project Member Reported by ClusterFuzz, May 22 2017

Issue description

Detailed report: https://clusterfuzz.com/testcase?key=5817101393854464

Fuzzer: marty_html_twiddler
Job Type: linux_msan_chrome
Platform Id: linux

Crash Type: Use-of-uninitialized-value
Crash Address: 
Crash State:
  sse41::blit_row_s32a_opaque
  SkARGB32_Shader_Blitter::blitRect
  SkScan::FillIRect
  
Sanitizer: memory (MSAN)

Recommended Security Severity: Medium

Regressed: https://clusterfuzz.com/revisions?job=linux_msan_chrome&range=414545:414653

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=5817101393854464


Issue filed automatically.

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Project Member

Comment 1 by sheriffbot@chromium.org, May 22 2017

Labels: M-59
Project Member

Comment 2 by sheriffbot@chromium.org, May 22 2017

Labels: Pri-1

Comment 3 by kenrb@chromium.org, May 25 2017

Cc: reed@chromium.org mtklein@chromium.org
Components: Internals>Skia
Can someone on the Skia team please help triage this?
Status: WontFix (was: Untriaged)
Gladly.  The failing assert is __msan_check_mem_is_initialized() at the top of that Skia function.  It's telling us that Chrome's calling into it with uninitialized bytes.  sse41::blit_row_s32a_opaque() works perfectly fine with uninitialized inputs, but we got really tired of Chrome filing bugs on us related to MSAN in this function, so we added that __msan_check_mem_is_initialized() at the top to remind us it's Chrome's problem, not a bug in this function.

Comment 5 by kenrb@chromium.org, May 26 2017

Cc: -reed@chromium.org
Components: -Internals>Skia
Status: Untriaged (was: WontFix)
Thanks for the explanation.

I think that means this bug should remain open but needs a Blink or cc/ owner.
OK by me.  I'd love to know what the real source of this is!

Comment 7 by kenrb@chromium.org, May 26 2017

Components: Blink>Compositing
Labels: -M-59 M-60
Owner: danakj@chromium.org
Status: Assigned (was: Untriaged)
danakj@: Can you PTAL? This is looking like it might be a security regression from a CL that you landed last August.

The compositor is asking Skia to draw an uninitialized bitmap, and the CF report implies that the resource comes from PaintedScrollbarLayer::RasterizeScrollbarPart().

This CL, in the report's regression range, looks like a candidate:
https://chromium.googlesource.com/chromium/src/+/cbd37e2ef2b8fa6292f5ea8cfb41df409e63cde5

This is also in the regression range, perhaps less likely: https://chromium.googlesource.com/chromium/src/+/8c93919a29947fc27190cdf00bd54de1bff14d84
I think this has been logically present since well before I joined the Skia team a few years ago, but probably only in its present form since we ported this method from assembly to instrumentable intrinsics in January 2015 under its old name, S32A_Opaque_BlitRow32_SSE4.

https://codereview.chromium.org/874863002

The original assembly dates to June 2014, https://codereview.chromium.org/289473009

Before that, we'd be doing the equivalent function (S32A_Opaque_BlitRow32_SSE2) with SSE2 unconditionally, I think, which wouldn't tip off any uninitialized-memory checkers, probably Valgrind at the time?

Comment 9 by danakj@chromium.org, May 26 2017

At least, this isn't a security problem. In the worst case someone would control some pixels in the scrollbar (tho it's not clear what to me since they look ok anyways).

Comment 10 by kenrb@chromium.org, May 26 2017

danakj@: It might be true that this doesn't have security implications, but I need a bit of convincing.

You might already know this, but to make sure everybody is on the same page, the primary risk with uninitialized memory usage is that you might have random values influencing the pixels that get displayed, which in some cases could allow an attacker to make inferences about what data was in the uninitialized section. If this includes memory addresses (e.g. raw pointer values) then that is useful for defeating address space layout randomization, which is an important anti-exploit measure.

If an attacker loaded HTML with scrollbars into an SVG <foreignobject> and then drew that to a <canvas>, isn't there a potential for inspecting pixels that might have painted using uninitialized data?
I'm not sure this would be the same path, these are compositor scrollbars which can't go into a canas.
canvas*

Comment 13 by kenrb@chromium.org, May 26 2017

That's a good point. It might be okay to lower the priority on this then, if we're confident there is no way to infer pixel values in the bitmap.
Cc: danakj@chromium.org
Labels: -Pri-1 Pri-3
Owner: ----
Status: Available (was: Assigned)
I am going to deprioritize then?

Comment 15 by kenrb@chromium.org, Jun 13 2017

Labels: -Type-Bug-Security -Restrict-View-SecurityTeam -Security_Impact-Stable -Security_Severity-Medium Type-Bug
Stripping security flags before our bots get cranky about an uninitialized read getting ignored. There's a strong case that this doesn't leak information to web content.
Project Member

Comment 16 by ClusterFuzz, Jul 25 2017

ClusterFuzz has detected this issue as fixed in range 489104:489161.

Detailed report: https://clusterfuzz.com/testcase?key=5817101393854464

Fuzzer: marty_html_twiddler
Job Type: linux_msan_chrome
Platform Id: linux

Crash Type: Use-of-uninitialized-value
Crash Address: 
Crash State:
  sse41::blit_row_s32a_opaque
  SkARGB32_Shader_Blitter::blitRect
  SkScan::FillIRect
  
Sanitizer: memory (MSAN)

Recommended Security Severity: Medium

Regressed: https://clusterfuzz.com/revisions?job=linux_msan_chrome&range=414545:414653
Fixed: https://clusterfuzz.com/revisions?job=linux_msan_chrome&range=489104:489161

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=5817101393854464


See https://github.com/google/clusterfuzz-tools for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 17 by ClusterFuzz, Jul 25 2017

Labels: ClusterFuzz-Verified
Status: Verified (was: Available)
ClusterFuzz testcase 5817101393854464 is verified as fixed, so closing issue as verified.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.

Sign in to add a comment