From: sashiko-bot@kernel.org
To: "Fei Shao" <fshao@chromium.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/display: bridge_connector: Drop redundant drm_edid_valid() check
Date: Fri, 04 Dec 2026 10:29:17 +0000 [thread overview]
Message-ID: <sashiko-outbox-249596@kernel.org> (raw)
In-Reply-To: <20261204-drm-bridge-edid-valid-v1-2-dbce73cc6f00@chromium.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/bridge: anx7625_edid_read() misses newly required
drm_edid_valid()
--
commit 90c025bc6b2845c990421730b8b24b3d153ac55e
Author: Fei Shao <fshao@chromium.org>
drm/display: bridge_connector: Drop redundant drm_edid_valid() check
This commit removes the drm_edid_valid() check from
drm_bridge_connector_get_modes_edid() and documents in drm_bridge.h that
bridges using drm_edid_alloc() must validate the EDID with drm_edid_valid().
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index 2202e60444449..c8406050226f0 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -342,10 +342,8 @@ static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector,
> goto no_edid;
>
> drm_edid = drm_bridge_edid_read(bridge, connector);
> - if (!drm_edid_valid(drm_edid)) {
> - drm_edid_free(drm_edid);
> + if (!drm_edid)
> goto no_edid;
> - }
>
> drm_edid_connector_update(connector, drm_edid);
> n = drm_edid_connector_add_modes(connector);
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index 12ca7f6fb5243..80a032cb9b444 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -489,10 +489,11 @@ struct drm_bridge_funcs {
> *
> * RETURNS:
> *
> - * An edid structure newly allocated with drm_edid_alloc() or returned
> - * from drm_edid_read() family of functions on success, or NULL
> - * otherwise. The caller is responsible for freeing the returned edid
> - * structure with drm_edid_free().
> + * A validated edid structure newly allocated with drm_edid_alloc() or
> + * returned from drm_edid_read() family of functions on success, or NULL
> + * otherwise. Bridges using drm_edid_alloc() shall validate it with
> + * drm_edid_valid(). The caller is responsible for freeing the returned
> + * edid structure with drm_edid_free().
> */
> const struct drm_edid *(*edid_read)(struct drm_bridge *bridge,
> struct drm_connector *connector);
[Severity: Medium]
Does anx7625_edid_read() need to be updated to call drm_edid_valid() as well?
In drivers/gpu/drm/bridge/analogix/anx7625.c, anx7625_edid_read() allocates
an uninitialized buffer with kmalloc() and wraps edid_num * ONE_BLOCK_SIZE
bytes via drm_edid_alloc() without calling drm_edid_valid().
If sp_tx_get_edid_block() reports more blocks than Block 0's edid->extensions
and the Block 1 read fails, sp_tx_edid_read() breaks out leaving up to 128
bytes uninitialized. Because drm_edid_is_valid() only validates
edid->extensions + 1 blocks, sp_tx_edid_read() still returns blocks_num + 1.
Previously, drm_edid_valid() in drm_bridge_connector_get_modes_edid() rejected
that size mismatch. Without it, _drm_edid_connector_property_update() copies
all drm_edid->size bytes into connector->edid_blob_ptr, exposing uninitialized
heap memory via sysfs and DRM_IOCTL_MODE_GETPROPBLOB.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-drm-bridge-edid-valid-v1-0-dbce73cc6f00@chromium.org?part=2
prev parent reply other threads:[~2026-12-04 10:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 10:11 [PATCH 0/2] drm/bridge: Drop redundant drm_edid_valid() check in bridge_connector Fei Shao
2026-12-04 10:11 ` [PATCH 1/2] drm/bridge: nxp-ptn3460: Validate EDID and free buffer in edid_read Fei Shao
2026-12-04 10:11 ` [PATCH 2/2] drm/display: bridge_connector: Drop redundant drm_edid_valid() check Fei Shao
2026-12-04 10:29 ` 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=sashiko-outbox-249596@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=fshao@chromium.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.