New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 690216 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Security

Blocking:
issue 690966



Sign in to add a comment

Heap-use-after-free in gpu::gles2::Texture::AddTextureRef

Project Member Reported by ClusterFuzz, Feb 8 2017

Issue description

Cc: senorblanco@chromium.org
Components: Internals>GPU
Owner: kbr@chromium.org
Status: Assigned (was: Untriaged)
+some GPU friends.

It seems like it might not be Linux-specific, right?
Project Member

Comment 2 by sheriffbot@chromium.org, Feb 9 2017

Labels: M-58
Project Member

Comment 3 by sheriffbot@chromium.org, Feb 9 2017

Labels: ReleaseBlock-Beta
This issue is a security regression. If you are not able to fix this quickly, please revert the change that introduced it.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 4 by sheriffbot@chromium.org, Feb 9 2017

Labels: Pri-1
Cc: zmo@chromium.org geoffl...@chromium.org
Project Member

Comment 6 by sheriffbot@chromium.org, Feb 10 2017

Labels: ReleaseBlock-Beta
This issue is a security regression. If you are not able to fix this quickly, please revert the change that introduced it.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by kbr@chromium.org, Feb 14 2017

Cc: kbr@chromium.org
Owner: palmer@chromium.org
Something looks wrong with the test case for this bug. When downloaded, it's just a bunch of garbage bytes.

palmer@, please help us by providing a viable and reproducible test case. Thanks.

Comment 8 by kbr@chromium.org, Feb 14 2017

Labels: Needs-Feedback

Comment 9 by palmer@chromium.org, Feb 14 2017

Cc: mbarbe...@chromium.org
Owner: infe...@chromium.org
Beats me. :) I'm not sure if that's supposed to be something for the GPU to consume, or if ClusterFuzz got damaged storage. For that, let's defer to the CF bosses, who might also know who wrote libfuzzer_gpu_angle_fuzzer and thus how to interpret its output.

+inferno, mbarbella

Comment 10 by aarya@google.com, Feb 14 2017

Owner: piman@chromium.org
It is a libFuzzer produced testcases which fuzzes at the function api level accepting untrusted input. See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/README.md and 
fuzzer wrote by piman@ at https://cs.chromium.org/chromium/src/gpu/command_buffer/tests/fuzzer_main.cc?q=command_buffer/tests/fuzzer_main.cc&dr

Comment 11 by kbr@chromium.org, Feb 14 2017

Owner: vmi...@chromium.org
Thanks. piman's on leave. Abhishek, *please* update your documentation at https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.md to include libfuzzer_gpu_angle_fuzzer.

Victor, I would really appreciate it if someone else from the GPU team could investigate this. Is anyone available? If not, please reassign back to me.

Status: Started (was: Assigned)
I've been able to track down the bug.  If we get a pattern where we Consume a mailbox corresponding to the same texture that is currently bound, the texture is deleted and then re-referenced, causing the use-after-free condition.

I have a patch and will upload as soon as I have a unit test to go with it.
Project Member

Comment 14 by bugdroid1@chromium.org, Feb 15 2017

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

commit 307befe4b9981bcd19c4f2b2ca189cca588a7d8e
Author: vmiura <vmiura@chromium.org>
Date: Wed Feb 15 21:28:02 2017

Handle GLES2::ConsumeTextureCHROMIUM consuming the currently bound texture.

If the consumed mailbox corresponded to the currently bound texture,
the same texture was first deleted, then consumed causing use-after-free.

R=zmo@chromium.org
BUG= 690216 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2693273002
Cr-Commit-Position: refs/heads/master@{#450806}

[modify] https://crrev.com/307befe4b9981bcd19c4f2b2ca189cca588a7d8e/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/307befe4b9981bcd19c4f2b2ca189cca588a7d8e/gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc

Project Member

Comment 15 by ClusterFuzz, Feb 16 2017

ClusterFuzz has detected this issue as fixed in range 450784:450807.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6025354159587328

Fuzzer: libfuzzer_gpu_angle_fuzzer
Job Type: libfuzzer_chrome_asan
Platform Id: linux

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x611000013538
Crash State:
  gpu::gles2::Texture::AddTextureRef
  gpu::gles2::TextureRef::TextureRef
  gpu::gles2::TextureManager::Consume
  
Sanitizer: address (ASAN)

Recommended Security Severity: High

Regressed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_asan&range=449031:449063
Fixed: https://cluster-fuzz.appspot.com/revisions?job=libfuzzer_chrome_asan&range=450784:450807

Reproducer Testcase: https://cluster-fuzz.appspot.com/download/AMIfv94d9GoqdcXY7ZuSLyT6p8b1wKPSbTnSUABmUSGX1uNHgHn1_gWWn--eiNx6pK5fl3aBcq6I4E2gXImHx_lar58vTFjTs5KPT-Xr9JJBnWQhusRyzFPcAPn0uFu_zyJTV2nDoHJBBKvGGBvXEN04gSRnVsIfvI57FTLaVE69CzkLDBJMSUDs9dkW2UNwEvLN8FVg5lqRtFVGwfnrZeKVZc5-CfQ8I85q6TRFDF0Jv70DKrDGwZRXpUUNMIXRZPFTCuA5Ys7OjDQ1KCp9U-lvkin2ocPESCirhwvTWMmmkFdmLSBfuYp__5RRofm5K1IJHOvIWvvL0t3ewAXeyxJxT-IuhT0x8YHc3s0cU3kHZR7SB2d_RCbTd3WVeI5CpcgXU19hfo1dgqc38DIMJEbsNeXn7GcE0w?testcase_id=6025354159587328


See https://chromium.googlesource.com/chromium/src/+/master/testing/libfuzzer/reproducing.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 16 by ClusterFuzz, Feb 16 2017

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

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

Comment 17 by sheriffbot@chromium.org, Feb 16 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify

Comment 18 by kbr@chromium.org, Feb 17 2017

Thank you Victor for taking and tracking this down!

Comment 19 by kbr@chromium.org, Feb 18 2017

Blocking: 690966
Labels: -ReleaseBlock-Beta
Project Member

Comment 21 by sheriffbot@chromium.org, May 25 2017

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment