From: Stefan Hajnoczi <stefanha@gmail.com>
To: gerben@altlinux.org
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, hreitz@redhat.com,
sdl.qemu@linuxtesting.org
Subject: Re: [PATCH] block/qed: fix use-after-free by nullifying timer pointer after free
Date: Thu, 6 Mar 2025 10:21:42 +0800 [thread overview]
Message-ID: <20250306022142.GA304567@fedora> (raw)
In-Reply-To: <20250304083927.37681-1-gerben@altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 833 bytes --]
On Tue, Mar 04, 2025 at 11:39:10AM +0300, gerben@altlinux.org wrote:
> From: Denis Rastyogin <gerben@altlinux.org>
>
> This error was discovered by fuzzing qemu-img.
>
> In the QED block driver, the need_check_timer timer is freed in
> bdrv_qed_detach_aio_context, but the pointer to the timer is not
> set to NULL. This can lead to a use-after-free scenario
> in bdrv_qed_drain_begin().
>
> The need_check_timer pointer is set to NULL after freeing the timer.
> Which helps catch this condition when checking in bdrv_qed_drain_begin().
>
> Closes: https://gitlab.com/qemu-project/qemu/-/issues/2852
> Signed-off-by: Denis Rastyogin <gerben@altlinux.org>
> ---
> block/qed.c | 1 +
> 1 file changed, 1 insertion(+)
Thanks, applied to my block tree:
https://gitlab.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2025-03-06 2:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 8:39 [PATCH] block/qed: fix use-after-free by nullifying timer pointer after free gerben
2025-03-06 2:21 ` Stefan Hajnoczi [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=20250306022142.GA304567@fedora \
--to=stefanha@gmail.com \
--cc=gerben@altlinux.org \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sdl.qemu@linuxtesting.org \
/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;
as well as URLs for NNTP newsgroup(s).