Linux virtualization list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Óscar Megía López" <megia.oscar@gmail.com>
Cc: virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH] drm/qxl: zero-initialize struct qxl_release
Date: Sun, 22 Nov 2026 15:21:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-228038@kernel.org> (raw)
In-Reply-To: <20261122151629.223013-1-megia.oscar@gmail.com>

> qxl_release_free() used to check release->base.ops to find out whether
> the embedded dma_fence had been initialized. Since commit 2bcbc706dfa0
> ("dma-buf: add dma_fence_was_initialized function v2") it uses a flag
> in fence->flags instead, but qxl_release_alloc() allocates the release
> with kmalloc(), so the flags contain stale data.
> 
> Cursor releases never go through dma_fence_init(), so with a stale flag
> qxl_release_free() takes the initialized-fence path and calls
> dma_fence_signal() on a garbage fence->lock, triggering:
> 
>   BUG: KASAN: slab-use-after-free in _raw_spin_lock_irqsave+0x7b/0xe0
>   Write of size 4 at addr ffff888010462700 by task kworker/3:1/91
> 
>   CPU: 3 UID: 0 PID: 91 Comm: kworker/3:1
>     Not tainted 7.3.0-00341-gf47d223627f8-dirty #556 PREEMPT(lazy)
> [ ... ]
> 
> Fixes: 2bcbc706dfa0 ("dma-buf: add dma_fence_was_initialized function v2")
> Assisted-by: claude-Sonnet 5.5
> Cc: Christian König <christian.koenig@amd.com>
> Signed-off-by: Óscar Megía López <megia.oscar@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261122151629.223013-1-megia.oscar@gmail.com?part=1

      reply	other threads:[~2026-11-22 15:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 15:16 [PATCH] drm/qxl: zero-initialize struct qxl_release Óscar Megía López
2026-11-22 15:21 ` sashiko-bot [this message]

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=sashiko-outbox-228038@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=megia.oscar@gmail.com \
    --cc=mst@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=virtualization@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox