Heap buffer overflow in Skia (CVE-2024-8198)
An integer overflow in Skia's RegionOpImpl::onPrepareDraws allows a heap buffer overflow when drawing many regions with large interval counts. An attacker could trigger a GPU process crash by opening a malicious HTML page.
Originally disclosed on Chrome VRP
- Fix shipped in 10 days
Steps to reproduce the problem
(Chromium)
- Apply the
chromium.diffrenderer patch to chromium. - Run
genskpic.pyto generatedrawable_picture.skp.hh, then move the generated file tosrc/gpu/command_buffer/client. - Build and start the browser.
- Open
index.htmlto trigger PoC. - GPU process will crash.
(Skia standalone)
- Run
genskpic.pyto generate a.skpfile. - You can now run it in skpbench using:
./out/asan/skpbench --src pic.skp --config gles. - UBSAN crash will happen.
Problem Description
In Skia Ganesh, when drawing a Skia Picture with a DRAW_REGION operation, a RegionOpImpl operation object will be created if anti-aliasing is disabled or not needed.
Each DRAW_REGION operation is serialized together with a SkRegion, and each SkRegion can take thousands of "intervals" where each "interval" is a subrectangle within the region.
If many DRAW_REGION operations are drawn on the same canvas, RegionOpImpl::onCombineIfPossible will be called to test how many RegionOp operation objects can be merged into a single one, and will merge region information of both operations if the test succeeds [1], this function is really small and does not make any relevant checks before combining operations:
CombineResult onCombineIfPossible(GrOp* t, SkArenaAlloc*, const GrCaps& caps) override {
auto that = t->cast<RegionOpImpl>();
if (!fHelper.isCompatible(that->fHelper, caps, this->bounds(), that->bounds())) {
return CombineResult::kCannotCombine;
}
if (fViewMatrix != that->fViewMatrix) {
return CombineResult::kCannotCombine;
}
fRegions.push_back_n(that->fRegions.size(), that->fRegions.begin()); // <-- [1]
fWideColor |= that->fWideColor;
return CombineResult::kMerged;
}
Then, RegionOpImpl::onPrepareDraws will be called to sum the "complexity" of each region [2] in order to calculate how many rectangles are needed to draw all the combined regions:
void onPrepareDraws(GrMeshDrawTarget* target) override {
...
int numRegions = fRegions.size();
int numRects = 0;
for (int i = 0; i < numRegions; i++) {
numRects += fRegions[i].fRegion.computeRegionComplexity(); // <-- [2]
}
...
}
However, the complexity of each region can be given by how many intervals (subrectangles) they have [3] (which is 80000 per region in PoC):
int SkRegion::computeRegionComplexity() const {
if (this->isEmpty()) {
return 0;
} else if (this->isRect()) {
return 1;
}
return fRunHead->getIntervalCount(); // <-- [3]
}
Looking back to the previous for [2] in RegionOpImpl::onPrepareDraws, we can clearly see that, by previously combining many DRAW_REGION operations, numRects will eventually overflow.
Later, the function will try to pre-allocate enough vertices [4] [5] for all rectangles using the overflowed numRects, and will try to write a quad for each invidual region [6] to the vertex buffer, which ends up in an OOB write.
void onPrepareDraws(GrMeshDrawTarget* target) override {
...
QuadHelper helper(target, fProgramInfo->geomProc().vertexStride(), numRects); // <-- [4]
VertexWriter vertices{helper.vertices()}; // <-- [5]
if (!vertices) {
SkDebugf("Could not allocate vertices\n");
return;
}
for (int i = 0; i < numRegions; i++) {
VertexColor color(fRegions[i].fColor, fWideColor);
SkRegion::Iterator iter(fRegions[i].fRegion);
while (!iter.done()) {
SkRect rect = SkRect::Make(iter.rect());
vertices.writeQuad(VertexWriter::TriStripFromRect(rect), color); // <-- [6]
iter.next();
}
}
fMesh = helper.mesh();
}
Summary
Integer overflow in Skia RegionOpImpl::onPrepareDraws leads to OOB write
Custom Questions
Type of crash:
gpu
Crash state:
================================================================= ==126174==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f5282001820 at pc 0x7f530a855493 bp 0x7ffca376c130 sp 0x7ffca376c128 WRITE of size 4 at 0x7f5282001820 thread T0 (chrome) ==126174==WARNING: invalid path to external symbolizer! ==126174==WARNING: Failed to use and restart external symbolizer! #0 0x7f530a855492 in operator<<<float> ./../../third_party/skia/src/gpu/BufferWriter.h:280:5 #1 0x7f530a855492 in writeVertex ./../../third_party/skia/src/gpu/BufferWriter.h:0:0 #2 0x7f530a855492 in writeQuadVertex<1, skgpu::VertexWriter::TriStrip<float>, skgpu::VertexColor> ./../../third_party/skia/src/gpu/BufferWriter.h:262:14 #3 0x7f530a855492 in writeQuad<skgpu::VertexWriter::TriStrip<float>, skgpu::VertexColor> ./../../third_party/skia/src/gpu/BufferWriter.h:246:15 #4 0x7f530a855492 in skgpu::ganesh::RegionOp::(anonymous namespace)::RegionOpImpl::onPrepareDraws(GrMeshDrawTarget*) ./../../third_party/skia/src/gpu/ganesh/ops/RegionOp.cpp:170:26 #5 0x7f530a830ac0 in GrOp::prepare(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/ops/GrOp.h:197:15 #6 0x7f530a83033c in skgpu::ganesh::OpsTask::onPrepare(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/ops/OpsTask.cpp:548:27 #7 0x7f530a6378d9 in GrRenderTask::prepare(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/GrRenderTask.cpp:111:11 #8 0x7f530a5dbe50 in GrDrawingManager::executeRenderTasks(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/GrDrawingManager.cpp:260:21 #9 0x7f530a5da829 in GrDrawingManager::flush(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) ./../../third_party/skia/src/gpu/ganesh/GrDrawingManager.cpp:203:34 #10 0x7f530a5dcf7c in GrDrawingManager::flushSurfaces(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) ./../../third_party/skia/src/gpu/ganesh/GrDrawingManager.cpp:530:27 #11 0x7f52d4990394 in flushAndSubmit ./../../third_party/skia/include/gpu/GrDirectContext.h:333:15 #12 0x7f52d4990394 in gpu::SharedContextState::FlushAndSubmit(bool) ./../../gpu/command_buffer/service/shared_context_state.cc:764:19 #13 0x7f52d494188c in DoFinish ./../../gpu/command_buffer/service/raster_decoder.cc:1846:26 #14 0x7f52d494188c in gpu::raster::RasterDecoderImpl::HandleFinish(unsigned int, void const volatile*) ./../../gpu/command_buffer/service/raster_decoder_autogen.h:22:3 #15 0x7f52d494e321 in gpu::error::Error gpu::raster::RasterDecoderImpl::DoCommandsImpl<false>(unsigned int, void const volatile*, int, int*) ./../../gpu/command_buffer/service/raster_decoder.cc:1539:18 #16 0x7f52ff0d3826 in gpu::CommandBufferService::Flush(int, gpu::AsyncAPIInterface*) ./../../gpu/command_buffer/service/command_buffer_service.cc:231:35 #17 0x7f52d6b28e5c in gpu::CommandBufferStub::OnAsyncFlush(int, unsigned int, std::__Cr::vector<gpu::SyncToken, std::__Cr::allocatorgpu::SyncToken> const&) ./../../gpu/ipc/service/command_buffer_stub.cc:502:22 #18 0x7f52d6b28101 in gpu::CommandBufferStub::ExecuteDeferredRequest(gpu::mojom::DeferredCommandBufferRequestParams&) ./../../gpu/ipc/service/command_buffer_stub.cc:153:7 #19 0x7f52d6b48655 in gpu::GpuChannel::ExecuteDeferredRequest(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long) ./../../gpu/ipc/service/gpu_channel.cc:932:13 #20 0x7f52d6b56e8e in void base::internal::DecayedFunctorTraits<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel&&, mojo::StructPtrgpu::mojom::DeferredRequestParams&&, unsigned long&&>::Invoke<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel const&, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long>(void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel const&, mojo::StructPtrgpu::mojom::DeferredRequestParams&&, unsigned long&&) ./../../base/functional/bind_internal.h:738:12 #21 0x7f52d6b56c74 in MakeItSo<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), std::__Cr::tuple<base::WeakPtrgpu::GpuChannel, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long> > ./../../base/functional/bind_internal.h:954:5 #22 0x7f52d6b56c74 in RunImpl<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), std::__Cr::tuple<base::WeakPtrgpu::GpuChannel, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long>, 0UL, 1UL, 2UL> ./../../base/functional/bind_internal.h:1067:14 #23 0x7f52d6b56c74 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::GpuChannel::&&)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel&&, mojo::StructPtrgpu::mojom::DeferredRequestParams&&, unsigned long&&>, base::internal::BindState<true, true, false, void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long>, void ()>::RunOnce(base::internal::BindStateBase) ./../../base/functional/bind_internal.h:980:12 #24 0x7f52ff11076e in Run ./../../base/functional/callback.h:156:12 #25 0x7f52ff11076e in gpu::SchedulerDfs::ExecuteSequence(base::IdType<gpu::SyncPointOrderData, unsigned int, 0u, 1u>) ./../../gpu/command_buffer/service/scheduler_dfs.cc:598:24 #26 0x7f52ff10e155 in gpu::SchedulerDfs::RunNextTask() ./../../gpu/command_buffer/service/scheduler_dfs.cc:522:3 #27 0x7f52ff111f40 in Invoke<void (gpu::SchedulerDfs::)(), gpu::SchedulerDfs > ./../../base/functional/bind_internal.h:738:12 #28 0x7f52ff111f40 in MakeItSo<void (gpu::SchedulerDfs::)(), std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::SchedulerDfs, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0> > > ./../../base/functional/bind_internal.h:930:12 #29 0x7f52ff111f40 in RunImpl<void (gpu::SchedulerDfs::)(), std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::SchedulerDfs, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0> >, 0UL> ./../../base/functional/bind_internal.h:1067:14 #30 0x7f52ff111f40 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::SchedulerDfs::&&)(), gpu::SchedulerDfs>, base::internal::BindState<true, true, false, void (gpu::SchedulerDfs::)(), base::internal::UnretainedWrapper<gpu::SchedulerDfs, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunOnce(base::internal::BindStateBase) ./../../base/functional/bind_internal.h:980:12 #31 0x7f530e3bee6a in Run ./../../base/functional/callback.h:156:12 #32 0x7f530e3bee6a in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) ./../../base/task/common/task_annotator.cc:203:34 #33 0x7f530e430793 in RunTask<(lambda at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:486:11)> ./../../base/task/common/task_annotator.h:90:5 #34 0x7f530e430793 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) ./../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:484:23 #35 0x7f530e42f69e in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() ./../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:346:40 #36 0x7f530e4314b4 in non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() ./../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:0:0 #37 0x7f530e5c2411 in base::MessagePumpGlib::HandleDispatch() ./../../base/message_loop/message_pump_glib.cc:649:46 #38 0x7f530e5c5472 in base::(anonymous namespace)::WorkSourceDispatch(_GSource*, int ()(void), void*) ./../../base/message_loop/message_pump_glib.cc:274:43 #39 0x7f52b531bd3a in g_main_context_dispatch ??:0:0
0x7f5282001820 is located 0 bytes after 4194336-byte region [0x7f5281c01800,0x7f5282001820) allocated by thread T0 (chrome) here: #0 0x653362ca40bd in operator new(unsigned long) asan_rtl:3 #1 0x7f530a59bc9d in Make ./../../third_party/skia/src/gpu/ganesh/GrCpuBuffer.h:29:20 #2 0x7f530a59bc9d in GrBufferAllocPool::CpuBufferCache::makeBuffer(unsigned long, bool) ./../../third_party/skia/src/gpu/ganesh/GrBufferAllocPool.cpp:56:30 #3 0x7f530a59cb9c in GrBufferAllocPool::resetCpuData(unsigned long) ./../../third_party/skia/src/gpu/ganesh/GrBufferAllocPool.cpp:389:60 #4 0x7f530a59e51a in GrBufferAllocPool::createBlock(unsigned long) ./../../third_party/skia/src/gpu/ganesh/GrBufferAllocPool.cpp:362:15 #5 0x7f530a59da01 in GrBufferAllocPool::makeSpace(unsigned long, unsigned long, sk_sp<GrBuffer const>, unsigned long) ./../../third_party/skia/src/gpu/ganesh/GrBufferAllocPool.cpp:229:16 #6 0x7f530a59fc02 in GrVertexBufferAllocPool::makeSpace(unsigned long, int, sk_sp<GrBuffer const>, int) ./../../third_party/skia/src/gpu/ganesh/GrBufferAllocPool.cpp:445:28 #7 0x7f530a7f3eef in GrMeshDrawOp::PatternHelper::init(GrMeshDrawTarget*, GrPrimitiveType, unsigned long, sk_sp<GrBuffer const>, int, int, int, int) ./../../third_party/skia/src/gpu/ganesh/ops/GrMeshDrawOp.cpp:96:25 #8 0x7f530a7f4500 in GrMeshDrawOp::QuadHelper::QuadHelper(GrMeshDrawTarget*, unsigned long, int) ./../../third_party/skia/src/gpu/ganesh/ops/GrMeshDrawOp.cpp:134:11 #9 0x7f530a8542bf in skgpu::ganesh::RegionOp::(anonymous namespace)::RegionOpImpl::onPrepareDraws(GrMeshDrawTarget*) ./../../third_party/skia/src/gpu/ganesh/ops/RegionOp.cpp:157:20 #10 0x7f530a830ac0 in GrOp::prepare(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/ops/GrOp.h:197:15 #11 0x7f530a83033c in skgpu::ganesh::OpsTask::onPrepare(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/ops/OpsTask.cpp:548:27 #12 0x7f530a6378d9 in GrRenderTask::prepare(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/GrRenderTask.cpp:111:11 #13 0x7f530a5dbe50 in GrDrawingManager::executeRenderTasks(GrOpFlushState*) ./../../third_party/skia/src/gpu/ganesh/GrDrawingManager.cpp:260:21 #14 0x7f530a5da829 in GrDrawingManager::flush(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) ./../../third_party/skia/src/gpu/ganesh/GrDrawingManager.cpp:203:34 #15 0x7f530a5dcf7c in GrDrawingManager::flushSurfaces(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) ./../../third_party/skia/src/gpu/ganesh/GrDrawingManager.cpp:530:27 #16 0x7f52d4990394 in flushAndSubmit ./../../third_party/skia/include/gpu/GrDirectContext.h:333:15 #17 0x7f52d4990394 in gpu::SharedContextState::FlushAndSubmit(bool) ./../../gpu/command_buffer/service/shared_context_state.cc:764:19 #18 0x7f52d494188c in DoFinish ./../../gpu/command_buffer/service/raster_decoder.cc:1846:26 #19 0x7f52d494188c in gpu::raster::RasterDecoderImpl::HandleFinish(unsigned int, void const volatile*) ./../../gpu/command_buffer/service/raster_decoder_autogen.h:22:3 #20 0x7f52d494e321 in gpu::error::Error gpu::raster::RasterDecoderImpl::DoCommandsImpl<false>(unsigned int, void const volatile*, int, int*) ./../../gpu/command_buffer/service/raster_decoder.cc:1539:18 #21 0x7f52ff0d3826 in gpu::CommandBufferService::Flush(int, gpu::AsyncAPIInterface*) ./../../gpu/command_buffer/service/command_buffer_service.cc:231:35 #22 0x7f52d6b28e5c in gpu::CommandBufferStub::OnAsyncFlush(int, unsigned int, std::__Cr::vector<gpu::SyncToken, std::__Cr::allocatorgpu::SyncToken> const&) ./../../gpu/ipc/service/command_buffer_stub.cc:502:22 #23 0x7f52d6b28101 in gpu::CommandBufferStub::ExecuteDeferredRequest(gpu::mojom::DeferredCommandBufferRequestParams&) ./../../gpu/ipc/service/command_buffer_stub.cc:153:7 #24 0x7f52d6b48655 in gpu::GpuChannel::ExecuteDeferredRequest(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long) ./../../gpu/ipc/service/gpu_channel.cc:932:13 #25 0x7f52d6b56e8e in void base::internal::DecayedFunctorTraits<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel&&, mojo::StructPtrgpu::mojom::DeferredRequestParams&&, unsigned long&&>::Invoke<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel const&, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long>(void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel const&, mojo::StructPtrgpu::mojom::DeferredRequestParams&&, unsigned long&&) ./../../base/functional/bind_internal.h:738:12 #26 0x7f52d6b56c74 in MakeItSo<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), std::__Cr::tuple<base::WeakPtrgpu::GpuChannel, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long> > ./../../base/functional/bind_internal.h:954:5 #27 0x7f52d6b56c74 in RunImpl<void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), std::__Cr::tuple<base::WeakPtrgpu::GpuChannel, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long>, 0UL, 1UL, 2UL> ./../../base/functional/bind_internal.h:1067:14 #28 0x7f52d6b56c74 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::GpuChannel::&&)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel&&, mojo::StructPtrgpu::mojom::DeferredRequestParams&&, unsigned long&&>, base::internal::BindState<true, true, false, void (gpu::GpuChannel::)(mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long), base::WeakPtrgpu::GpuChannel, mojo::StructPtrgpu::mojom::DeferredRequestParams, unsigned long>, void ()>::RunOnce(base::internal::BindStateBase) ./../../base/functional/bind_internal.h:980:12 #29 0x7f52ff11076e in Run ./../../base/functional/callback.h:156:12 #30 0x7f52ff11076e in gpu::SchedulerDfs::ExecuteSequence(base::IdType<gpu::SyncPointOrderData, unsigned int, 0u, 1u>) ./../../gpu/command_buffer/service/scheduler_dfs.cc:598:24 #31 0x7f52ff10e155 in gpu::SchedulerDfs::RunNextTask() ./../../gpu/command_buffer/service/scheduler_dfs.cc:522:3 #32 0x7f52ff111f40 in Invoke<void (gpu::SchedulerDfs::)(), gpu::SchedulerDfs > ./../../base/functional/bind_internal.h:738:12 #33 0x7f52ff111f40 in MakeItSo<void (gpu::SchedulerDfs::)(), std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::SchedulerDfs, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0> > > ./../../base/functional/bind_internal.h:930:12 #34 0x7f52ff111f40 in RunImpl<void (gpu::SchedulerDfs::)(), std::__Cr::tuple<base::internal::UnretainedWrapper<gpu::SchedulerDfs, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0> >, 0UL> ./../../base/functional/bind_internal.h:1067:14 #35 0x7f52ff111f40 in base::internal::Invoker<base::internal::FunctorTraits<void (gpu::SchedulerDfs::&&)(), gpu::SchedulerDfs>, base::internal::BindState<true, true, false, void (gpu::SchedulerDfs::)(), base::internal::UnretainedWrapper<gpu::SchedulerDfs, base::unretained_traits::MayNotDangle, (partition_alloc::internal::RawPtrTraits)0>>, void ()>::RunOnce(base::internal::BindStateBase) ./../../base/functional/bind_internal.h:980:12 #36 0x7f530e3bee6a in Run ./../../base/functional/callback.h:156:12 #37 0x7f530e3bee6a in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) ./../../base/task/common/task_annotator.cc:203:34 #38 0x7f530e430793 in RunTask<(lambda at ../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:486:11)> ./../../base/task/common/task_annotator.h:90:5 #39 0x7f530e430793 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) ./../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:484:23 #40 0x7f530e42f69e in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() ./../../base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:346:40
SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/hyhy100/chromium2/src/out/asan/libskia.so+0xc55492) (BuildId: 739a908ae5387373) Shadow bytes around the buggy address: 0x7f5282001580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f5282001600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f5282001680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f5282001700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x7f5282001780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x7f5282001800: 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa 0x7f5282001880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x7f5282001900: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x7f5282001980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x7f5282001a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x7f5282001a80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb
==126174==ADDITIONAL INFO
==126174==Note: Please include this section with the ASan report. Task trace: #0 0x7f52ff10e73a in gpu::SchedulerDfs::RunNextTask() ./../../gpu/command_buffer/service/scheduler_dfs.cc:538:27 #1 0x7f52ff10e73a in gpu::SchedulerDfs::RunNextTask() ./../../gpu/command_buffer/service/scheduler_dfs.cc:538:27 #2 0x7f52ff10e73a in gpu::SchedulerDfs::RunNextTask() ./../../gpu/command_buffer/service/scheduler_dfs.cc:538:27 #3 0x7f52ff10e73a in gpu::SchedulerDfs::RunNextTask() ./../../gpu/command_buffer/service/scheduler_dfs.cc:538:27
Command line: /proc/self/exe --type=gpu-process --string-annotations --crashpad-handler-pid=126139 --enable-crash-reporter=, --no-subproc-heap-profiling --change-stack-guard-on-fork=enable --gpu-preferences=UAAAAAAAAAAgAAAEAAAAAAAAAAAAAAAAAABgAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAABAAAAAAAAAAEAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAA --shared-files --metrics-shmem-handle=4,i,5938383281710132735,15970005224835835873,262144 --field-trial-handle=3,i,10774954344472323617,3888956267482362363,262144 --variations-seed-version
==126174==END OF ADDITIONAL INFO ==126174==ABORTING
Reporter credit:
Renan Rios (@hyhy_100)
Additional Data
Category: Security
Chrome Channel: Not sure
Regression: No
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the integer overflow in the sum of region complexities when combining many DRAW_REGION operations, leading to under-allocation and out-of-bounds write.
Impact
The GPU process crashes, potentially leading to denial of service; the text does not claim remote code execution.
What the attacker needed
Victim opens a malicious HTML page; browser uses Skia Ganesh with anti-aliasing disabled
How it was found
- Apply the chromium.diff renderer patch to chromium.
- Run genskpic.py to generate drawable_picture.skp.hh, then move the generated file to src/gpu/command_buffer/client.
- Build and start the browser.
- Open index.html to trigger PoC.
- GPU process will crash.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Skia is a graphics library used by Chrome to draw things on screen. When many shapes are combined, a number that counts how many rectangles are needed can overflow and become too small, so the program writes more data than it allocated, causing a crash. This is called a heap buffer overflow.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.