Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: "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>, <christian.koenig@amd.com>
Subject: Re: [PATCH v3] drm/ttm: Avoid NULL pointer deref for evicted BOs
Date: Fri, 5 Dec 2025 10:25:09 -0800	[thread overview]
Message-ID: <aTMjhaq3mJdPsHAa@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <DM4PR11MB5456F9CEB1B89BC3187E9B55EAA7A@DM4PR11MB5456.namprd11.prod.outlook.com>

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.

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
> > >

  reply	other threads:[~2025-12-05 18:25 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 [this message]
2025-12-08  7:54               ` Christian König
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=aTMjhaq3mJdPsHAa@lstrano-desk.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=Simon.Richter@hogyros.de \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox