From e5006dc6ae984def3dbdaa0848a906b2ee398e0b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 15 Apr 2025 10:53:19 -0400 Subject: [PATCH] hk: fill sparse.write with nonzero values fuzz for bugs. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/vulkan/hk_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/asahi/vulkan/hk_device.c b/src/asahi/vulkan/hk_device.c index 6d05e597f1d..efd3ada4099 100644 --- a/src/asahi/vulkan/hk_device.c +++ b/src/asahi/vulkan/hk_device.c @@ -65,6 +65,11 @@ hk_upload_rodata(struct hk_device *dev) if (!dev->rodata.bo || !dev->sparse.write) return VK_ERROR_OUT_OF_HOST_MEMORY; + /* The contents of sparse.write are undefined, but making them nonzero helps + * fuzz for bugs where we incorrectly read from the write section. + */ + memset(agx_bo_map(dev->sparse.write), 0xCA, AIL_PAGESIZE); + uint8_t *map = agx_bo_map(dev->rodata.bo); uint32_t offs = 0;