Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/xe: Guard against NULL return for xe_device_get_gt
@ 2025-09-26 15:59 Jonathan Cavitt
  2025-09-26 15:59 ` [PATCH 1/5] drm/xe: Guard against NULL GT in xe_sriov_vf.c Jonathan Cavitt
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Jonathan Cavitt @ 2025-09-26 15:59 UTC (permalink / raw)
  To: intel-xe; +Cc: jonathan.cavitt, saurabhg.gupta, alex.zuo, michal.wajdeczko

Static analysis reveals the following issue:
xe_device_get_gt is theoretically able to return NULL in some cases, but
several use cases don't check the return value before performing a
dereference, resulting in a NULL pointer dereference.

In many cases, this can be prevented by using xe_root_mmio_gt instead of
xe_device_get_gt.  Add guards for all other cases.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>

Jonathan Cavitt (5):
  drm/xe: Guard against NULL GT in xe_sriov_vf.c
  drm/xe: Guard against NULL GT in xe_pmu.c
  drm/xe: Don't call xe_device_get_gt twice in xe_hw_engine_lookup
  drm/xe: Guard against NULL GT in xe_guc.c
  drm/xe/tests: Use xe_root_mmio_gt instead of xe_device_get_gt

 drivers/gpu/drm/xe/tests/xe_guc_buf_kunit.c   | 2 +-
 drivers/gpu/drm/xe/tests/xe_guc_db_mgr_test.c | 2 +-
 drivers/gpu/drm/xe/tests/xe_guc_g2g_test.c    | 2 +-
 drivers/gpu/drm/xe/tests/xe_guc_id_mgr_test.c | 2 +-
 drivers/gpu/drm/xe/tests/xe_guc_relay_test.c  | 2 +-
 drivers/gpu/drm/xe/xe_guc.c                   | 2 +-
 drivers/gpu/drm/xe/xe_hw_engine.c             | 3 +--
 drivers/gpu/drm/xe/xe_pmu.c                   | 9 ++++++++-
 drivers/gpu/drm/xe/xe_sriov_vf.c              | 7 ++++++-
 9 files changed, 21 insertions(+), 10 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-09-29 15:41 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-26 15:59 [PATCH 0/5] drm/xe: Guard against NULL return for xe_device_get_gt Jonathan Cavitt
2025-09-26 15:59 ` [PATCH 1/5] drm/xe: Guard against NULL GT in xe_sriov_vf.c Jonathan Cavitt
2025-09-26 18:10   ` Michal Wajdeczko
2025-09-26 15:59 ` [PATCH 2/5] drm/xe: Guard against NULL GT in xe_pmu.c Jonathan Cavitt
2025-09-26 18:26   ` Michal Wajdeczko
2025-09-29 10:40   ` Upadhyay, Tejas
2025-09-29 15:41     ` Cavitt, Jonathan
2025-09-26 15:59 ` [PATCH 3/5] drm/xe: Don't call xe_device_get_gt twice in xe_hw_engine_lookup Jonathan Cavitt
2025-09-26 18:28   ` Michal Wajdeczko
2025-09-26 15:59 ` [PATCH 4/5] drm/xe: Guard against NULL GT in xe_guc.c Jonathan Cavitt
2025-09-26 18:36   ` Michal Wajdeczko
2025-09-26 19:26     ` Matt Roper
2025-09-26 22:04       ` Michal Wajdeczko
2025-09-26 15:59 ` [PATCH 5/5] drm/xe/tests: Use xe_root_mmio_gt instead of xe_device_get_gt Jonathan Cavitt
2025-09-26 18:46   ` Michal Wajdeczko
2025-09-26 16:06 ` ✓ CI.KUnit: success for drm/xe: Guard against NULL return for xe_device_get_gt Patchwork
2025-09-26 16:42 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-26 23:52 ` ✓ Xe.CI.Full: " Patchwork

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