From: sashiko-bot@kernel.org
To: "Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/5] drm/amdgpu: honor gpu_recovery_allowed in amdgpu_job_timedout
Date: Thu, 13 Aug 2026 17:18:55 +0000 [thread overview]
Message-ID: <20260813171855.BA8821F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813170705.15745-2-pierre-eric.pelloux-prayer@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Concurrent GPU ring timeouts cause list corruption due to unprotected modification of `adev->reset_list`.
--
--- Patch [2]: [PATCH v2 2/5] drm/amdgpu: honor gpu_recovery_allowed in amdgpu_job_timedout ---
commit 2bc1f829e1f5f1741410cfa00dfab26ce6099f90
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
drm/amdgpu: honor gpu_recovery_allowed in amdgpu_job_timedout
This commit introduces a single can_reset variable in amdgpu_job_timedout
that takes both the global module parameter and the per-device
gpu_recovery_allowed flag into account. It uses this new variable to gate
the soft-recovery, per-ring-reset, and IP-block-reset attempts.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index d97cf1212e0f9..43511e0419a12 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
[ ... ]
> @@ -111,7 +112,7 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct drm_sched_job *s_job)
> if (!amdgpu_sriov_vf(adev))
> amdgpu_job_core_dump(adev, job);
[Severity: High]
This is a pre-existing issue, but can this lead to list corruption if
multiple GPU rings timeout concurrently?
When a timeout occurs, the code calls amdgpu_job_core_dump(). If the
device does not have an XGMI hive (hive is NULL), amdgpu_job_core_dump()
links the shared adev->reset_list into a local stack-allocated list:
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c:amdgpu_job_core_dump() {
...
if (!amdgpu_sriov_vf(adev) && (adev->gmc.xgmi.num_physical_nodes > 1) && hive) {
...
} else {
list_add_tail(&adev->reset_list, &device_list);
device_list_handle = &device_list;
}
...
}
Since adev->reset_list is shared, if an untrusted userspace application
submits hanging shaders on two different rings concurrently, wouldn't both
threads race to modify adev->reset_list without any lock protection?
This looks like it could lead to wild pointer dereferences during list
iteration or when exiting the stack frame on concurrent executions of
amdgpu_job_timedout() for the same adev.
> - if (amdgpu_gpu_recovery &&
> + if (can_reset &&
> amdgpu_ring_is_reset_type_supported(ring, AMDGPU_RESET_TYPE_SOFT_RECOVERY) &&
> amdgpu_ring_soft_recovery(ring, job->vmid, s_job->s_fence->parent)) {
> dev_err(adev->dev, "ring %s timeout, but soft recovered\n",
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260813170705.15745-1-pierre-eric.pelloux-prayer@amd.com?part=2
next prev parent reply other threads:[~2026-08-13 17:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 17:06 [PATCH v2 1/5] drm/amdgpu: add gpu_recovery_allowed flag to amdgpu_device Pierre-Eric Pelloux-Prayer
2026-08-13 17:06 ` [PATCH v2 2/5] drm/amdgpu: honor gpu_recovery_allowed in amdgpu_job_timedout Pierre-Eric Pelloux-Prayer
2026-08-13 17:18 ` sashiko-bot [this message]
2026-08-13 17:07 ` [PATCH v2 3/5] drm/amdgpu: add wedge event implementation Pierre-Eric Pelloux-Prayer
2026-08-13 17:29 ` sashiko-bot
2026-08-13 17:07 ` [PATCH v2 4/5] drm/amdgpu: skip amdgpu_gart_unbind if the device is wedged Pierre-Eric Pelloux-Prayer
2026-08-13 17:07 ` [PATCH v2 5/5] drm/amdgpu: skip amdgpu_gmc_flush_gpu_tlb_pasid if " Pierre-Eric Pelloux-Prayer
2026-08-13 17:18 ` [PATCH v2 1/5] drm/amdgpu: add gpu_recovery_allowed flag to amdgpu_device sashiko-bot
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=20260813171855.BA8821F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=pierre-eric.pelloux-prayer@amd.com \
--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 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.