From 72c3e51c39fa86867c93790988ba8474a049cd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 5 Oct 2020 12:02:19 -0400 Subject: [PATCH] gallium/u_threaded_context: fix use-after-free in transfer_unmap discovered by valgrind Fixes: fd6a5e112aa Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: (cherry picked from commit 3dc00c33f08e0000fa2fead5ac96c8864be7d319) --- .pick_status.json | 2 +- src/gallium/auxiliary/util/u_threaded_context.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 87fecdb0d30..3b49ca9c334 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2308,7 +2308,7 @@ "description": "gallium/u_threaded_context: fix use-after-free in transfer_unmap", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "fd6a5e112aa1fd09bc01f4cf3ca211ad73cc404e" }, diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 72111f34c01..6cd6dc84447 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -1608,9 +1608,9 @@ tc_transfer_unmap(struct pipe_context *_pipe, struct pipe_transfer *transfer) PIPE_TRANSFER_DISCARD_RANGE))); struct pipe_context *pipe = tc->pipe; - pipe->transfer_unmap(pipe, transfer); util_range_add(&tres->b, tres->base_valid_buffer_range, transfer->box.x, transfer->box.x + transfer->box.width); + pipe->transfer_unmap(pipe, transfer); return; }