mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kuogee Hsieh <quic_khsieh@quicinc.com>
To: Johan Hovold <johan+linaro@kernel.org>,
	Douglas Anderson <dianders@chromium.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	"Rob Clark" <robdclark@gmail.com>,
	Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: <dri-devel@lists.freedesktop.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Daniel Vetter <daniel@ffwll.ch>, Jonas Karlman <jonas@kwiboo.se>,
	<linux-arm-msm@vger.kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Stephen Boyd <swboyd@chromium.org>,
	Robert Foss <robert.foss@linaro.org>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	<stable@vger.kernel.org>, Sean Paul <sean@poorly.run>,
	Steev Klimaszewski <steev@kali.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Subject: Re: [Freedreno] [PATCH v2 01/10] drm/msm: fix use-after-free on probe deferral
Date: Thu, 22 Sep 2022 12:48:49 -0700	[thread overview]
Message-ID: <668ebc3a-b731-cd0c-0f60-ba9faabbf978@quicinc.com> (raw)
In-Reply-To: <20220913085320.8577-2-johan+linaro@kernel.org>


On 9/13/2022 1:53 AM, Johan Hovold wrote:
> The bridge counter was never reset when tearing down the DRM device so
> that stale pointers to deallocated structures would be accessed on the
> next tear down (e.g. after a second late bind deferral).
>
> Given enough bridges and a few probe deferrals this could currently also
> lead to data beyond the bridge array being corrupted.
>
> Fixes: d28ea556267c ("drm/msm: properly add and remove internal bridges")
> Fixes: a3376e3ec81c ("drm/msm: convert to drm_bridge")
> Cc: stable@vger.kernel.org      # 3.12
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>

> ---
>   drivers/gpu/drm/msm/msm_drv.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 391d86b54ded..d254fe2507ec 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -241,6 +241,7 @@ static int msm_drm_uninit(struct device *dev)
>   
>   	for (i = 0; i < priv->num_bridges; i++)
>   		drm_bridge_remove(priv->bridges[i]);
> +	priv->num_bridges = 0;
>   
>   	pm_runtime_get_sync(dev);
>   	msm_irq_uninstall(ddev);

  reply	other threads:[~2022-09-22 19:50 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13  8:53 [PATCH v2 00/10] drm/msm: probe deferral fixes Johan Hovold
2022-09-13  8:53 ` [PATCH v2 01/10] drm/msm: fix use-after-free on probe deferral Johan Hovold
2022-09-22 19:48   ` Kuogee Hsieh [this message]
2022-09-22 20:01   ` [Freedreno] " Kuogee Hsieh
2022-09-13  8:53 ` [PATCH v2 02/10] drm/msm/dp: fix memory corruption with too many bridges Johan Hovold
2022-09-22 19:51   ` [Freedreno] " Kuogee Hsieh
2022-09-22 19:54   ` Dmitry Baryshkov
2022-09-13  8:53 ` [PATCH v2 03/10] drm/msm/dsi: " Johan Hovold
2022-09-22 19:51   ` Kuogee Hsieh
2022-09-22 19:54   ` Dmitry Baryshkov
2022-09-13  8:53 ` [PATCH v2 04/10] drm/msm/hdmi: " Johan Hovold
2022-09-22 19:52   ` [Freedreno] " Kuogee Hsieh
2022-09-22 19:54   ` Dmitry Baryshkov
2022-09-13  8:53 ` [PATCH v2 05/10] drm/msm/dp: fix IRQ lifetime Johan Hovold
2022-09-22 19:54   ` [Freedreno] " Kuogee Hsieh
2022-09-13  8:53 ` [PATCH v2 06/10] drm/msm/dp: fix aux-bus EP lifetime Johan Hovold
2022-09-13 12:36   ` Doug Anderson
2022-09-13  8:53 ` [PATCH v2 07/10] drm/msm/dp: fix bridge lifetime Johan Hovold
2022-09-22 19:56   ` [Freedreno] " Kuogee Hsieh
2022-09-13  8:53 ` [PATCH v2 08/10] drm/msm/hdmi: fix IRQ lifetime Johan Hovold
2022-09-22 19:55   ` Kuogee Hsieh
2022-09-23  6:17     ` Johan Hovold
2022-09-13  8:53 ` [PATCH v2 09/10] drm/msm/dp: drop modeset sanity checks Johan Hovold
2022-09-22 19:57   ` Kuogee Hsieh
2022-09-26 18:17   ` Abhinav Kumar
2022-09-27  7:14     ` Johan Hovold
2022-09-27 18:42       ` Abhinav Kumar
2022-09-28 12:24         ` Johan Hovold
2022-09-28 15:33           ` Abhinav Kumar
2022-09-28 15:57             ` Johan Hovold
2022-09-13  8:53 ` [PATCH v2 10/10] drm/msm/dsi: " Johan Hovold
2022-09-22 19:58   ` [Freedreno] " Kuogee Hsieh
2022-09-26 18:21   ` Abhinav Kumar
2022-09-27  7:16     ` Johan Hovold
2022-09-27 18:44       ` Abhinav Kumar
2022-09-13 20:23 ` [PATCH v2 00/10] drm/msm: probe deferral fixes Steev Klimaszewski
2022-09-14  6:01   ` Johan Hovold
2022-09-16 16:43     ` Steev Klimaszewski
2022-09-20  9:06 ` Johan Hovold
2022-10-21  6:27   ` Johan Hovold
2022-10-21 16:05     ` Abhinav Kumar
2022-10-24 11:33       ` Johan Hovold
2022-10-24 15:01         ` Rob Clark

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=668ebc3a-b731-cd0c-0f60-ba9faabbf978@quicinc.com \
    --to=quic_khsieh@quicinc.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=andersson@kernel.org \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=johan+linaro@kernel.org \
    --cc=jonas@kwiboo.se \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=robert.foss@linaro.org \
    --cc=sean@poorly.run \
    --cc=stable@vger.kernel.org \
    --cc=steev@kali.org \
    --cc=swboyd@chromium.org \
    /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

all inboxes | Powered by JetHome®