mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V1 1/2] accel/amdxdna: Disable BO import via flink
@ 2026-09-02 18:09 Lizhi Hou
  2026-09-02 18:09 ` [PATCH V1 2/2] accel/amdxdna: Fix potential deadlock in BO open and close callbacks Lizhi Hou
  2026-09-02 18:48 ` [PATCH V1 1/2] accel/amdxdna: Disable BO import via flink Max Zhen
  0 siblings, 2 replies; 6+ messages in thread
From: Lizhi Hou @ 2026-09-02 18:09 UTC (permalink / raw)
  To: ogabbay, quic_jhugo, dri-devel, mario.limonciello, karol.wachowski
  Cc: Lizhi Hou, linux-kernel, max.zhen, sonal.santan

Accessing abo->client in amdxdna_gem_del_bo_usage() may result in a
use-after-free when the BO is imported via flink.

Disable flink import by verifing that filp->driver_priv matches the client
stored in abo->client before accessing the client.

Fixes: 3cc5d7a59519 ("accel/amdxdna: Add carveout memory support for non-IOMMU systems")
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/accel/amdxdna/amdxdna_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
index 476649685e5a..1353393194e2 100644
--- a/drivers/accel/amdxdna/amdxdna_gem.c
+++ b/drivers/accel/amdxdna/amdxdna_gem.c
@@ -697,6 +697,8 @@ static int amdxdna_gem_obj_open(struct drm_gem_object *gobj, struct drm_file *fi
 	int ret;
 
 	guard(mutex)(&abo->lock);
+	if (abo->open_ref > 0 && filp->driver_priv != abo->client)
+		return -EPERM;
 	abo->open_ref++;
 	if (abo->open_ref > 1)
 		return 0;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-11 15:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-02 18:09 [PATCH V1 1/2] accel/amdxdna: Disable BO import via flink Lizhi Hou
2026-09-02 18:09 ` [PATCH V1 2/2] accel/amdxdna: Fix potential deadlock in BO open and close callbacks Lizhi Hou
2026-09-02 18:51   ` Max Zhen
2026-09-11 15:25     ` Lizhi Hou
2026-09-02 18:48 ` [PATCH V1 1/2] accel/amdxdna: Disable BO import via flink Max Zhen
2026-09-11 15:24   ` Lizhi Hou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®