From: sashiko-bot@kernel.org
To: "Mohamed Ahmed" <mohamedahmedegypt2001@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 10/10] drm/nouveau: honor HF-EEODB EDIDs by converting to struct drm_edid
Date: Tue, 25 Aug 2026 00:27:53 +0000 [thread overview]
Message-ID: <20260825002754.2B9851F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825001408.14219-11-mohamedahmedegypt2001@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Potential out-of-bounds read when copying the EDID from a Device Tree property.
--
--- Patch [10]: [PATCH v3 10/10] drm/nouveau: honor HF-EEODB EDIDs by converting to struct drm_edid ---
commit a90c1b47260c1e8987750f3b4670510323a260f4
Author: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
drm/nouveau: honor HF-EEODB EDIDs by converting to struct drm_edid
This commit converts the nouveau driver to use the struct drm_edid API
instead of the legacy EDID APIs. This allows the driver to properly honor
HF-EEODB EDIDs by tracking their true block size instead of truncating them.
The patch updates various EDID retrieval and parsing paths to use the new
allocation and validation infrastructure.
> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
> index b0b0ad9a0c248..3738c23215c58 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
> @@ -490,8 +520,17 @@ nouveau_connector_of_detect(struct drm_connector *connector)
> int idx = name ? name[strlen(name) - 1] - 'A' : 0;
>
> if (nv_encoder->dcb->i2c_index == idx && edid) {
> - nv_connector->edid =
> - kmemdup(edid, EDID_LENGTH, GFP_KERNEL);
> + const struct drm_edid *drm_edid =
> + drm_edid_alloc(edid, EDID_LENGTH);
[Severity: High]
This isn't a bug introduced by this patch, but is it possible for the device
tree to provide an EDID property smaller than EDID_LENGTH?
In nouveau_connector_of_detect, of_get_property is called with a NULL length
pointer, discarding the actual size of the firmware property. If the property
is shorter than 128 bytes, drm_edid_alloc (and the previous kmemdup call)
will perform an out-of-bounds read which could potentially trigger a panic if
the memory access crosses an unmapped page boundary.
Would it make sense to pass a length pointer to of_get_property and verify
the property is at least EDID_LENGTH bytes before attempting to allocate it?
> +
> + /* Firmware-provided, so validate it like the DDC
> + * readers would.
> + */
> + if (drm_edid && !drm_edid_valid(drm_edid)) {
> + drm_edid_free(drm_edid);
> + drm_edid = NULL;
> + }
> + nouveau_connector_set_edid(nv_connector, drm_edid);
> return nv_encoder;
> }
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260825001408.14219-1-mohamedahmedegypt2001@gmail.com?part=10
prev parent reply other threads:[~2026-08-25 0:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 0:13 [PATCH v3 00/10] nouveau: assorted display fixes (GB20x, r570 DP_CONFIG_STREAM, HF-EEODB EDIDs) Mohamed Ahmed
2026-08-25 0:13 ` [PATCH v3 01/10] drm/nouveau/disp: move GSP head-timing ISR and vblank helpers to tu102.c Mohamed Ahmed
2026-08-25 0:13 ` Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 02/10] drm/nouveau/disp: move the GSP HDMI GCP AVMute write to engine/disp Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 03/10] drm/nouveau/disp: route GSP-RM display MMIO through nvkm_disp_func hooks Mohamed Ahmed
2026-08-25 0:25 ` sashiko-bot
2026-08-25 0:14 ` [PATCH v3 04/10] drm/nouveau/disp: fix HDMI vendor infoframes on GB20x Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 05/10] drm/nouveau/disp: fix HDMI GCP AVMute register offsets " Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 06/10] drm/nouveau/gsp: use per-version DP_CONFIG_STREAM params on r570 firmware Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 07/10] drm/nouveau/disp: fix head state readback on GB20x Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 08/10] drm/nouveau/gsp: fix vblank interrupts " Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 09/10] drm/nouveau/dispnv50: program pixel clocks above 2.147GHz " Mohamed Ahmed
2026-08-25 0:14 ` [PATCH v3 10/10] drm/nouveau: honor HF-EEODB EDIDs by converting to struct drm_edid Mohamed Ahmed
2026-08-25 0:27 ` sashiko-bot [this message]
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=20260825002754.2B9851F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mohamedahmedegypt2001@gmail.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.