All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
To: "Jani Nikula" <jani.nikula@linux.intel.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Sebastian Brzezinka" <sebastian.brzezinka@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: <andi.shyti@linux.intel.com>
Subject: Re: [PATCH v2] drm/ttm: fix NULL deref in ttm_bo_flush_all_fences() after fence ops detach
Date: Wed, 4 Mar 2026 17:37:10 +0100	[thread overview]
Message-ID: <DGU586L96FWH.2356290WD8Q67@intel.com> (raw)
In-Reply-To: <70936dccd9ed65e8175f6cb1a0ba1864d82d5a3a@intel.com>

On Wed Mar 4, 2026 at 5:28 PM CET, Jani Nikula wrote:
> On Tue, 03 Mar 2026, Christian König <christian.koenig@amd.com> wrote:
>> On 3/3/26 13:26, Sebastian Brzezinka wrote:
>>> Since commit 541c8f2468b9 ("dma-buf: detach fence ops on signal v3"),
>>> fence->ops may be set to NULL via RCU when a fence signals and has no
>>> release/wait ops. ttm_bo_flush_all_fences() was not updated to handle
>>> this and directly dereferences fence->ops->signaled, leading to a NULL
>>> pointer dereference crash:
>>> 
>>> ```
>>> BUG: kernel NULL pointer dereference, address: 0000000000000018
>>> RIP: 0010:ttm_bo_release+0x1bc/0x330 [ttm]
>>> ```
>>> 
>>> Since dma_fence_enable_sw_signaling() already handles the signaled case
>>> internally (it checks DMA_FENCE_FLAG_SIGNALED_BIT before doing anything),
>>> the ops->signaled pre-check is redundant. Simply remove it and call
>>> dma_fence_enable_sw_signaling() unconditionally for each fence.
>>> 
>>> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15759
>>> Fixes: 541c8f2468b9 ("dma-buf: detach fence ops on signal v3")
>>> Cc: Christian König <christian.koenig@amd.com>
>>> Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
>>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>> Going to push that to drm-misc-next now.
>
> Christian, did you forget to push or is there still something missing
> here?
>
> Sebastian, for future reference, drm/ttm patches need to be sent to the
> dri-devel mailing list. I bounced the patch there now. See MAINTAINERS
> and/or use scripts/get_maintainer.pl to see where you need to send the
> patches. The intel-gfx list is sufficient for i915 changes only.
>
> BR,
> Jani.
Thanks for the guidance and for bouncing the patch to the correct list.

-- 
Best regards,
Sebastian


  reply	other threads:[~2026-03-04 16:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 12:26 [PATCH v2] drm/ttm: fix NULL deref in ttm_bo_flush_all_fences() after fence ops detach Sebastian Brzezinka
2026-03-03 13:48 ` Christian König
2026-03-04 16:28   ` Jani Nikula
2026-03-04 16:37     ` Sebastian Brzezinka [this message]
2026-03-05  7:56       ` Christian König
2026-03-03 14:27 ` ✓ i915.CI.BAT: success for drm/ttm: fix NULL deref in ttm_bo_flush_all_fences() after fence ops detach (rev2) Patchwork
2026-03-03 22:47 ` ✗ i915.CI.Full: failure " Patchwork
2026-03-04 14:52 ` [PATCH v2] drm/ttm: fix NULL deref in ttm_bo_flush_all_fences() after fence ops detach Andi Shyti

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=DGU586L96FWH.2356290WD8Q67@intel.com \
    --to=sebastian.brzezinka@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=christian.koenig@amd.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.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.