Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 4/7] drm/xe/oa: Signal output fences
Date: Wed, 18 Sep 2024 12:59:48 -0700	[thread overview]
Message-ID: <85bk0k7mx7.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <ZuoTA0H76Btd8jIf@DUT025-TGLU.fm.intel.com>

On Tue, 17 Sep 2024 16:38:43 -0700, Matthew Brost wrote:
>
> > > +	dma_fence_init(&ofence->base, &xe_oa_fence_ops, &stream->oa_fence_lock, 0, 0);
> >
> > About stream->oa_fence_lock. This was added in response to this comment
> > from you in v1 of this patch:
> >
> >	/* No per fence spin lock, global OA one for user_signal */
> >
> > here:
> >	https://patchwork.freedesktop.org/patch/607602/?series=137058&rev=1#comment_1104327
> >
> > However, I just realized that, the way it is implemented, there is a uaf
> > here: lock memory can be freed before the lock is accessed in
> > dma_fence_signal() in xe_oa_fence_work_fn() (when the oa stream is
> > destroyed).
> >
> > Of course we can implement some reference counting etc. to solve the uaf,
> > but the simplest way to solve it seems to be to go back to the per-fence
> > lock, unless doing so is incorrect? Looking at dma_fence_init calls, I do
> > see per fence locks being used occasionally (xe_preempt_fence, vgem_fence
> > etc.).
> >
> > So just want to check with you if it's ok to go back to the per fence lock,
> > or we should solve it some other way.
> >
>
> Yea my bad on that suggestion. That is an issue, just move the lock back
> to the fence.

No problem, thanks, I've moved the lock back into the fence in the latest
version.

Ashutosh

  reply	other threads:[~2024-09-18 19:59 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30 22:16 [PATCH v5 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 1/7] drm/xe/oa: Separate batch submission from waiting for completion Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 2/7] drm/xe/oa/uapi: Define and parse OA sync properties Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 3/7] drm/xe/oa: Add input fence dependencies Ashutosh Dixit
2024-09-18 11:59   ` Souza, Jose
2024-09-18 19:56     ` Dixit, Ashutosh
2024-08-30 22:16 ` [PATCH 4/7] drm/xe/oa: Signal output fences Ashutosh Dixit
2024-08-30 22:15   ` Dixit, Ashutosh
2024-08-30 22:45   ` Matthew Brost
2024-08-30 22:58     ` Dixit, Ashutosh
2024-09-17 22:18   ` Dixit, Ashutosh
2024-09-17 23:38     ` Matthew Brost
2024-09-18 19:59       ` Dixit, Ashutosh [this message]
2024-08-30 22:16 ` [PATCH 5/7] drm/xe/oa: Move functions up so they can be reused for config ioctl Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 6/7] drm/xe/oa: Add syncs support to OA " Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 7/7] drm/xe/oa: Allow only certain property changes from config Ashutosh Dixit
2024-08-30 22:21 ` ✓ CI.Patch_applied: success for drm/xe/oa: xe_syncs for OA (rev5) Patchwork
2024-08-30 22:22 ` ✓ CI.checkpatch: " Patchwork
2024-08-30 22:23 ` ✓ CI.KUnit: " Patchwork
2024-08-30 22:35 ` ✓ CI.Build: " Patchwork
2024-08-30 22:37 ` ✓ CI.Hooks: " Patchwork
2024-08-30 22:38 ` ✓ CI.checksparse: " Patchwork
2024-08-30 22:58 ` ✓ CI.BAT: " Patchwork
2024-08-31 11:25 ` ✗ CI.FULL: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-10-22 20:03 [PATCH v7 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-10-22 20:03 ` [PATCH 4/7] drm/xe/oa: Signal output fences Ashutosh Dixit
2024-09-18 19:53 [PATCH v6 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-09-18 19:53 ` [PATCH 4/7] drm/xe/oa: Signal output fences Ashutosh Dixit
2024-08-28  1:50 [PATCH v4 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-28  1:50 ` [PATCH 4/7] drm/xe/oa: Signal output fences Ashutosh Dixit
2024-08-21 15:28 [PATCH v3 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-21 15:28 ` [PATCH 4/7] drm/xe/oa: Signal output fences Ashutosh Dixit
2024-08-21 15:49   ` Matthew Brost
2024-08-20  0:58 [PATCH v2 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-20  0:58 ` [PATCH 4/7] drm/xe/oa: Signal output fences Ashutosh Dixit
2024-08-20 19:23   ` Matthew Brost
2024-08-21 15:20     ` Dixit, Ashutosh
2024-08-21 16:02       ` Matthew Brost

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=85bk0k7mx7.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@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