Mesa (main): anv: zero-out anv_batch_bo

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 17 16:21:11 UTC 2022


Module: Mesa
Branch: main
Commit: d68b9f0e6b1e45533c9f53eca6111cabb34d6fdb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d68b9f0e6b1e45533c9f53eca6111cabb34d6fdb

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Thu Mar 17 11:57:07 2022 +0200

anv: zero-out anv_batch_bo

anv_batch_bo has a length field that we use to flush cachelines. Not
having that field initialized properly leads us to access out of bound
memory.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15425>

---

 src/intel/vulkan/anv_batch_chain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 8737b6791f1..3b1bdfcbef0 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -349,7 +349,7 @@ anv_batch_bo_create(struct anv_cmd_buffer *cmd_buffer,
 {
    VkResult result;
 
-   struct anv_batch_bo *bbo = vk_alloc(&cmd_buffer->vk.pool->alloc, sizeof(*bbo),
+   struct anv_batch_bo *bbo = vk_zalloc(&cmd_buffer->vk.pool->alloc, sizeof(*bbo),
                                         8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (bbo == NULL)
       return vk_error(cmd_buffer, VK_ERROR_OUT_OF_HOST_MEMORY);



More information about the mesa-commit mailing list