New issue
Advanced search Search tips

Issue 868968 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Aug 1
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

Null-dereference READ in SkWriter32::writeRect

Project Member Reported by ClusterFuzz, Jul 30

Issue description

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

Fuzzer: afl_paint_op_buffer_eq_fuzzer
Job Type: afl_chrome_asan
Platform Id: linux

Crash Type: Null-dereference READ
Crash Address: 0x000000000004
Crash State:
  SkWriter32::writeRect
  SkTextBlobPriv::Flatten
  SkTextBlob::serialize
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=afl_chrome_asan&range=578890:578891

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

Issue filed automatically.

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reference.md for more information.
 
Project Member

Comment 1 by ClusterFuzz, Jul 30

Components: Internals>Skia
Labels: Test-Predator-Auto-Components
Automatically applying components based on crash stacktrace and information from OWNERS files.

If this is incorrect, please apply the Test-Predator-Wrong-Components label.
Project Member

Comment 2 by ClusterFuzz, Jul 30

Labels: Test-Predator-Auto-Owner
Owner: p...@chromium.org
Status: Assigned (was: Untriaged)
Automatically assigning owner based on suspected regression changelist https://chromium.googlesource.com/chromium/src/+/66bcb57a90138959ea5a42de0677ceb3cc0a40f0 (Reland "cc, gpu: Make serialization code bitness agnostic.").

If this is incorrect, please let us know why and apply the Test-Predator-Wrong-CLs label. If you aren't the correct owner for this issue, please unassign yourself as soon as possible so it can be re-triaged.
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cfdbf75b243b60d617df5aa7e9d1eaf6f8492f88

commit cfdbf75b243b60d617df5aa7e9d1eaf6f8492f88
Author: Peter Collingbourne <pcc@chromium.org>
Date: Wed Aug 01 00:39:43 2018

cc: Call SetInvalid if SkTextBlob::Deserialize returns nullptr.

It's possible for SkTextBlob::Deserialize
to return nullptr if we hit this line:
https://cs.chromium.org/chromium/src/third_party/skia/src/core/SkTextBlob.cpp?l=742

This happens in a particular test case found by clusterfuzz and
leads to a segfault during serialization.

There appears to be code in skia that handles
the possibility of an SkTextBlob being null, e.g.
https://cs.chromium.org/chromium/src/third_party/skia/src/core/SkCanvas.cpp?l=25

However, there already seems to be an assumption within cc
that a DrawTextBlob's SkTextBlob is non-null, e.g.
https://cs.chromium.org/chromium/src/cc/paint/paint_op_buffer.cc?l=1952
https://cs.chromium.org/chromium/src/cc/paint/paint_op_buffer.cc?l=1722

So this patch causes the deserializer to reject null SkTextBlobs
within DrawTextBlobs.

Bug:  868968 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iec29d2fc111f6c23f388e36b841fee27b37b06a9
Reviewed-on: https://chromium-review.googlesource.com/1157424
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Khushal <khushalsagar@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579641}
[modify] https://crrev.com/cfdbf75b243b60d617df5aa7e9d1eaf6f8492f88/cc/paint/paint_op_reader.cc

Project Member

Comment 4 by ClusterFuzz, Aug 1

ClusterFuzz has detected this issue as fixed in range 579633:579648.

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

Fuzzer: afl_paint_op_buffer_eq_fuzzer
Job Type: afl_chrome_asan
Platform Id: linux

Crash Type: Null-dereference READ
Crash Address: 0x000000000004
Crash State:
  SkWriter32::writeRect
  SkTextBlobPriv::Flatten
  SkTextBlob::serialize
  
Sanitizer: address (ASAN)

Regressed: https://clusterfuzz.com/revisions?job=afl_chrome_asan&range=578890:578891
Fixed: https://clusterfuzz.com/revisions?job=afl_chrome_asan&range=579633:579648

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

See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reference.md 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 5 by ClusterFuzz, Aug 1

Labels: ClusterFuzz-Verified
Status: Verified (was: Assigned)
ClusterFuzz testcase 6480940340346880 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