zink: invalidate non-punted recycled descriptor sets that are not valid

these sets may contain refs from the descriptors which need to be removed
to avoid invalid memory access if the ref is leaked

cc: mesa-stable

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>
This commit is contained in:
Mike Blumenkrantz 2022-03-03 12:25:41 -05:00 committed by Marge Bot
parent d63f3c31b7
commit e0030bc39f
1 changed files with 2 additions and 0 deletions

View File

@ -818,6 +818,8 @@ zink_descriptor_set_get(struct zink_context *ctx,
zds = (void*)he->data;
*cache_hit = !zds->invalid;
if (recycled) {
if (zds->invalid)
descriptor_set_invalidate(zds);
/* need to migrate this entry back to the in-use hash */
_mesa_hash_table_remove(pool->free_desc_sets, he);
goto out;