]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/etnaviv: reap idle mapping if it doesn't match the softpin address
authorLucas Stach <l.stach@pengutronix.de>
Thu, 14 Jul 2022 10:31:43 +0000 (12:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:16:00 +0000 (11:16 +0100)
commit2807f5dd0abbfc2a6dc87e88858be47119d4779e
tree6d9133ba3fe6c14b695c2aae23c762c8e989fe59
parentd829cafff5f1dc1b9a0ce0afbbef2fd30e65cfb1
drm/etnaviv: reap idle mapping if it doesn't match the softpin address

commit 332f847212e43d584019a8264895f25cf92aa647 upstream.

When a idle BO, which is held open by another process, gets freed by
userspace and subsequently referenced again by e.g. importing it again,
userspace may assign a different softpin VA than the last time around.
As the kernel GEM object still exists, we likely have a idle mapping
with the old VA still cached, if it hasn't been reaped in the meantime.

As the context matches, we then simply try to resurrect this mapping by
increasing the refcount. As the VA in this mapping does not match the
new softpin address, we consequently fail the otherwise valid submit.
Instead of failing, reap the idle mapping.

Cc: stable@vger.kernel.org # 5.19
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/etnaviv/etnaviv_gem.c