From: sashiko-bot@kernel.org
To: "Melissa Wen" <mwen@igalia.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 7/7] drm/amd/display: allow individual colorop changes
Date: Tue, 09 Jun 2026 12:50:47 +0000 [thread overview]
Message-ID: <20260609125048.1CA4F1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609121230.1358786-8-mwen@igalia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Critical] Potential NULL pointer dereference when accessing `blob->length` in `__set_dm_plane_colorop_3x4_matrix` if the data blob is NULL.
--
commit f99935be74382989d52703e3315aeec4d0efd059
Author: Melissa Wen <mwen@igalia.com>
drm/amd/display: allow individual colorop changes
Change all colorop helpers to get the committed state if there's no new
state for a given colorop. This allows userspace to modify a single
property of a colorop without resubmitting the whole color pipeline by
falling back to colorop settings from the committed state.
> 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 2d91d88a45742..51bd937153d41 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
[ ... ]
> @@ -1561,43 +1550,37 @@ __set_dm_plane_colorop_3x4_matrix(struct drm_plane_state *plane_state,
[ ... ]
> + 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: Critical]
This is a pre-existing issue, but could this lead to a NULL pointer
dereference if the data blob is missing?
If userspace configures a 3x4 matrix colorop with bypass set to false but
doesn't provide a valid data blob, the DRM core might leave colorop_state->data
as NULL. Dereferencing blob->length here without checking if blob is valid
would then crash the system.
Should __set_dm_plane_colorop_3x4_matrix() explicitly check if blob is not NULL
before attempting to access its length?
> + ctm = (struct drm_color_ctm_3x4 *) blob->data;
> + __drm_ctm_3x4_to_dc_matrix(ctm, dc_plane_state->gamut_remap_matrix.matrix);
> + dc_plane_state->gamut_remap_matrix.enable_remap = true;
> + dc_plane_state->input_csc_color_matrix.enable_adjustment = false;
> + } else {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609121230.1358786-1-mwen@igalia.com?part=7
next prev parent reply other threads:[~2026-06-09 12:50 UTC|newest]
Thread overview: 21+ 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-25 22:28 ` John Harrison
2026-07-20 11:06 ` Melissa Wen
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-25 22:38 ` John Harrison
2026-07-20 11:40 ` Melissa Wen
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-25 22:52 ` John Harrison
2026-07-20 11:28 ` 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
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 [this message]
2026-06-24 20:54 ` [PATCH v3 0/7] don't allow changes to inactive colorops Harry Wentland
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=20260609125048.1CA4F1F00893@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox