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 9FDE8606A320 for ; Mon, 30 Nov 2026 17:33:50 +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=cu24T+fs Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B8B410F2DA; Mon, 30 Nov 2026 17:33:45 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0345510F2E1 for ; Mon, 30 Nov 2026 17:33:39 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id A09A443262; Mon, 30 Nov 2026 17:33:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B701F00898; Mon, 30 Nov 2026 17:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796060018; bh=sk4OrIld2144/DFLHZ7mMP/trjuxrmHgXHPzW/T/fJs=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=cu24T+fs3QR4yG2PlO6c+sAcpl16T7tvkplHQlO7KOEWIX9ySiKLtEiXCSFJb2SKD 74FIalJdb6wc8F1m1VKVBBm9/jAXT2JXNlV2wHwx28TkQzg5Ik9at5JeuqjPk+SflR jUZxyAbMWIqAzaIvC0Rp7QaDOMF9UaM5PKwpRs1iWDKQd1T0hSBO9myy9jJhhyIx4t SU32QI5uTSIcK2DKjeW1BzMSZuIk/XFMZ5KZaz5yFhSMhvmTKjfxQdVVFACcaUNYdp hkXGP9d4nVSr+Z5067YxMJrxTQG77unudYqHO1hwah1n31+663KyXWCrtvem0kagLQ NI7gbcqLi6FBw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/amdgpu: reject errored peers in UALink local vPod integrity check To: "Mukul Joshi" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261130171854.489910-2-mukul.joshi@amd.com> References: <20261130171854.489910-1-mukul.joshi@amd.com> <20261130171854.489910-2-mukul.joshi@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 17:33:37 +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: errored vPod peers with invalid accel_id are skipped -- commit 51531015613e09183d21d8b32b3616673d7a007c Author: Mukul Joshi drm/amdgpu: reject errored peers in UALink local vPod integrity check This commit updates __check_local_vpod_integrity() to explicitly handle peers in AMDGPU_UALINK_ACCEL_STATE_ERROR by bounds-checking their accel_id and failing the integrity check if they belong to the local vPod. > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm= /amd/amdgpu/amdgpu_ualink.c > index fa4c3d27d2720..8a1069feb27b9 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c > @@ -1179,6 +1179,17 @@ static int __check_local_vpod_integrity(struct amd= gpu_device *adev) > } > =20 > accel_id =3D peer_info->ppod.accel_id; > + /* An errored peer's accel_id may have failed validation. */ > + if (peer_info->accel_state =3D=3D AMDGPU_UALINK_ACCEL_STATE_ERROR) { > + if (accel_id < AMDGPU_UALINK_ACCEL_MAX && > + test_bit(accel_id, info->vpod.active_accel_bits)) { > + dev_warn(adev->dev, > + "UALINK: integrity fail: vpod peer accel_id=3D%u is in error state= \n", > + accel_id); > + return -EINVAL; > + } > + continue; > + } > if (!test_bit(accel_id, info->vpod.active_accel_bits)) > continue; > /* peer device vpod not configured */ [Severity: Medium] Can an errored peer in the same vPod still be skipped here when its peer_info->ppod.accel_id is invalid? When a peer enters AMDGPU_UALINK_ACCEL_STATE_ERROR because __check_ppod_info() failed in amdgpu_ualink_info_set_accel_state() (for example, accel_id >=3D AMDGPU_UALINK_ACCEL_MAX or >=3D ppod.size) or because __check_vpod_info() rejected a missing self-bit in active_accel_bits, this condition is false and hits continue. Because info->vpod.active_accel_bits includes both local and remote accelerators, membership of a local GPU cannot be determined from an unvalidated accel_id. __check_local_vpod_integrity() then succeeds and activates the local vPod despite the broken local peer, and the second loop still matches that errored peer via __is_vpod_peer() (which only compares vpod.id and ppod.id) and overwrites its n_local_accels and local_accels. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130171854.4899= 10-2-mukul.joshi@amd.com?part=3D1