Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maxime Ripard" <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org, neil.armstrong@linaro.org,
	linux-amlogic@lists.infradead.org
Subject: Re: [PATCH v2 56/78] drm/meson: encoder_hdmi: Switch to atomic_create_state
Date: Fri, 14 Aug 2026 01:35:31 +0000	[thread overview]
Message-ID: <20260814013535.C90D71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260608-drm-no-more-bridge-reset-v2-56-0a91018bf886@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Error paths in `meson_encoder_hdmi_probe` fail to remove the bridge from the global `bridge_list` after it has been added, leading to a Use-After-Free (UAF).
--

--- Patch [56]: [PATCH v2 56/78] drm/meson: encoder_hdmi: Switch to atomic_create_state ---
commit ab73d61f7642f9fa6c7c0313f79338a817383c72
Author: Maxime Ripard <mripard@kernel.org>

drm/meson: encoder_hdmi: Switch to atomic_create_state

This commit removes the deprecated drm_bridge_funcs.atomic_reset callback
and its drm_atomic_helper_bridge_reset() helper. It switches to the
atomic_create_state callback instead.

> diff --git a/drivers/gpu/drm/meson/meson_encoder_hdmi.c b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> index 55c0601df3c62..0c7a72cb514ae 100644
> --- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> +++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c
> @@ -366,7 +366,7 @@ static const struct drm_bridge_funcs meson_encoder_hdmi_bridge_funcs = {
>  	.atomic_check = meson_encoder_hdmi_atomic_check,
>  	.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
>  	.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> -	.atomic_reset = drm_atomic_helper_bridge_reset,
> +	.atomic_create_state = drm_atomic_helper_bridge_create_state,
>  };
>  
>  int meson_encoder_hdmi_probe(struct meson_drm *priv)

[Severity: High]
This isn't a bug introduced by this patch, but does the error handling in
meson_encoder_hdmi_probe() fail to remove the bridge from the global list?

When the bridge is added:

	drm_bridge_add(&meson_encoder_hdmi->bridge);

	meson_encoder_hdmi->priv = priv;

	/* Encoder */
	ret = drm_simple_encoder_init(priv->drm, &meson_encoder_hdmi->encoder,
				      DRM_MODE_ENCODER_TMDS);
	if (ret) {
		dev_err_probe(priv->dev, ret, "Failed to init HDMI encoder\n");
		goto err_put_node;
	}

If an error occurs, the code jumps to err_put_node, which does not call
drm_bridge_remove().

Since devm cleanup will eventually free the memory, does leaving the freed
bridge linked in bridge_list cause a use-after-free when subsequent drivers
call of_drm_find_and_get_bridge()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260608-drm-no-more-bridge-reset-v2-0-0a91018bf886@kernel.org?part=56

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-08-14  1:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 14:35 [PATCH v2 00/78] drm/bridge: Convert all reset users to create_state Maxime Ripard
2026-06-08 14:36 ` [PATCH v2 54/78] drm/meson: encoder_cvbs: Switch to atomic_create_state Maxime Ripard
2026-08-14  1:22   ` sashiko-bot
2026-06-08 14:36 ` [PATCH v2 55/78] drm/meson: encoder_dsi: " Maxime Ripard
2026-06-08 14:36 ` [PATCH v2 56/78] drm/meson: encoder_hdmi: " Maxime Ripard
2026-08-14  1:35   ` sashiko-bot [this message]
2026-06-18 11:20 ` [PATCH v2 00/78] drm/bridge: Convert all reset users to create_state Maxime Ripard
2026-06-18 13:38   ` Luca Ceresoli

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=20260814013535.C90D71F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox