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 1909E606A31A for ; Mon, 30 Nov 2026 21:07:02 +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=ib+dD//E Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7ED210E25B; Mon, 30 Nov 2026 21:06:56 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id C622610E25B for ; Mon, 30 Nov 2026 21:06:50 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id B40F5605E3; Mon, 30 Nov 2026 21:06:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52E331F00897; Mon, 30 Nov 2026 21:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796072809; bh=yx8cn9gh8PmMe72VnNEMpBmAPQpCalgDMZs+1YkmDtw=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=ib+dD//EzB7zuRjofO70wT4Q8UmXTbzX3+5w6iv8xkn4Gbl3/0V6fxoDn/BNcsb4e PPLYUjGQ+yhOW2PtzB/DETyR2lLrUjtkGCf7wC541xzxZD3iQlff0zmoylSGtdI8X/ lEeM5y7XEyE2RgFwcum3pqdgwvDKKD5mqHVnLpin066QspgD1GtIfgUq/5NZuh6N8b tBukgWZcaB9WK5VCyEmbJNZUHDC66sxjvnQVqDzKbF+raMpYNRxRnB3cHZZIKlSjpO d97lRM0ZpVMouXPgNeQ2Bfrk2w2dM/3mH2y8KVrEN9v+dZ6S4ilWSI1ZzzwaIBTX28 t3DeHJfK24cAA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCHv3] drm/amdgpu: reject errored peers in UALink local vPod integrity check To: "Mukul Joshi" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261130204733.533769-1-mukul.joshi@amd.com> References: <20261130204733.533769-1-mukul.joshi@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 21:06:48 +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/amdgpu: incomplete errored peer check in __check_local_vpod_integrity() -- commit afa1dfd6bced3e7e4c6a0f3810602234d791cc37 Author: Mukul Joshi drm/amdgpu: reject errored peers in UALink local vPod integrity check This commit updates __check_local_vpod_integrity() to check whether a peer accelerator is in AMDGPU_UALINK_ACCEL_STATE_ERROR before testing its pPod or vPod configuration states, failing the integrity check if the errored peer has an out-of-range accel_id or is marked in vpod.active_accel_bits. > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm= /amd/amdgpu/amdgpu_ualink.c > index fa4c3d27d2720..2966e501ac120 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c > @@ -1168,17 +1168,30 @@ static int __check_local_vpod_integrity(struct am= dgpu_device *adev) > continue; > =20 > peer_info =3D peer_adev->ualink.info; > + accel_id =3D peer_info->ppod.accel_id; > + /* An errored peer's accel_id may have failed validation, in > + * which case its vPod membership is unknown: treat it as a > + * member. > + */ > + if (peer_info->accel_state =3D=3D AMDGPU_UALINK_ACCEL_STATE_ERROR) { > + if (accel_id >=3D AMDGPU_UALINK_ACCEL_MAX || > + test_bit(accel_id, info->vpod.active_accel_bits)) { > + dev_warn(adev->dev, > + "UALINK: integrity fail: errored peer accel_id=3D%u is or may be a= vpod member\n", > + accel_id); > + return -EINVAL; > + } > + continue; > + } [Severity: Medium] Can an errored peer whose pPod failed __check_ppod_info() still be skipped here when accel_id < AMDGPU_UALINK_ACCEL_MAX? In amdgpu_ualink_info_set_accel_state(), a peer enters AMDGPU_UALINK_ACCEL_STATE_ERROR when __check_ppod_info() fails because ppod.size is 0 or ppod.accel_id >=3D ppod.size. When info->ppod.size is smaller than AMDGPU_UALINK_ACCEL_MAX (for example 8) and the errored peer has an unvalidated accel_id in [info->ppod.size, AMDGPU_UALINK_ACCEL_MAX - = 1] (or ppod.size =3D=3D 0 and accel_id =3D=3D 0 when bit 0 is not in this vPod= ), accel_id >=3D AMDGPU_UALINK_ACCEL_MAX and test_bit() are both false. The l= oop then skips the peer and activates the vPod even though the peer's accel_id failed validation and its vPod membership is unknown. Checking !__check_ppod_info(peer_adev, peer_info) instead of accel_id >=3D AMDGPU_UALINK_ACCEL_MAX would catch any unvalidated pPod on an errored peer before consulting active_accel_bits. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130204733.5337= 69-1-mukul.joshi@amd.com?part=3D1