mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 17:30:29 +01:00
panfrost: Fix NULL dereference in allowlist code
If a user attempts to run Panfrost on an unsupported GPU (e.g. Mali T604), Panfrost will refuse to load and will destroy the screen immediately, allowing for a graceful fallback to a software rasterizer. However, the screen destroy code calls a screen_destroy function in the GenXML vtbl -- and this function is still NULL when the allowlist is checked. This manifests as crashes on unsuported GPUs. Issue tracked down with Icecream95's mad Ghidra skills. Closes: #5269 Fixes:88dc4db6be("panfrost: Init/destroy blitter from per-gen file") Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reported-by: Icecream95 <ixn@disroot.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12512> (cherry picked from commit2d31d469f7)
This commit is contained in:
parent
c90937aa10
commit
ece6458c04
2 changed files with 3 additions and 2 deletions
|
|
@ -238,7 +238,7 @@
|
|||
"description": "panfrost: Fix NULL dereference in allowlist code",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "88dc4db6be7e21dee525ce1dd4e411664ebc33d6"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -701,7 +701,8 @@ panfrost_destroy_screen(struct pipe_screen *pscreen)
|
|||
panfrost_pool_cleanup(&screen->blitter.desc_pool);
|
||||
pan_blend_shaders_cleanup(dev);
|
||||
|
||||
screen->vtbl.screen_destroy(pscreen);
|
||||
if (screen->vtbl.screen_destroy)
|
||||
screen->vtbl.screen_destroy(pscreen);
|
||||
|
||||
if (dev->ro)
|
||||
dev->ro->destroy(dev->ro);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue