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 D2F8F606A322 for ; Tue, 1 Dec 2026 20:46:12 +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=dTXX8AKm Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BB6910FD0A; Tue, 1 Dec 2026 20:46:07 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5835A10FD0A for ; Tue, 1 Dec 2026 20:46:01 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 40759421EF; Tue, 1 Dec 2026 20:46:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E4F41F00893; Tue, 1 Dec 2026 20:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796157961; bh=p7un/Nybn7yfhvb4UT8BLYzCswpm2j9qNo1uuRutTGo=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=dTXX8AKmaiXSKNAZtvmQiMnj89Ae8hXqo2bXKv1Nah9Xs7QuNKVI5LrRMk0AdKKBj pBnxJw8uoovKIdrEq0To1lIV7lsh0aGLWV8OQpqlbAYwaIIKoyYqAHeeT4jAQGznZx AtNnsdY6LbpzbgELrTqxRniVTK/nzwNHtLKY28HU6RDJIb1mPubI4px8FzscmSK8WH KCL669OkrxO49ZMMuVcVYv8GBo53dS9gaJl64RTnhVNsuXWstBuJrb3+MxpreVSwtv 5/Il1Yt++CgVlkqM+brSVimM0ah0Fui0QNkSMVk/Uc+Ip1TZvwEZF0vx3BT6T7ndBC 41sxHYxrVDyIA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 18/30] drm/amd/display: block pr in mst right To: "George Zhang" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261201202451.463794-20-george.zhang@amd.com> References: <20261201202451.463794-2-george.zhang@amd.com> <20261201202451.463794-20-george.zhang@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 20:46:00 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "amd-gfx" 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: - [Medium] drm/amd/display: unguarded link_enc dereference in dp_setup_panel_replay() -- commit e59fe77bf19f365a90e441cbffda3fd425f69a9b Author: Peichen Huang drm/amd/display: block pr in mst right This commit checks the stream signal rather than the connector signal to verify that a link is DP SST for Panel Replay, and guards against a NULL link->link_enc in dp_pr_copy_settings(). > diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_panel_= replay.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_panel_repl= ay.c > index 65a791ccf6b2d..24cc882eb1680 100644 > --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_panel_replay.c > +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_panel_replay.c [ ... ] > @@ -315,7 +313,7 @@ bool dp_pr_copy_settings(struct dc_link *link, struct= replay_context *replay_con > else > cmd.pr_copy_settings.data.otg_inst =3D 0; > =20 > - cmd.pr_copy_settings.data.dpphy_inst =3D link->link_enc->transmitter; > + cmd.pr_copy_settings.data.dpphy_inst =3D link->link_enc ? (uint8_t)link= ->link_enc->transmitter : 0; > =20 > cmd.pr_copy_settings.data.line_time_in_ns =3D replay_context->line_time= _in_ns; > cmd.pr_copy_settings.data.flags.bitfields.fec_enable_status =3D (link->= fec_state =3D=3D dc_link_fec_enabled); [Severity: Medium] Can dp_setup_panel_replay() still dereference a NULL link->link_enc before calling dp_pr_copy_settings()? When link->link_enc is NULL (for example on a USB4 DPIA link), the sole caller dp_setup_panel_replay() unconditionally dereferences link->link_enc before reaching this new check: drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_panel_replay.c:dp_set= up_panel_replay() { ... replay_context.aux_inst =3D (enum channel_id) link_get_ddc_aux_inst(link); replay_context.digbe_inst =3D link->link_enc->transmitter; replay_context.digfe_inst =3D link->link_enc->preferred_engine; ... link->replay_settings.replay_feature_enabled =3D dp_pr_copy_settings(link,= &replay_context); ... } Setting up Panel Replay on a link with a NULL link->link_enc will trigger a NULL pointer dereference in dp_setup_panel_replay(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201202451.4637= 94-2-george.zhang@amd.com?part=3D18