From: "Christian König" <christian.koenig@amd.com>
To: Matthew Brost <matthew.brost@intel.com>,
"Lin, Shuicheng" <shuicheng.lin@intel.com>
Cc: Simon Richter <Simon.Richter@hogyros.de>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v3] drm/ttm: Avoid NULL pointer deref for evicted BOs
Date: Mon, 8 Dec 2025 08:54:56 +0100 [thread overview]
Message-ID: <af7bfbbb-031d-4126-b03e-0dc5fd2f34cc@amd.com> (raw)
In-Reply-To: <aTMjhaq3mJdPsHAa@lstrano-desk.jf.intel.com>
On 12/5/25 19:25, Matthew Brost wrote:
> On Fri, Dec 05, 2025 at 10:46:34AM -0700, Lin, Shuicheng wrote:
>> On Mon, Oct 13, 2025 9:27 AM Matthew Brost wrote:
>>> On Tue, Oct 14, 2025 at 01:11:33AM +0900, Simon Richter wrote:
>>>> It is possible for a BO to exist that is not currently associated with
>>>> a resource, e.g. because it has been evicted.
>>>>
>>>> When devcoredump tries to read the contents of all BOs for dumping, we
>>>> need to expect this as well -- in this case, ENODATA is recorded
>>>> instead of the buffer contents.
>>>>
>>>> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6271
>>>
>>> I think we need a fixes / cc stable but I can add that for you when merging.
>>>
>>> Anyways patch LGTM:
>>> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
>>>
>>>> Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
>>
>
> Christian - any objection to me pushing this patch drm-misc-next or
> would it be drm-misc-fixes? I forget the flow here.
Good catch! I somehow totally missed that patch.
Reviewed-by: Christian König <christian.koenig@amd.com>
And with the CC stable tag that should go to drm-misc-fixes.
Regards,
Christian.
>
> Matt
>
>> It seems this patch is not merged yet.
>>
>> LGTM.
>> Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com>
>>
>>>> ---
>>>> drivers/gpu/drm/ttm/ttm_bo_vm.c | 7 +++++++
>>>> 1 file changed, 7 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c
>>>> b/drivers/gpu/drm/ttm/ttm_bo_vm.c index b47020fca199..a101ff95b234
>>>> 100644
>>>> --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
>>>> +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
>>>> @@ -434,6 +434,11 @@ int ttm_bo_access(struct ttm_buffer_object *bo,
>>> unsigned long offset,
>>>> if (ret)
>>>> return ret;
>>>>
>>>> + if (!bo->resource) {
>>>> + ret = -ENODATA;
>>>> + goto unlock;
>>>> + }
>>>> +
>>>> switch (bo->resource->mem_type) {
>>>> case TTM_PL_SYSTEM:
>>>> fallthrough;
>>>> @@ -448,6 +453,7 @@ int ttm_bo_access(struct ttm_buffer_object *bo,
>>> unsigned long offset,
>>>> ret = -EIO;
>>>> }
>>>>
>>>> +unlock:
>>>> ttm_bo_unreserve(bo);
>>>>
>>>> return ret;
>>>> --
>>>> 2.47.3
>>>>
next prev parent reply other threads:[~2025-12-08 7:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-12 12:45 [PATCH 0/1] Avoid crash during dump when finding an evicted BO Simon Richter
2025-10-12 12:45 ` [PATCH 1/1] drm/ttm: Avoid NULL pointer deref for evicted BOs Simon Richter
2025-10-12 23:09 ` Matthew Brost
2025-10-13 16:02 ` [PATCH v2] " Simon Richter
2025-10-13 16:11 ` [PATCH v3] " Simon Richter
2025-10-13 16:27 ` Matthew Brost
2025-12-05 17:46 ` Lin, Shuicheng
2025-12-05 18:25 ` Matthew Brost
2025-12-08 7:54 ` Christian König [this message]
2025-10-12 12:52 ` ✗ CI.checkpatch: warning for Avoid crash during dump when finding an evicted BO Patchwork
2025-10-12 12:53 ` ✓ CI.KUnit: success " Patchwork
2025-10-12 13:35 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-12 14:47 ` ✗ Xe.CI.Full: failure " Patchwork
2025-10-13 18:03 ` ✓ CI.KUnit: success for Avoid crash during dump when finding an evicted BO (rev3) Patchwork
2025-10-13 18:39 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-13 22:03 ` ✗ Xe.CI.Full: failure " Patchwork
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=af7bfbbb-031d-4126-b03e-0dc5fd2f34cc@amd.com \
--to=christian.koenig@amd.com \
--cc=Simon.Richter@hogyros.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=shuicheng.lin@intel.com \
/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.