Devicetree
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, dri-devel@lists.freedesktop.org,
	devicetree@vger.kernel.org, conor+dt@kernel.org,
	wsa+renesas@sang-engineering.com
Subject: Re: [PATCH 3/4] drm/bridge: display-connector: Support hardcoded EDID for VGA connectors
Date: Mon, 06 Jul 2026 02:38:49 +0300	[thread overview]
Message-ID: <1ad604017b0d28663842a86aa036340b@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260705214453.5195C1F000E9@smtp.kernel.org>

Hello,

This is the friendly mail bot of Laurent Pinchart. You have sent him
what appears to be an e-mail generated by an LLM. In order to preserve
his mental health, the e-mail has been automatically ignored.

Thank you,

Laurent's spam bot

On Sun, 05 Jul 2026 21:44:52 +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> 
> Pre-existing issues:
> - [High] Use-After-Free of devm-managed resources and missing asynchronous cleanup during device removal when the driver is unbound.
> --
> 
> commit 48f63e147d7554f73cd9df360e29fd0b0ddb5d8d
> Author: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> drm/bridge: display-connector: Support hardcoded EDID for VGA connectors
> 
> This commit adds support for parsing a hardcoded EDID blob from the device tree
> for VGA connectors when DDC signals are not connected. It also ensures that
> specifying both a DDC bus and a hardcoded EDID returns an error during probe.
> 
> > diff --git a/drivers/gpu/drm/bridge/display-connector.c b/drivers/gpu/drm/bridge/display-connector.c
> > index eb3412ec30a07..225a8e987d086 100644
> > --- a/drivers/gpu/drm/bridge/display-connector.c
> > +++ b/drivers/gpu/drm/bridge/display-connector.c
> 
> [ ... ]
> 
> > @@ -64,6 +67,9 @@ static enum drm_connector_status display_connector_detect(struct drm_bridge *bri
> >  	if (conn->bridge.ddc && drm_probe_ddc(conn->bridge.ddc))
> >  		return connector_status_connected;
> >  
> > +	if (conn->edid)
> > +		return connector_status_connected;
> > +
> 
> [Severity: High]
> This isn't a bug introduced by this patch, but does device removal have a
> use-after-free vulnerability when the driver is unbound via sysfs?
> 
> Looking at display_connector_detect() in 
> drivers/gpu/drm/bridge/display-connector.c, if the driver is bound and attached
> to a DRM encoder, and then unbound via sysfs:
> 
> 1. display_connector_remove() calls drm_bridge_remove() but does not call
>    disable_irq() or cancel_work_sync(&conn->hpd_work).
> 2. The bridge structure is kept alive because the DRM core still holds a
>    reference count.
> 3. The driver core's devres_release_all() runs and frees conn->hpd_gpio and
>    the IRQ.
> 
> If the DRM core then polls detect, it will execute display_connector_detect():
> 
> 	if (conn->hpd_gpio) {
> 		if (gpiod_get_value_cansleep(conn->hpd_gpio))
> 			...
> 
> Will this dereference the devres-freed conn->hpd_gpio?
> 
> Additionally, if the concurrent hpd_work executes, will it attempt to lock
> bridge->hpd_mutex which was already destroyed by drm_bridge_remove()?
> 
> >  	switch (conn->bridge.type) {
> >  	case DRM_MODE_CONNECTOR_DVIA:
> 
> [ ... ]
> 

  reply	other threads:[~2026-07-05 23:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-05 21:35 [PATCH 0/4] drm: bridge: display-connector: Support hardcoding EDID for VGA Laurent Pinchart
2026-07-05 21:35 ` [PATCH 1/4] dt-bindings: display: vga-connector: Allow hardcoding EDID Laurent Pinchart
2026-07-06  8:08   ` Geert Uytterhoeven
2026-07-06 10:03     ` Laurent Pinchart
2026-07-06  8:52   ` Maxime Ripard
2026-07-06  9:45     ` Laurent Pinchart
2026-07-06 15:40       ` Maxime Ripard
2026-07-06 16:02         ` Laurent Pinchart
2026-07-05 21:35 ` [PATCH 2/4] drm/bridge: display-connector: Fix I2C adapter resource leak Laurent Pinchart
2026-07-05 21:48   ` sashiko-bot
2026-07-05 23:38     ` Laurent Pinchart
2026-07-05 21:35 ` [PATCH 3/4] drm/bridge: display-connector: Support hardcoded EDID for VGA connectors Laurent Pinchart
2026-07-05 21:44   ` sashiko-bot
2026-07-05 23:38     ` Laurent Pinchart [this message]
2026-07-05 21:35 ` [PATCH 4/4] [DNI] arm64: dts: renesas: salvator: Add overlay for Dell P1911 VGA display Laurent Pinchart
2026-07-05 21:37   ` sashiko-bot
2026-07-05 23:39     ` Laurent Pinchart
2026-07-06  8:16   ` Geert Uytterhoeven
2026-07-06  9:48     ` Laurent Pinchart

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=1ad604017b0d28663842a86aa036340b@killaraus.ideasonboard.com \
    --to=laurent.pinchart+renesas@ideasonboard.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.com \
    /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