From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2343606A31C for ; Mon, 30 Nov 2026 07:09:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JY07v3tI Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38F7E10EC1B; Mon, 30 Nov 2026 07:09:19 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF23810E8E7 for ; Mon, 30 Nov 2026 07:09:12 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 9C851411B1; Mon, 30 Nov 2026 07:09:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E451F00898; Mon, 30 Nov 2026 07:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796022552; bh=oecseRTPlWlexVRcpOD3Di1jvTVf87N77M19Km1adyE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=JY07v3tIsdwrXiog30y3q8u8SXc0pGgcy/ZJx92Nah4wqQK2NHL/kzSR623AwJfgQ rGQ0ef79LKeGvaUY+Kch36+2BCTjvEvOoyo4bWEj5CUGOePDImM7ZnBWZhvKga/BL3 wHhEtz3WQwedkrkZpufY6vydOKrUPtxFAa1TuKR3R2+a6GKLgz538SX9Fs+5/dLhIs lmO/VJZVzCQr0r0gW4LPYdMl8J2I+EsUd0G67XRVXlIxO4Z9M2JeNPU1fE8WAN2frM NAfmEKC3oAqbg4eIdxr2qxsCURHxGNIv2fFFbrUTWJFPJ57vQkbshjaBW5HA9SUbci Z8RALQQabu53g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/9] drm/msm/dp: don't depopulate the eDP AUX bus on component unbind To: "Yuanjie Yang" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261130-dpu_unbind_rebind_display-v1-2-c335387de1bb@oss.qualcomm.com> References: <20261130-dpu_unbind_rebind_display-v1-0-c335387de1bb@oss.qualcomm.com> <20261130-dpu_unbind_rebind_display-v1-2-c335387de1bb@oss.qualcomm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 07:09:11 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] drm/msm/dp: use-after-free of dp->aux after msm_dp_display_remove() -- commit ffc44dc305e10f09be11226df97e5b2a91916044 Author: Yuanjie Yang drm/msm/dp: don't depopulate the eDP AUX bus on component unbind This commit stops calling of_dp_aux_depopulate_bus() in msm_dp_display_unbind() so that eDP AUX bus teardown is left to the devm action registered at probe time. > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp= /dp_display.c > index c0c150e2c5758..895174e047312 100644 > --- a/drivers/gpu/drm/msm/dp/dp_display.c > +++ b/drivers/gpu/drm/msm/dp/dp_display.c > @@ -239,8 +239,6 @@ static void msm_dp_display_unbind(struct device *dev,= struct device *master, > struct msm_dp_display_private *dp =3D dev_get_dp_display_private(dev); > struct msm_drm_private *priv =3D dev_get_drvdata(master); > =20 > - of_dp_aux_depopulate_bus(dp->aux); > - > msm_dp_aux_unregister(dp->aux); > dp->drm_dev =3D NULL; > dp->aux->drm_dev =3D NULL; [Severity: High] Does deferring AUX bus depopulation to the devm action cause a use-after-free of dp->aux during msm_dp_display_remove()? When the platform device is removed, msm_dp_display_remove() runs before devres_release_all(): drivers/gpu/drm/msm/dp/dp_display.c:msm_dp_display_remove() { struct msm_dp_display_private *dp =3D dev_get_dp_display_private(&pdev->de= v); component_del(&pdev->dev, &msm_dp_display_comp_ops); msm_dp_display_deinit_sub_modules(dp); platform_set_drvdata(pdev, NULL); } msm_dp_display_deinit_sub_modules() calls msm_dp_aux_put(dp->aux), which destroys aux->mutex and calls devm_kfree(aux->dev, aux). When devres_release_all() then runs the devm_of_dp_aux_populate_bus() cleanup action, of_dp_aux_depopulate_bus_void(dp->aux) dereferences aux->dev from the already-freed dp->aux and tears down the child AUX endpoint device after dp->aux and aux->mutex have been destroyed. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130-dpu_unbind= _rebind_display-v1-0-c335387de1bb@oss.qualcomm.com?part=3D2