Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Damon Ding" <damon.ding@rock-chips.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v8 10/10] drm/rockchip: analogix_dp: Add support for RK3576
Date: Mon, 25 May 2026 13:36:14 +0000	[thread overview]
Message-ID: <20260525133615.5D7D71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260525125331.140059-11-damon.ding@rock-chips.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] The `rk3576_edp` chip data table omits `.edp_mode` GRF register field initialization, which may prevent the combo PHY from being properly configured.

Pre-existing issues:
- [Critical] A `sprintf` call formats a potentially long device node path into a fixed 32-byte stack buffer `name`, causing a stack overflow vulnerability.
--

commit d5d21d53d47c2f7f634710afc76442e39aeaf0f8
Author: Damon Ding <damon.ding@rock-chips.com>

drm/rockchip: analogix_dp: Add support for RK3576

This commit adds dedicated chip data and a device tree matching entry to
bring up basic eDP functionality for the RK3576 platform. It notes that
the hardware blocks fully match the proven RK3588 design.

> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index d2af5eb29dbb5..d4c5dd61e95bb 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -522,6 +522,14 @@ static const struct rockchip_dp_chip_data rk3288_dp[] = {
>  	{ /* sentinel */ }
>  };
>  
> +static const struct rockchip_dp_chip_data rk3576_edp[] = {
> +	{
> +		.chip_type = RK3576_EDP,
> +		.reg = 0x27dc0000,

[Severity: High]
Does this missing .edp_mode initialization prevent the combo PHY from
being properly configured?

The commit message states that the RK3576 hardware blocks fully match
the RK3588 design. However, the RK3588 implementation uses .edp_mode to
configure the combo PHY via GRF when powering on the DP controller.

Because .edp_mode is left uninitialized here, when rockchip_dp_poweron()
calls rockchip_grf_field_write(), it will silently return 0 since .valid
is false, skipping the GRF configuration entirely.

[ ... ]

This isn't a bug introduced by this patch, but while reviewing this file
I noticed a pre-existing issue in rockchip_dp_drm_encoder_enable():

drivers/gpu/drm/rockchip/analogix_dp-rockchip.c:rockchip_dp_drm_encoder_enable() {
    char name[32];
    ...
    if (remote_port_parent) {
        if (of_get_child_by_name(remote_port_parent, "ports")) {
            ...
            sprintf(name, "%s vp%d", remote_port_parent->full_name, port_id);
    ...
}

[Severity: Critical]
Since remote_port_parent->full_name points to the device tree node's full
name (which can exceed 32 characters), can this unbounded string write
overflow the 32-byte name buffer on the stack?

Additionally, it appears the name variable is never actually used for
anything after being formatted, meaning this vulnerability exists purely
in dead logic.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260525125331.140059-1-damon.ding@rock-chips.com?part=10

      reply	other threads:[~2026-05-25 13:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 12:53 [PATCH v8 00/10] Add eDP support for RK3576 Damon Ding
2026-05-25 12:53 ` [PATCH v8 01/10] dt-bindings: display: rockchip: analogix-dp: Fix hclk as third clock for RK3588 Damon Ding
2026-05-25 13:05   ` sashiko-bot
2026-05-25 16:54   ` Conor Dooley
2026-05-26  0:54     ` Damon Ding
2026-05-26 11:27       ` Damon Ding
2026-05-26 16:39         ` Conor Dooley
2026-05-25 12:53 ` [PATCH v8 02/10] dt-bindings: display: rockchip: analogix-dp: Add per-clock descriptions Damon Ding
2026-05-25 12:53 ` [PATCH v8 03/10] arm64: dts: rockchip: Add missing hclk for RK3588 eDP0 Damon Ding
2026-05-25 13:39   ` sashiko-bot
2026-05-25 12:53 ` [PATCH v8 04/10] arm64: dts: rockchip: Add missing hclk for RK3588 eDP1 Damon Ding
2026-05-25 12:53 ` [PATCH v8 05/10] drm/rockchip: analogix_dp: Enable hclk for RK3588 Damon Ding
2026-05-25 12:53 ` [PATCH v8 06/10] dt-bindings: display: rockchip: analogix-dp: Add support for RK3576 Damon Ding
2026-05-25 12:53 ` [PATCH v8 07/10] arm64: dts: rockchip: Add eDP node " Damon Ding
2026-05-25 12:53 ` [PATCH v8 08/10] drm/bridge: analogix_dp: Rename and simplify is_rockchip() Damon Ding
2026-05-25 12:53 ` [PATCH v8 09/10] drm/bridge: analogix_dp: Add support for RK3576 Damon Ding
2026-05-25 12:53 ` [PATCH v8 10/10] drm/rockchip: " Damon Ding
2026-05-25 13:36   ` sashiko-bot [this message]

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=20260525133615.5D7D71F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=damon.ding@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.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