From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Mika Kuoppala" <mika.kuoppala@linux.intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>
Subject: [PATCH] drm/xe: Fix overflow in guc_ct_snapshot_capture
Date: Wed, 4 Mar 2026 23:17:28 +0200 [thread overview]
Message-ID: <20260304211728.249104-1-mika.kuoppala@linux.intel.com> (raw)
In-Reply-To: <20260304112501.230992-1-mika.kuoppala@linux.intel.com>
snapshot->ctb is u32*, so pointer arithmetic on it scales
the byte offset from xe_bo_size() by 4, overshooting the
intended start of the g2h portion and writing past the
allocated buffer.
Fix this by using void * to get the arithmetic right and
prevent future mishaps.
v2: s/u8/void for memcpy and iosys_map consistency (Matt)
Fixes: af3de6cf06f9 ("drm/xe: Split H2G and G2H into separate buffer objects")
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-xe@lists.freedesktop.org
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
drivers/gpu/drm/xe/xe_guc_ct_types.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_ct_types.h b/drivers/gpu/drm/xe/xe_guc_ct_types.h
index 46ad1402347d..5da1ce5dc372 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct_types.h
+++ b/drivers/gpu/drm/xe/xe_guc_ct_types.h
@@ -74,7 +74,7 @@ struct xe_guc_ct_snapshot {
/** @ctb_size: size of the snapshot of the CTB */
size_t ctb_size;
/** @ctb: snapshot of the entire CTB */
- u32 *ctb;
+ void *ctb;
};
/**
--
2.43.0
next prev parent reply other threads:[~2026-03-04 21:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 11:25 [PATCH] drm/xe: Fix overflow in guc_ct_snapshot_capture Mika Kuoppala
2026-03-04 16:39 ` Matthew Brost
2026-03-04 18:39 ` Mika Kuoppala
2026-03-04 19:07 ` Matthew Brost
2026-03-04 21:17 ` Mika Kuoppala [this message]
2026-03-04 21:37 ` Matthew Brost
2026-03-04 21:46 ` ✓ CI.KUnit: success for " Patchwork
2026-03-05 5:35 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-05 10:59 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-03-05 22:08 ` ✓ CI.KUnit: success for drm/xe: Fix overflow in guc_ct_snapshot_capture (rev2) Patchwork
2026-03-05 22:46 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-06 16:04 ` ✓ Xe.CI.FULL: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260304211728.249104-1-mika.kuoppala@linux.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox