From: sashiko-bot@kernel.org
To: "Chaitanya Kumar Borah" <chaitanya.kumar.borah@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [CI 8/9] drm/i915/color: Add color pipeline support for SDR planes
Date: Wed, 02 Sep 2026 08:34:50 +0000 [thread overview]
Message-ID: <20260902083451.67F341F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260902075417.656673-9-chaitanya.kumar.borah@intel.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
New issues:
- [High] Exposing the color pipeline for SDR planes to user-space causes visual corruption and hardware state mismatches because the underlying hardware programming functions still artificially restrict operations to HDR planes.
Pre-existing issues:
- [Critical] Dangling DRM object IDR pointer when colorop initialization fails (or on cleanup) leads to a Use-After-Free.
- [High] Missing NULL check after `kasprintf()` in `_intel_color_pipeline_plane_init()` leads to a NULL pointer dereference when string allocation fails.
--
commit 4a507c298b13a8efe368f825fd9f9b9e49485cef
Author: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
drm/i915/color: Add color pipeline support for SDR planes
Now that everything is in place expose the SDR plane color pipeline
to user-space.
> diff --git a/drivers/gpu/drm/i915/display/intel_color_pipeline.c b/drivers/gpu/drm/i915/display/intel_color_pipeline.c
> index 6cf8080ee8000..4ea1f34dfb10e 100644
> --- a/drivers/gpu/drm/i915/display/intel_color_pipeline.c
> +++ b/drivers/gpu/drm/i915/display/intel_color_pipeline.c
> @@ -155,17 +155,11 @@ int _intel_color_pipeline_plane_init(struct drm_plane *plane, struct drm_prop_en
>
> int intel_color_pipeline_plane_init(struct drm_plane *plane, enum pipe pipe)
> {
> - struct drm_device *dev = plane->dev;
> - struct intel_display *display = to_intel_display(dev);
> struct drm_prop_enum_list pipelines[MAX_COLOR_PIPELINES] = {};
> int len = 0;
> int ret = 0;
> int i;
>
> - /* Currently expose pipeline only for HDR planes */
> - if (!icl_is_hdr_plane(display, to_intel_plane(plane)->id))
> - return 0;
> -
[Severity: High]
Does removing this check cause unprogrammed hardware blocks to be activated?
By exposing the color pipeline to user-space for SDR planes, user-space can
configure the pipeline. If configured, glk_plane_color_ctl() sets the enable
bits (like PLANE_COLOR_PRE_CSC_GAMMA_ENABLE).
However, functions that program the LUT and CSC registers still appear to
skip SDR planes:
drivers/gpu/drm/i915/display/intel_color.c:xelpd_program_plane_pre_csc_lut() {
if (!icl_is_hdr_plane(display, plane))
return;
...
}
This early return pattern also exists in xelpd_load_plane_csc_matrix() and
xelpd_program_plane_post_csc_lut().
Could this regression lead to visual corruption or hardware state mismatches
if the pipeline is enabled but the registers are never programmed?
> /* Add pipeline consisting of transfer functions */
[Severity: High]
This is a pre-existing issue, but does _intel_color_pipeline_plane_init()
need to check the return value of kasprintf()?
In _intel_color_pipeline_plane_init():
list->name = kasprintf(GFP_KERNEL, "Color Pipeline %d", ...);
return 0;
If kasprintf() fails, list->name is NULL. When this is passed down during
property registration, drm_property_add_enum() calls strlen(name):
drivers/gpu/drm/drm_property.c:drm_property_add_enum() {
if (WARN_ON(strlen(name) >= DRM_PROP_NAME_LEN))
return -EINVAL;
...
}
Can this lead to a NULL pointer dereference under memory pressure?
> ret = _intel_color_pipeline_plane_init(plane, &pipelines[len], pipe);
> if (ret)
[Severity: Critical]
This is a pre-existing issue, but can a failure during colorop
initialization or destruction lead to a use-after-free?
When drm_plane_colorop_init() is called, it successfully registers the
colorop with the DRM core mode object IDR:
drivers/gpu/drm/drm_colorop.c:drm_plane_colorop_init() {
ret = drm_mode_object_add(dev, &colorop->base, DRM_MODE_OBJECT_COLOROP);
...
}
However, if an error occurs and intel_colorop_destroy() is called (such
as on the error path of _intel_color_pipeline_plane_init()), or when
drm_colorop_cleanup() is executed, the structure memory is freed but
drm_mode_object_unregister() is never called to remove the object from
the IDR.
Does this leave a dangling pointer in the mode object IDR that could be
accessed via the DRM_IOCTL_MODE_OBJ_GETPROPERTIES ioctl?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260902075417.656673-9-chaitanya.kumar.borah@intel.com?part=1
next prev parent reply other threads:[~2026-09-02 8:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 7:54 [CI 0/9] drm/i915/color: Add YUV Support in color pipeline Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 1/9] drm/i915/color: Add CSC on SDR plane " Chaitanya Kumar Borah
2026-09-02 8:34 ` sashiko-bot
2026-09-02 7:54 ` [CI 2/9] drm/i915/display: extract glk_plane_color_ctl_input_csc helper Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 3/9] drm/i915/display: simplify glk_plane_color_ctl_input_csc Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 4/9] drm/i915/display: Program CSC on SDR planes based on Fixed Matrix Colorop Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 5/9] drm/i915/color: Add support for 1D LUT in SDR planes Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 6/9] drm/i915/color: Extract HDR post-CSC LUT programming to helper function Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 7/9] drm/i915/color: Program Plane Post CSC registers for SDR planes Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 8/9] drm/i915/color: Add color pipeline support " Chaitanya Kumar Borah
2026-09-02 8:34 ` sashiko-bot [this message]
2026-09-02 7:54 ` [CI 9/9] drm/i915/color: Add YUV buffer support on HDR planes Chaitanya Kumar Borah
2026-09-02 8:28 ` sashiko-bot
2026-09-02 9:02 ` ✓ i915.CI.BAT: success for drm/i915/color: Add YUV Support in color pipeline Patchwork
2026-09-02 9:52 ` ✓ CI.KUnit: " Patchwork
2026-09-02 10:55 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-02 20:47 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-02 22:31 ` ✗ i915.CI.Full: " Patchwork
2026-09-07 8:14 ` ✓ i915.CI.Full: success " 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=20260902083451.67F341F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=chaitanya.kumar.borah@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.