Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Fix NULL pointer dereference in xe_exec_ioctl
@ 2025-12-17  6:17 Tapani Pälli
  2025-12-17  8:00 ` ✓ CI.KUnit: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Tapani Pälli @ 2025-12-17  6:17 UTC (permalink / raw)
  To: intel-xe; +Cc: matthew.brost, Tapani Pälli

Helper function xe_sync_needs_wait expects sync->fence when accessing
flags, patch makes sure we call only when sync->fence exists.

Fixes NULL pointer dereference seen with Vulkan workloads:

[  118.410401] RIP: 0010:xe_sync_needs_wait+0x27/0x50 [xe]

Fixes: 4ac9048d0501 ("drm/xe: Wait on in-syncs when swicthing to dma-fence mode")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
---
 drivers/gpu/drm/xe/xe_exec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index 730a5c9c2637..ea368f02cb9f 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -184,7 +184,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
 		if (xe_sync_is_ufence(&syncs[num_syncs]))
 			num_ufence++;
 
-		if (!num_in_sync && xe_sync_needs_wait(&syncs[num_syncs]))
+		if (!num_in_sync && syncs[num_syncs].fence &&
+		    xe_sync_needs_wait(&syncs[num_syncs]))
 			num_in_sync++;
 	}
 
-- 
2.52.0


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

end of thread, other threads:[~2025-12-18 14:16 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17  6:17 [PATCH] drm/xe: Fix NULL pointer dereference in xe_exec_ioctl Tapani Pälli
2025-12-17  8:00 ` ✓ CI.KUnit: success for " Patchwork
2025-12-17  9:01 ` ✓ Xe.CI.BAT: " Patchwork
2025-12-17 10:27 ` [PATCH] " Matthew Auld
2025-12-17 10:31   ` Matthew Auld
2025-12-17 10:51     ` Tapani Pälli
2025-12-17 11:42       ` Tapani Pälli
2025-12-17 11:51       ` Matthew Auld
2025-12-17 12:22         ` Tapani Pälli
2025-12-17 12:32           ` [PATCH v2] " Tapani Pälli
2025-12-17 12:57             ` Matthew Auld
2025-12-17 13:21               ` Tapani Pälli
2025-12-17 13:24                 ` [PATCH v3] " Tapani Pälli
2025-12-17 14:56                   ` Matthew Auld
2025-12-17 21:04                     ` Matthew Brost
2025-12-17 21:16           ` [PATCH] " Matthew Brost
2025-12-17 13:10 ` ✓ CI.KUnit: success for drm/xe: Fix NULL pointer dereference in xe_exec_ioctl (rev2) Patchwork
2025-12-17 13:48 ` ✓ Xe.CI.BAT: " Patchwork
2025-12-17 15:43 ` ✓ CI.KUnit: success for drm/xe: Fix NULL pointer dereference in xe_exec_ioctl (rev3) Patchwork
2025-12-17 16:23 ` ✓ Xe.CI.BAT: " Patchwork
2025-12-18 14:16 ` ✗ Xe.CI.Full: failure " Patchwork

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