[native] Fix UAF in CopyTextureToTexture This was happening with use_blit_for_depth_texture_to_texture_copy_to_nonzero_subresource enabled, and doing a 0-depth (no-op) copy, then making sure that the src and dst texture refs go to 0 so they are deleted, and then submitting. The bug was that the raw texture pointers were being added CommandEncoder::mTopLevelTextures but without the texture refs being also stored in a command Fixed by ensuring we only take the BlitDepthToDepth path if depthOrArrayLayers > 1. Added a validation test that reproduced the UAF with ASAN before my fix, and no longer with my fix. Bug: 489585038 Change-Id: I390b09bbb69ed0ceffbec2017ec7556a05a023e3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/296675 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.