From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: neil.armstrong@linaro.org, linux-amlogic@lists.infradead.org
Subject: Re: [PATCH RESEND v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events
Date: Thu, 14 May 2026 12:35:34 +0000 [thread overview]
Message-ID: <20260514123535.31AE7C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260513-hpd-irq-events-v3-5-086857017f16@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Use-After-Free on device unbind due to uncancelled workqueue items.
--
commit c9a05fdb7ae95c5650ccfbbd12196c4169d2d1c4
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events
This commit updates the PMIC GLINK altmode driver to pass IRQ_HPD events
to the HPD bridge. This allows the events to be delivered to the DisplayPort
driver.
> diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
> --- a/drivers/soc/qcom/pmic_glink_altmode.c
> +++ b/drivers/soc/qcom/pmic_glink_altmode.c
> @@ -373,7 +373,11 @@ static void pmic_glink_altmode_worker(struct work_struct *work)
> else
> conn_status = connector_status_disconnected;
>
> - drm_aux_hpd_bridge_notify(&alt_port->bridge->dev, conn_status);
> + drm_aux_hpd_bridge_notify_extra(&alt_port->bridge->dev,
> + conn_status,
> + alt_port->hpd_irq ?
> + DRM_CONNECTOR_DP_IRQ_HPD :
> + DRM_CONNECTOR_NO_EXTRA_STATUS);
While reviewing this change, I noticed a pre-existing issue with the lifecycle
of this work item.
The altmode structure is allocated using devm_kzalloc, and multiple work
items like alt_port->work and altmode->enable_work are initialized, but they
are never explicitly canceled during device teardown.
When the device is unbound, devres automatically frees the altmode structure.
If this work item is pending or executing concurrently on the system workqueue
during unbind, could it dereference the freed altmode or alt_port structures
and cause a use-after-free?
Should a cancel_work_sync action be registered via devm_add_action_or_reset
to ensure these work items are flushed before the memory is freed?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260513-hpd-irq-events-v3-0-086857017f16@oss.qualcomm.com?part=5
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-05-14 12:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 18:23 [PATCH RESEND v3 0/6] drm: handle IRQ_HPD events correctly Dmitry Baryshkov
2026-05-13 18:23 ` [PATCH RESEND v3 1/6] drm/connector: report IRQ_HPD events to drm_connector_oob_hotplug_event() Dmitry Baryshkov
2026-05-14 10:44 ` sashiko-bot
2026-05-13 18:23 ` [PATCH RESEND v3 2/6] drm/bridge: pass down IRQ_HPD to the drivers Dmitry Baryshkov
2026-05-13 18:23 ` [PATCH RESEND v3 3/6] drm/bridge: aux-hpd: let drivers pass IRQ_HPD events Dmitry Baryshkov
2026-05-13 18:23 ` [PATCH RESEND v3 4/6] drm/msm: dp: handle the IRQ_HPD events reported by USB-C Dmitry Baryshkov
2026-05-14 12:06 ` sashiko-bot
2026-05-13 18:23 ` [PATCH RESEND v3 5/6] soc: qcom: pmic-glink-altmode: pass down HPD_IRQ events Dmitry Baryshkov
2026-05-14 12:35 ` sashiko-bot [this message]
2026-05-13 18:23 ` [PATCH RESEND v3 6/6] usb: typec: ucsi: huawei-gaokun: " Dmitry Baryshkov
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=20260514123535.31AE7C2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=linux-amlogic@lists.infradead.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