zink: always map descriptor buffers as COHERENT

this is already implied since the buffers must be BAR-allocated,
but it ensures the context isn't accessed during unmap

Fixes: b06f6e00fb ("zink: fix heap-use-after-free on batch_state with sub-allocated pipe_resources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27344>
This commit is contained in:
Mike Blumenkrantz 2024-01-30 07:47:45 -05:00 committed by Marge Bot
parent 3f119a1fd8
commit c900cca96c

View file

@ -1593,7 +1593,7 @@ zink_batch_descriptor_init(struct zink_screen *screen, struct zink_batch_state *
if (!pres)
return false;
bs->dd.db = zink_resource(pres);
bs->dd.db_map = pipe_buffer_map(&bs->ctx->base, pres, PIPE_MAP_READ | PIPE_MAP_WRITE | PIPE_MAP_PERSISTENT | PIPE_MAP_THREAD_SAFE, &bs->dd.db_xfer);
bs->dd.db_map = pipe_buffer_map(&bs->ctx->base, pres, PIPE_MAP_READ | PIPE_MAP_WRITE | PIPE_MAP_PERSISTENT | PIPE_MAP_COHERENT | PIPE_MAP_THREAD_SAFE, &bs->dd.db_xfer);
}
return true;
}