From: sashiko-bot@kernel.org
To: "Kory Maincent" <kory.maincent@bootlin.com>
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH RFC 04/12] drm/i915/display: Switch to drmm_mode_config_init() and drop manual cleanup
Date: Fri, 14 Aug 2026 00:15:24 +0000 [thread overview]
Message-ID: <20260814001525.047071F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260409-feat_link_cap-v1-4-7069e8199ce2@bootlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Deferring `intel_mode_config_cleanup` to a `drmm` action causes Use-After-Free (UAF) crashes during driver teardown because dependent resources are prematurely destroyed.
--
--- Patch [4]: [PATCH RFC 04/12] drm/i915/display: Switch to drmm_mode_config_init() and drop manual cleanup ---
commit 6ace97a8635ec8a367a634fb62172f65c853696d
Author: Kory Maincent <kory.maincent@bootlin.com>
drm/i915/display: Switch to drmm_mode_config_init() and drop manual cleanup
Replace drm_mode_config_init() with drmm_mode_config_init() in
intel_mode_config_init(). Remove the manual intel_mode_config_cleanup()
calls during teardown since the managed variant registers the cleanup with
devres automatically. Register intel_atomic_global_obj_cleanup() as a devres
action to run before drm_mode_config_cleanup().
> diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
> index 23bfecc983e8d..d02393053cef4 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_driver.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
[ ... ]
> @@ -618,8 +631,6 @@ void intel_display_driver_remove_noirq(struct intel_display *display)
>
> intel_hdcp_component_fini(display);
>
> - intel_mode_config_cleanup(display);
> -
> intel_dp_tunnel_mgr_cleanup(display);
>
> intel_overlay_cleanup(display);
[Severity: High]
Does deferring intel_mode_config_cleanup() here cause a use-after-free during
driver teardown?
Because intel_mode_config_cleanup() is removed here, mode config cleanup (which
frees connectors and encoders) is deferred to the asynchronous drmm phase.
However, intel_dp_tunnel_mgr_cleanup() and the destruction of the display
workqueues (which occur later in this function) still happen synchronously.
This inverts the teardown order so the tunnel manager and workqueues are freed
before the encoders that depend on them. When the deferred
drm_mode_config_cleanup() finally runs, it destroys encoders which triggers
intel_dp_tunnel_destroy(). This dereferences the dangling dp->tunnel pointer and
the already freed tunnel->group->mgr.
Additionally, because delayed works (like intel_dp->pps.panel_vdd_work) are
only cancelled during the deferred encoder cleanup in intel_pps_vdd_off_sync(),
their timers may fire after destroy_workqueue() has already freed the workqueue,
causing queue_work() to panic.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260409-feat_link_cap-v1-0-7069e8199ce2@bootlin.com?part=4
next prev parent reply other threads:[~2026-08-14 0:15 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 17:08 [PATCH RFC 00/12] Add support for DisplayPort link training information report Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 01/12] drm/i915/display/intel_sdvo: Fix double connector destroy in error paths Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 02/12] drm/i915/display/intel_lvds: Drop redundant manual cleanup on init failure Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 03/12] drm/i915/display/intel_dp: Drop redundant intel_dp_aux_fini() " Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 04/12] drm/i915/display: Switch to drmm_mode_config_init() and drop manual cleanup Kory Maincent
2026-08-14 0:15 ` sashiko-bot [this message]
2026-04-09 17:08 ` [PATCH RFC 05/12] drm/i915/display: Switch to managed for crtc Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 06/12] drm/i915/display: Switch to managed for plane Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 07/12] drm/i915/display: Switch to managed for encoder Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 08/12] drm/i915/display: Switch to managed for connector Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 09/12] drm: Introduce drmm_connector_dp_init() with link training state properties Kory Maincent
2026-04-09 21:53 ` Dmitry Baryshkov
2026-04-13 12:59 ` Kory Maincent
2026-04-13 13:59 ` Dmitry Baryshkov
2026-04-13 15:30 ` Kory Maincent
2026-04-10 16:20 ` Jani Nikula
2026-04-09 17:08 ` [PATCH RFC 10/12] drm/i915/display/dp: Adopt dp_connector helpers to expose link training state Kory Maincent
2026-04-10 16:26 ` Jani Nikula
2026-04-13 12:34 ` Kory Maincent
2026-04-13 13:05 ` Jani Nikula
2026-04-13 13:34 ` Kory Maincent
2026-04-13 13:44 ` Jani Nikula
2026-04-09 17:08 ` [PATCH RFC 11/12] drm/bridge: Wire drmm_connector_dp_init() via new DRM_BRIDGE_OP_DP flag Kory Maincent
2026-04-09 17:08 ` [PATCH RFC 12/12] drm/mediatek: Use dp_connector helpers to report link training state Kory Maincent
2026-04-09 20:36 ` [PATCH RFC 00/12] Add support for DisplayPort link training information report Ville Syrjälä
2026-04-09 21:36 ` Dmitry Baryshkov
2026-04-13 12:10 ` Kory Maincent
2026-04-13 13:29 ` Jani Nikula
2026-05-27 7:20 ` Manasi Navare
2026-05-27 7:24 ` Manasi Navare
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=20260814001525.047071F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=kory.maincent@bootlin.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