From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385715; b=jsWDO+5icApEBOCpFoWibaXV28FpQ5+F2D9W8cxVWTGvkSWtGdXCU+nOytCVcuBhLBXP v55t540ULIg168CAqIMRsbyJmJiCJOfvTN1pr9G0HElwemFmyAaFgQEcFvFkliO5zwI5i b8zdz97vWWTQsMLJY3SUwznITpYHGHU56pH8DYhQ4XZ2RGukAGIzusYXZksznJwQ/mvgD v3KDFNrSiTy0M+qnJTJxImZhD6EFIyH5culiawExahtGjXpV3iBQgz1Z860g+29udgo43 RB547tObIg5qg4Sr8f+/19bFMUHTyJavk4FWarfSqPqrWOEZlUKpajAf3GOj1dLmUhQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385715; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=/J/RDSwjVVr8pxaHgsjz4rMB+wBoxr7o1ujVoE1YspY=; b=gDmGgw1HeMEGTOtzBv2lhwTm+zdKNTPOKo15IJX9tEdYgqZ+u9JWAT54zsaQ0P4CN1l3 m5s9WwqrJvwyQhT+BLo4RGO00s0u4vMdiOPnguTZqqdprDIAW0eVMS3FvM6Qa2ffzBWKg v75lUdYhujjuUE5/xA2AGRTKT8A7F7g1Sf4Ze0wopVhpd6QIHekFaEKwd5nkySPGGiIbk DjW6C+Xns5Lg46aNUmi4zGHF0biyIx0WUl1/R1SPw2kv5/TBA79zfhVV8O+w4yuPphwp3 A0GVu6K809kef1+N+5U0ZLu5t7B61w6W3seWu7GaCBvm0s8m2jcbIj22ferfHOGx40w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nUfeywyF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00E23606A322 for ; Fri, 4 Dec 2026 12:01:54 +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=nUfeywyF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9132B1F000CE; Fri, 4 Dec 2026 12:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796385714; bh=/J/RDSwjVVr8pxaHgsjz4rMB+wBoxr7o1ujVoE1YspY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=nUfeywyF2hQtx9SG4wKZFo+X9Mz/5c/01We1ErMDy3NYwGz+wBxes/+rwTQfR51kq 4eT5etD9wLNkgcRBiLOILqdMJRvrMNJ+Kbk6ggocxHgoTQ9Xv14Qx9w7NaGTOPXeBB CvDEHM4YgKW3lDP75nwcW+Vl6opfyK6yIlbwLQsCJM745sBlwqJ3sXk+3WvDvwRodo 354TJiP6N5FRr7/cVkHDZGk+gC0kWJkMdfzh3vQ64/9XTQs9snaCLqCUARCVQbOL// mnaw3+ji2Zw34ZFv07Y0++EH0Wq3U/LlaPgksPx51FjUp9unMCoMNr3l6l7ByOk39X e4vIQKFuJp1Kg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v10 5/5] drm/cix: add the Sky1 DisplayPort platform glue Reply-To: sashiko-reviews@lists.linux.dev To: "Luo Liu" Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204114332.280808-6-Luo.Liu@cixtech.com> References: <20261204114332.280808-1-Luo.Liu@cixtech.com> <20261204114332.280808-6-Luo.Liu@cixtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 12:01:54 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] drm/bridge: trilinear: unlocked device_link_remove() UAF on dp->dev - [Medium] drm/bridge: trilinear: missing dp->released check in dptx_bridge_mode_set() - [Low] drm/cix: bridge glue placed in top-level drm/cix/ instead of drm/bridge/ -- commit 1e4145188b36c3532088673583ce49d4b100b5b9 Author: Luo Liu drm/cix: add the Sky1 DisplayPort platform glue This commit adds the Cix Sky1 platform glue driver that maps the RCSU video adapter registers and binds the shared Trilinear DisplayPort bridge driver. [ ... ] > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index 61111d50b1c65..a1808db8b9c8a 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -311,6 +311,7 @@ source "drivers/gpu/drm/aspeed/Kconfig" > source "drivers/gpu/drm/ast/Kconfig" > source "drivers/gpu/drm/atmel-hlcdc/Kconfig" > source "drivers/gpu/drm/bridge/Kconfig" > +source "drivers/gpu/drm/cix/Kconfig" > source "drivers/gpu/drm/etnaviv/Kconfig" > source "drivers/gpu/drm/exynos/Kconfig" > source "drivers/gpu/drm/fsl-dcu/Kconfig" > diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile > index 2c6bc093a923a..6ed7456bb993a 100644 > --- a/drivers/gpu/drm/Makefile > +++ b/drivers/gpu/drm/Makefile > @@ -169,6 +169,7 @@ obj-y +=3D tests/ > obj-$(CONFIG_DRM_MIPI_DBI) +=3D drm_mipi_dbi.o > obj-$(CONFIG_DRM_MIPI_DSI) +=3D drm_mipi_dsi.o > obj-y +=3D arm/ > +obj-y +=3D cix/ > obj-y +=3D clients/ > obj-y +=3D display/ > obj-$(CONFIG_DRM_TTM) +=3D ttm/ [Severity: Low] Should this bridge platform glue live under drivers/gpu/drm/bridge/ (or drivers/gpu/drm/bridge/trilinear/) rather than a new top-level drivers/gpu/drm/cix/ directory? drivers/gpu/drm/cix/ contains no drm_driver, only a single 181-line wrapper for the Trilinear bridge driver. Putting it at the top level exposes DRM_CIX_DP outside the Display Interface Bridges menu and adds four extra Kconfig/Makefile files, whereas comparable SoC bridge wrappers such as drivers/gpu/drm/bridge/th1520-dw-hdmi.c and drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-j721e.c sit under drivers/gpu/drm/bridge/. [ ... ] > diff --git a/drivers/gpu/drm/cix/dptx/cix_dptx.c b/drivers/gpu/drm/cix/dp= tx/cix_dptx.c > new file mode 100644 > index 0000000000000..e25b3b365d7b8 > --- /dev/null > +++ b/drivers/gpu/drm/cix/dptx/cix_dptx.c [ ... ] > +static void cix_dptx_remove(struct platform_device *pdev) > +{ > + trilinear_dptx_remove(platform_get_drvdata(pdev)); > +} [Severity: Medium] Can cix_dptx_remove() allow dp->dev to be freed while dptx_bridge_detach() is still about to pass it to device_link_remove()? CPU0 (bridge detach) CPU1 (platform device delete) dptx_bridge_detach() lock(&dp->lock) consumer =3D dp->link_consumer dp->link_consumer =3D NULL unlock(&dp->lock) device_unregister(dp->dev) device_del(dp->dev) cix_dptx_remove() dptx_deinit() lock(&dp->lock) /* link_consumer =3D=3D NULL */ unlock(&dp->lock) device_links_purge(dp->dev) put_device(dp->dev) /* freed */ device_link_remove(consumer, dp->dev) <-- use-after-free trilinear_dptx_probe() stores dp->dev without taking a device reference, and dptx_bridge_attach() adds a DL_FLAG_STATELESS link, so removing the supplier device does not unbind the consumer first. Because dptx_bridge_detach() clears dp->link_consumer and drops dp->lock before calling device_link_remove(), dptx_deinit() returns immediately and device_del() purges the link and frees dp->dev before device_link_remove() walks supplier->links.consumers. Calling device_link_remove() while still holding dp->lock in dptx_bridge_detach() (matching the dp->lock -> device_links_write_lock ordering already used in dptx_bridge_attach()) would serialize link removal with dptx_deinit(). [Severity: Medium] Can dptx_bridge_mode_set() dereference a freed dp->dev if cix_dptx_remove() runs between dp->ops->detect() and reacquiring dp->lock? CPU0 (modeset) CPU1 (platform device delete) dptx_bridge_mode_set() dp->ops->detect(dp) /* locks, checks released, unlocks */ device_unregister(dp->dev) cix_dptx_remove() dptx_deinit() dp->released =3D true device_link_remove(...) put_device(dp->dev) /* freed */ guard(mutex)(&dp->lock) /* no dp->released check */ dev_dbg(dp->dev, ...) <-- use-after-free dptx_bridge_mode_set() releases dp->lock when dp->ops->detect() returns and does not re-check dp->released after reacquiring it. Because dp->bridge keeps dp alive after dp->dev is freed, dptx_bridge_mode_set() mutates state on a released bridge and dereferences freed dp->dev in dev_dbg() when dynamic debug is enabled. Checking dp->released and returning -ENODEV immediately after acquiring dp->lock in dptx_bridge_mode_set() would close this window. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204114332.2808= 08-1-Luo.Liu@cixtech.com?part=3D5