From: sashiko-bot@kernel.org
To: "Melissa Wen" <mwen@igalia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 4/7] drm/amd/display: truly bypass plane colorop 3x4 matrix and hdr mult
Date: Tue, 09 Jun 2026 12:33:13 +0000 [thread overview]
Message-ID: <20260609123314.4C5B91F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609121230.1358786-5-mwen@igalia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Dereference of `blob->length` when `blob` is NULL in `__set_dm_plane_colorop_3x4_matrix`.
--
commit e38d376afd75d8310bd23096e9f3d253c0d99c70
Author: Melissa Wen <mwen@igalia.com>
drm/amd/display: truly bypass plane colorop 3x4 matrix and hdr mult
This commit addresses a latent issue where the driver skips programming the
3x4 matrix and hdr multiplier blocks on bypass. It updates the driver to
explicitly reset these blocks to their default values if the bypass
property is set.
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> index 86086d10c5435..13ad7ac1e35e4 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
> @@ -1579,7 +1579,13 @@ __set_dm_plane_colorop_3x4_matrix(struct drm_plane_state *plane_state,
> }
> }
>
> - if (colorop_state && !colorop_state->bypass && colorop->type == DRM_COLOROP_CTM_3X4) {
> + if (colorop_state && colorop->type == DRM_COLOROP_CTM_3X4) {
> + if (colorop_state->bypass) {
> + dc_plane_state->gamut_remap_matrix.enable_remap = false;
> + dc_plane_state->input_csc_color_matrix.enable_adjustment = false;
> + return 0;
> + }
> +
> drm_dbg(dev, "3x4 matrix colorop with ID: %d\n", colorop->base.id);
> blob = colorop_state->data;
> if (blob->length == sizeof(struct drm_color_ctm_3x4)) {
[Severity: High]
This isn't a bug introduced by this patch, but can blob be NULL here when
colorop_state->bypass is false?
Looking at __set_dm_plane_colorop_3x4_matrix(), the DRM API allows userspace
to unset the data property (for instance, by passing 0 for the blob ID).
This would result in colorop_state->data being NULL.
If userspace sets bypass to false while providing no data blob, would the
unconditional dereference of blob->length lead to a NULL pointer dereference
and a kernel crash?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609121230.1358786-1-mwen@igalia.com?part=4
next prev parent reply other threads:[~2026-06-09 12:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 11:51 [PATCH v3 0/7] don't allow changes to inactive colorops Melissa Wen
2026-06-09 11:51 ` [PATCH v3 1/7] drm/atomic: only add states of active or transient active colorops Melissa Wen
2026-06-09 12:33 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 2/7] drm/atomic: reject colorop update from inactive color pipeline Melissa Wen
2026-06-09 12:37 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 3/7] drm/amd/display: don't check colorop status if its in an inactive pipeline Melissa Wen
2026-06-09 11:51 ` [PATCH v3 4/7] drm/amd/display: truly bypass plane colorop 3x4 matrix and hdr mult Melissa Wen
2026-06-09 12:33 ` sashiko-bot [this message]
2026-06-09 11:51 ` [PATCH v3 5/7] drm/amd/display: make shaper bypass mode cleaner Melissa Wen
2026-06-09 12:32 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 6/7] drm/amd/display: fix bnld colorop bypass mode Melissa Wen
2026-06-09 12:51 ` sashiko-bot
2026-06-09 11:51 ` [PATCH v3 7/7] drm/amd/display: allow individual colorop changes Melissa Wen
2026-06-09 12:50 ` sashiko-bot
2026-06-09 12:50 ` ✗ CI.checkpatch: warning for don't allow changes to inactive colorops (rev3) Patchwork
2026-06-09 12:51 ` ✓ CI.KUnit: success " Patchwork
2026-06-09 13:32 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-09 13:36 ` ✓ i915.CI.BAT: " Patchwork
2026-06-10 2:08 ` ✗ 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=20260609123314.4C5B91F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mwen@igalia.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 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.