* [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check
@ 2026-11-30 19:55 Mukul Joshi
2026-11-30 20:16 ` sashiko-bot
2026-11-30 20:16 ` Felix Kuehling
0 siblings, 2 replies; 3+ messages in thread
From: Mukul Joshi @ 2026-11-30 19:55 UTC (permalink / raw)
To: amd-gfx
Cc: Felix.Kuehling, Harish.Kasiviswanathan, philip.yang, Mukul Joshi,
Sashiko-bot
AMDGPU_UALINK_ACCEL_STATE_ERROR sorts above every configured state, so
a local peer in the error state passes both the "pPod configured" and
"vPod configured" checks in __check_local_vpod_integrity() and is
treated as a healthy vPod member. The local vPod is then activated
around an accelerator that cannot participate.
The error state is also entered when pPod validation fails, in which
case the peer's accel_id is unvalidated firmware data and is used to
index vpod.active_accel_bits without a bounds check.
Handle errored peers explicitly: fail the integrity check if the peer
is a member of this vPod, and skip it otherwise. If the peer's
accel_id is out of range, its membership cannot be determined, so
treat it as a member and fail the check rather than risk activating
the vPod without it.
Fixes: 448a35158bee ("drm/amdgpu: Assign accel state based on ASP config")
Reported-by: Sashiko-bot <sashiko-bot@kernel.org>
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
---
v1->v2:
- Ensure invalid accel_id peer fail VPOD activation.
drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
index 0982d8455b0c..3adb12bd9df5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
@@ -1180,6 +1180,20 @@ static int __check_local_vpod_integrity(struct amdgpu_device *adev)
}
accel_id = 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 == 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: errored peer accel_id=%u is or may be a vpod member\n",
+ accel_id);
+ return -EINVAL;
+ }
+ continue;
+ }
if (!test_bit(accel_id, info->vpod.active_accel_bits))
continue;
/* peer device vpod not configured */
--
2.56.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check
2026-11-30 19:55 [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check Mukul Joshi
@ 2026-11-30 20:16 ` sashiko-bot
2026-11-30 20:16 ` Felix Kuehling
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-30 20:16 UTC (permalink / raw)
To: Mukul Joshi, amd-gfx
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/amdgpu: incomplete errored peer checks in
__check_local_vpod_integrity()
- [Low] drm/amdgpu: Fixes trailer references non-ancestor commit
448a35158bee
--
commit 0a504a5dd615fecadbcd56a1b790ee1d0ec2fcc6
Author: Mukul Joshi <mukul.joshi@amd.com>
> drm/amdgpu: reject errored peers in UALink local vPod integrity check
>
> AMDGPU_UALINK_ACCEL_STATE_ERROR sorts above every configured state, so
> a local peer in the error state passes both the "pPod configured" and
> "vPod configured" checks in __check_local_vpod_integrity() and is
> treated as a healthy vPod member. The local vPod is then activated
> around an accelerator that cannot participate.
>
> The error state is also entered when pPod validation fails, in which
> case the peer's accel_id is unvalidated firmware data and is used to
> index vpod.active_accel_bits without a bounds check.
>
> Handle errored peers explicitly: fail the integrity check if the peer
> is a member of this vPod, and skip it otherwise. If the peer's
> accel_id is out of range, its membership cannot be determined, so
> treat it as a member and fail the check rather than risk activating
> the vPod without it.
>
> Fixes: 448a35158bee ("drm/amdgpu: Assign accel state based on ASP config")
> Reported-by: Sashiko-bot <sashiko-bot@kernel.org>
> Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
[Severity: Low]
Commit 448a35158bee ("drm/amdgpu: Assign accel state based on ASP config")
is not an ancestor of this branch; __check_local_vpod_integrity() was
introduced on this branch by commit 0e8eb0dcea51 ("drm/amdgpu: Assign
accel state based on ASP config"). Should the Fixes: tag reference
0e8eb0dcea51 ("drm/amdgpu: Assign accel state based on ASP config")
instead?
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
> index fa4c3d27d2720..ae591c6ff6c42 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
> @@ -1179,6 +1179,20 @@ static int __check_local_vpod_integrity(struct amdgpu_device *adev)
> }
>
> accel_id = 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 == 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: errored peer accel_id=%u is or may be a vpod member\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 whose pPod validation failed still be skipped here if
its unvalidated accel_id happens to be below AMDGPU_UALINK_ACCEL_MAX?
__check_ppod_info() also fails when ppod->size is 0 or exceeds
AMDGPU_UALINK_ACCEL_MAX, or when ppod->accel_id >= ppod->size (for
example, accel_id = 8 on an 8-GPU pPod where active_accel_bits only has
bits in 0..7). In those cases accel_id < AMDGPU_UALINK_ACCEL_MAX and
test_bit(accel_id, info->vpod.active_accel_bits) is false, so
__check_local_vpod_integrity() skips the peer and activates the vPod even
though the peer's accel_id failed validation and its membership is
unknown.
Also, if a peer enters AMDGPU_UALINK_ACCEL_STATE_ERROR with matching
ppod.id and vpod.id (__is_vpod_peer(info, peer_info) is true) while its
accel_id is not set in info->vpod.active_accel_bits, the first loop skips
it via continue, and the second loop in __check_local_vpod_integrity()
then overwrites peer_info->n_local_accels and peer_info->local_accels on
that errored peer because it only checks __is_vpod_peer(info, peer_info).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130195618.524940-1-mukul.joshi@amd.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check
2026-11-30 19:55 [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check Mukul Joshi
2026-11-30 20:16 ` sashiko-bot
@ 2026-11-30 20:16 ` Felix Kuehling
1 sibling, 0 replies; 3+ messages in thread
From: Felix Kuehling @ 2026-11-30 20:16 UTC (permalink / raw)
To: Mukul Joshi, amd-gfx; +Cc: Harish.Kasiviswanathan, philip.yang, Sashiko-bot
On 2026-11-30 14:55, Mukul Joshi wrote:
> AMDGPU_UALINK_ACCEL_STATE_ERROR sorts above every configured state, so
> a local peer in the error state passes both the "pPod configured" and
> "vPod configured" checks in __check_local_vpod_integrity() and is
> treated as a healthy vPod member. The local vPod is then activated
> around an accelerator that cannot participate.
>
> The error state is also entered when pPod validation fails, in which
> case the peer's accel_id is unvalidated firmware data and is used to
> index vpod.active_accel_bits without a bounds check.
>
> Handle errored peers explicitly: fail the integrity check if the peer
> is a member of this vPod, and skip it otherwise. If the peer's
> accel_id is out of range, its membership cannot be determined, so
> treat it as a member and fail the check rather than risk activating
> the vPod without it.
An out-of-range accel ID would be a bad ppod configuration.
__check_ppod_info should have caught that before getting to PPOD_CONFIGURED.
>
> Fixes: 448a35158bee ("drm/amdgpu: Assign accel state based on ASP config")
> Reported-by: Sashiko-bot <sashiko-bot@kernel.org>
> Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
> ---
> v1->v2:
> - Ensure invalid accel_id peer fail VPOD activation.
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
> index 0982d8455b0c..3adb12bd9df5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
> @@ -1180,6 +1180,20 @@ static int __check_local_vpod_integrity(struct amdgpu_device *adev)
> }
>
> accel_id = 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 == AMDGPU_UALINK_ACCEL_STATE_ERROR) {
> + if (accel_id >= AMDGPU_UALINK_ACCEL_MAX ||
I'd put the check for the error state first, even before checking
PPOD_CONFIGURED.
Regards,
Felix
> + test_bit(accel_id, info->vpod.active_accel_bits)) {
> + dev_warn(adev->dev,
> + "UALINK: integrity fail: errored peer accel_id=%u is or may be a vpod member\n",
> + accel_id);
> + return -EINVAL;
> + }
> + continue;
> + }
> if (!test_bit(accel_id, info->vpod.active_accel_bits))
> continue;
> /* peer device vpod not configured */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-30 20:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 19:55 [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check Mukul Joshi
2026-11-30 20:16 ` sashiko-bot
2026-11-30 20:16 ` Felix Kuehling
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.