]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/panthor: Fix UAF on kernel BO VA nodes
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 31 Oct 2025 15:48:15 +0000 (16:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:54:53 +0000 (13:54 +0100)
commit5a0060ddfc1fcfdb0f7b4fa1b7b3b0c436151391
tree8e91a5c46928e1bf52908d831bab4bc693bb0d71
parentae6e58069d8462bc055fdb8b15d19b748c71c1c4
drm/panthor: Fix UAF on kernel BO VA nodes

[ Upstream commit 98dd5143447af0ee33551776d8b2560c35d0bc4a ]

If the MMU is down, panthor_vm_unmap_range() might return an error.
We expect the page table to be updated still, and if the MMU is blocked,
the rest of the GPU should be blocked too, so no risk of accessing
physical memory returned to the system (which the current code doesn't
cover for anyway).

Proceed with the rest of the cleanup instead of bailing out and leaving
the va_node inserted in the drm_mm, which leads to UAF when other
adjacent nodes are removed from the drm_mm tree.

Reported-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Closes: https://gitlab.freedesktop.org/panfrost/linux/-/issues/57
Fixes: 8a1cc07578bf ("drm/panthor: Add GEM logical block")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20251031154818.821054-2-boris.brezillon@collabora.com
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panthor/panthor_gem.c