From: sashiko-bot@kernel.org
To: "Raag Jadav" <raag.jadav@intel.com>
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v6 4/5] drm/xe/drm_ras: Wire up error threshold callbacks
Date: Wed, 19 Aug 2026 13:54:51 +0000 [thread overview]
Message-ID: <20260819135452.1AC051F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818135304.497098-5-raag.jadav@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing bounds validation for the user-provided `threshold` value in `set_correctable_error_threshold()`, violating the DRM RAS core API contract.
--
--- Patch [4]: [PATCH v6 4/5] drm/xe/drm_ras: Wire up error threshold callbacks ---
commit 07d0b2b18f83648184a377e573f78e416567ad07
Author: Raag Jadav <raag.jadav@intel.com>
drm/xe/drm_ras: Wire up error threshold callbacks
This commit wires up the get/set error threshold support in the xe driver to
drm_ras, allowing userspace to make use of this functionality via netlink.
> diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
> index 78184b6ea7d48..7f3695707611c 100644
> --- a/drivers/gpu/drm/xe/xe_drm_ras.c
> +++ b/drivers/gpu/drm/xe/xe_drm_ras.c
[ ... ]
> +static int set_correctable_error_threshold(struct drm_ras_node *ep, u32 error_id, u32 threshold)
> +{
> + struct xe_device *xe = ep->priv;
> + struct xe_drm_ras *ras = &xe->ras;
> + struct xe_drm_ras_counter *info = ras->info[DRM_XE_RAS_ERR_SEV_CORRECTABLE];
> +
> + if (!info || !info[error_id].name)
> + return -ENOENT;
> +
> + if (!xe->info.has_sysctrl)
> + return -EOPNOTSUPP;
> +
> + return xe_ras_set_threshold(xe, DRM_XE_RAS_ERR_SEV_CORRECTABLE, error_id, threshold);
[Severity: Medium]
Does this code need to validate the threshold bounds before passing it to the
firmware?
The set_error_threshold documentation in include/drm/drm_ras.h explicitly
states: "Driver is responsible for error threshold bounds checking."
Passing an unvalidated user-provided threshold directly to
xe_ras_set_threshold() and the system controller firmware might cause
unexpected behavior or denial-of-service conditions if the firmware does not
robustly handle edge cases like extremely large values or a threshold of 0.
> +}
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818135304.497098-1-raag.jadav@intel.com?part=4
next prev parent reply other threads:[~2026-08-19 13:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 13:52 [PATCH v6 0/5] Introduce error threshold to drm_ras Raag Jadav
2026-08-18 13:52 ` [PATCH v6 1/5] drm/ras: Cancel and free message on get counter failure Raag Jadav
2026-08-19 13:54 ` sashiko-bot
2026-08-18 13:52 ` [PATCH v6 2/5] drm/ras: Introduce error threshold Raag Jadav
2026-08-19 13:54 ` sashiko-bot
2026-08-18 13:52 ` [PATCH v6 3/5] drm/xe/ras: Add support for " Raag Jadav
2026-08-18 13:52 ` [PATCH v6 4/5] drm/xe/drm_ras: Wire up error threshold callbacks Raag Jadav
2026-08-19 13:54 ` sashiko-bot [this message]
2026-08-18 13:52 ` [PATCH v6 5/5] drm/xe/sysctrl: Reuse xe_sysctrl_create_command() Raag Jadav
2026-08-18 15:15 ` ✗ CI.checkpatch: warning for Introduce error threshold to drm_ras (rev6) Patchwork
2026-08-18 15:17 ` ✓ CI.KUnit: success " Patchwork
2026-08-18 16:04 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-18 19:27 ` ✗ Xe.CI.FULL: failure " 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=20260819135452.1AC051F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=raag.jadav@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