From: sashiko-bot@kernel.org
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4 2/3] drm/xe/ggtt: Initialize GGTT pools by SR-IOV mode
Date: Tue, 01 Sep 2026 16:53:33 +0000 [thread overview]
Message-ID: <20260901165334.10B451F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260901164435.1395260-3-piotr.piorkowski@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Integer overflow in GGTT bounds check enables out-of-bounds memory access.
--
commit f9f8d4706aa1161e82f40e54588776b342483570
Author: Piotr Piórkowski <piotr.piorkowski@intel.com>
drm/xe/ggtt: Initialize GGTT pools by SR-IOV mode
This commit separates GGTT range discovery from pool setup and initializes
the usable and shareable pools based on the SR-IOV mode.
> diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
> index fa77abbb3cd5a..7d22b0cbcaec6 100644
> --- a/drivers/gpu/drm/xe/xe_ggtt.c
> +++ b/drivers/gpu/drm/xe/xe_ggtt.c
[ ... ]
> +static int ggtt_get_range_from_guc(struct xe_ggtt *ggtt, u64 *start, u64 *size)
> +{
> + struct xe_device *xe = tile_to_xe(ggtt->tile);
> + u64 wopcm = xe_wopcm_size(xe);
> +
> + *start = xe_tile_sriov_vf_ggtt_base(ggtt->tile);
> + *size = xe_tile_sriov_vf_ggtt(ggtt->tile);
> +
> + if (*start < wopcm || *start + *size > GUC_GGTT_TOP) {
[Severity: High]
This isn't a bug introduced by this patch, but is there a risk of an integer
overflow occurring in this bounds check?
If a compromised PF or malicious GuC firmware provides extremely large values
for the start and size parameters via GUC_KLV_VF_CFG_GGTT_START_KEY, could
*start + *size wrap around to a small value? If this happens, the sum might
evaluate to less than GUC_GGTT_TOP, which would successfully bypass this
boundary check despite being invalid.
If bypassed, the overflowed start address would later be applied as an
offset during operations like xe_ggtt_insert_node(). This could result in
indexing out-of-bounds into the ggtt->gsm array, leading to kernel memory
corruption or a kernel panic. In Confidential Compute environments, this
might provide a host-to-guest escalation vector.
> + xe_tile_err(ggtt->tile, "Invalid GGTT configuration: %#llx-%#llx\n",
> + *start, *start + *size - 1);
> + return -ERANGE;
> + }
> +
> + return 0;
> +}
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260901164435.1395260-1-piotr.piorkowski@intel.com?part=2
next prev parent reply other threads:[~2026-09-01 16:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 16:44 [PATCH v4 0/3] Separate GGTT pools for submissions and VFs provisioning Piórkowski, Piotr
2026-09-01 16:44 ` [PATCH v4 1/3] drm/xe/ggtt: Split GGTT into usable and shareable pools Piórkowski, Piotr
2026-09-02 17:59 ` Michal Wajdeczko
2026-09-03 16:14 ` Piotr Piórkowski
2026-09-01 16:44 ` [PATCH v4 2/3] drm/xe/ggtt: Initialize GGTT pools by SR-IOV mode Piórkowski, Piotr
2026-09-01 16:53 ` sashiko-bot [this message]
2026-09-02 18:07 ` Michal Wajdeczko
2026-09-01 16:44 ` [PATCH v4 3/3] drm/xe/ggtt: Add KUnit tests for usable and shareable pools Piórkowski, Piotr
2026-09-02 18:21 ` Michal Wajdeczko
2026-09-01 16:51 ` ✗ CI.checkpatch: warning for Separate GGTT pools for submissions and VFs provisioning (rev4) Patchwork
2026-09-01 16:53 ` ✓ CI.KUnit: success " Patchwork
2026-09-01 17:35 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-01 19:38 ` ✓ 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=20260901165334.10B451F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=piotr.piorkowski@intel.com \
--cc=sashiko-reviews@lists.linux.dev \
/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