From 3d6156434a96c75e30fc4cfa65409fb2800d737a Mon Sep 17 00:00:00 2001 From: kraibse <33869366+kraibse@users.noreply.github.com> Date: Sun, 1 Nov 2026 17:17:54 +0100 Subject: nx2: guard empty and overflowing 216 map requests, log failed whole-backing A zero-size request at a region start wrapped last_block and wrote past the region's blocks; the offset + size memory bounds check could overflow. Both are guest-controlled. Also log an error when a sparse tiled image sharing the zeroed block can't be backed whole before a GPU write. --- src/video_core/texture_cache/texture_cache.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/video_core/texture_cache/texture_cache.h') diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 5f655e5b60..33ca051482 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -3113,6 +3113,11 @@ void TextureCache

::PrepareImage(ImageId image_id, bool is_modification, bool if (BackSparseTilesWhole(image)) { image.dirty_ranges.clear(); RefreshSparseTiles(image); + } else { + LOG_ERROR(HW_GPU, + "Sparse tiled image {:#x}: out of memory backing it whole, the GPU " + "write lands in the shared zeroed block", + image.gpu_addr); } } } -- cgit v1.2.3