Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe/guc: Fix CFI violation in debugfs access.

xe_guc_print_info is void-returning, but the function pointer it is
assigned to expects an int-returning function, leading to the following
CFI error:

[ 206.873690] CFI failure at guc_debugfs_show+0xa1/0xf0 [xe]
(target: xe_guc_print_info+0x0/0x370 [xe]; expected type: 0xbe3bc66a)

Fix this by updating xe_guc_print_info to return an integer.

Fixes: e15826bb3c2c ("drm/xe/guc: Refactor GuC debugfs initialization")
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: George D Sworo <george.d.sworo@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patch.msgid.link/20260129182547.32899-2-daniele.ceraolospurio@intel.com

+5 -3
+4 -2
drivers/gpu/drm/xe/xe_guc.c
··· 1672 1672 xe_guc_submit_unpause(guc); 1673 1673 } 1674 1674 1675 - void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p) 1675 + int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p) 1676 1676 { 1677 1677 struct xe_gt *gt = guc_to_gt(guc); 1678 1678 u32 status; ··· 1683 1683 if (!IS_SRIOV_VF(gt_to_xe(gt))) { 1684 1684 CLASS(xe_force_wake, fw_ref)(gt_to_fw(gt), XE_FW_GT); 1685 1685 if (!fw_ref.domains) 1686 - return; 1686 + return -EIO; 1687 1687 1688 1688 status = xe_mmio_read32(&gt->mmio, GUC_STATUS); 1689 1689 ··· 1709 1709 1710 1710 drm_puts(p, "\n"); 1711 1711 xe_guc_submit_print(guc, p); 1712 + 1713 + return 0; 1712 1714 } 1713 1715 1714 1716 /**
+1 -1
drivers/gpu/drm/xe/xe_guc.h
··· 53 53 int xe_guc_self_cfg64(struct xe_guc *guc, u16 key, u64 val); 54 54 void xe_guc_irq_handler(struct xe_guc *guc, const u16 iir); 55 55 void xe_guc_sanitize(struct xe_guc *guc); 56 - void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p); 56 + int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p); 57 57 int xe_guc_reset_prepare(struct xe_guc *guc); 58 58 void xe_guc_reset_wait(struct xe_guc *guc); 59 59 void xe_guc_stop_prepare(struct xe_guc *guc);