summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2022-08-04 09:25:07 -0700
committerDylan Baker <dylan.c.baker@intel.com>2022-08-11 10:30:37 -0700
commita544df2afc695df907c8f40c80633aa1170d5d4c (patch)
tree2e7acf19128443c349efd6746fde3ad47a1b9fca
parentff01821f7e0c4868702467b87047074f2b66da1e (diff)
downloadmesa-a544df2afc695df907c8f40c80633aa1170d5d4c.tar.gz
freedreno/drm: Fix potential bo cache vs export crash
Keep the list head valid (empty) after allocation from bo cache. Avoids a potential later crash in lookup_bo in the following sequence: 1. alloc, bo cache hit 2. export 3. re-import Cc: mesa-stable Fixes: f3cc0d27475 ("freedreno: import libdrm_freedreno + redesign submit") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6988 Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888> (cherry picked from commit 8b3f2a9e5d49098a921de643916dd693f569d1bc)
-rw-r--r--.pick_status.json2
-rw-r--r--src/freedreno/drm/freedreno_bo_cache.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 945e8476e51..8121b46bb62 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1696,7 +1696,7 @@
"description": "freedreno/drm: Fix potential bo cache vs export crash",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "f3cc0d2747568a186dba433ac94af607c38fa024"
},
diff --git a/src/freedreno/drm/freedreno_bo_cache.c b/src/freedreno/drm/freedreno_bo_cache.c
index 0a70cb531f4..1dc02499fa1 100644
--- a/src/freedreno/drm/freedreno_bo_cache.c
+++ b/src/freedreno/drm/freedreno_bo_cache.c
@@ -142,7 +142,7 @@ find_in_bucket(struct fd_bo_bucket *bucket, uint32_t flags)
break;
if (entry->alloc_flags == flags) {
bo = entry;
- list_del(&bo->list);
+ list_delinit(&bo->list);
break;
}
}