<div dir="ltr"><div><div>Thanks for catching this!<br><br></div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div>Cc: "17.0 13.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 3:18 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">The size of the pool is slightly smaller than the size of the<br>
structure containing the whole pool. We need to take that into account<br>
on when setting up the internals.<br>
<br>
Fixes a crash due to out of bound memory access in:<br>
dEQP-VK.api.descriptor_pool.<wbr>out_of_pool_memory<br>
<br>
</span>v2: Drop debug traces (Lionel)<br>
<span class=""><br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
---<br>
src/intel/vulkan/anv_<wbr>descriptor_set.c | 8 ++++----<br>
1 file changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>descriptor_set.c b/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
</span>index a4b7638a61..7853ec7dd9 100644<br>
--- a/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
+++ b/src/intel/vulkan/anv_<wbr>descriptor_set.c<br>
@@ -329,18 +329,18 @@ VkResult anv_CreateDescriptorPool(<br>
<span class="im HOEnZb"> }<br>
}<br>
<br>
- const size_t size =<br>
- sizeof(*pool) +<br>
+ const size_t pool_size =<br>
pCreateInfo->maxSets * sizeof(struct anv_descriptor_set) +<br>
descriptor_count * sizeof(struct anv_descriptor) +<br>
buffer_count * sizeof(struct anv_buffer_view);<br>
+ const size_t total_size = sizeof(*pool) + pool_size;<br>
<br>
</span><div class="HOEnZb"><div class="h5">- pool = vk_alloc2(&device->alloc, pAllocator, size, 8,<br>
+ pool = vk_alloc2(&device->alloc, pAllocator, total_size, 8,<br>
VK_SYSTEM_ALLOCATION_SCOPE_<wbr>OBJECT);<br>
if (!pool)<br>
return vk_error(VK_ERROR_OUT_OF_HOST_<wbr>MEMORY);<br>
<br>
- pool->size = size;<br>
+ pool->size = pool_size;<br>
pool->next = 0;<br>
pool->free_list = EMPTY;<br>
<br>
--<br>
2.11.0<br>
</div></div></blockquote></div><br></div></div></div></div></div>