From: Christoph Hellwig <hch@lst.de>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Maxim Levitsky <maximlevitsky@gmail.com>,
Alex Dubov <oakad@yahoo.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-block@vger.kernel.org,
virtualization@lists.linux-foundation.org,
linux-mmc@vger.kernel.org
Subject: Re: [PATCH 2/5] virtio_blk: simplify refcounting
Date: Thu, 3 Feb 2022 14:06:22 +0100 [thread overview]
Message-ID: <20220203130622.GA12361@lst.de> (raw)
In-Reply-To: <YfudSXcT2rNh/Jhl@stefanha-x1.localdomain>
On Thu, Feb 03, 2022 at 09:15:53AM +0000, Stefan Hajnoczi wrote:
> /* Make sure no work handler is accessing the device. */
> flush_work(&vblk->config_work);
>
> del_gendisk(vblk->disk);
> blk_cleanup_disk(vblk->disk);
> ^--- is virtblk_free_disk() called here?
> blk_mq_free_tag_set(&vblk->tag_set);
> ^--- use after free
Yeah. We need to split up blk_cleanup_disk again for this into
separate calls to blk_cleanup_queue and put_disk..
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Maxim Levitsky <maximlevitsky@gmail.com>,
Alex Dubov <oakad@yahoo.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
linux-mmc@vger.kernel.org,
virtualization@lists.linux-foundation.org,
linux-block@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 2/5] virtio_blk: simplify refcounting
Date: Thu, 3 Feb 2022 14:06:22 +0100 [thread overview]
Message-ID: <20220203130622.GA12361@lst.de> (raw)
In-Reply-To: <YfudSXcT2rNh/Jhl@stefanha-x1.localdomain>
On Thu, Feb 03, 2022 at 09:15:53AM +0000, Stefan Hajnoczi wrote:
> /* Make sure no work handler is accessing the device. */
> flush_work(&vblk->config_work);
>
> del_gendisk(vblk->disk);
> blk_cleanup_disk(vblk->disk);
> ^--- is virtblk_free_disk() called here?
> blk_mq_free_tag_set(&vblk->tag_set);
> ^--- use after free
Yeah. We need to split up blk_cleanup_disk again for this into
separate calls to blk_cleanup_queue and put_disk..
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2022-02-03 13:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-02 15:56 add a ->free_disk block_device_operation Christoph Hellwig
2022-02-02 15:56 ` Christoph Hellwig
2022-02-02 15:56 ` [PATCH 1/5] block: add a ->free_disk method Christoph Hellwig
2022-02-02 15:56 ` Christoph Hellwig
2022-02-02 15:56 ` [PATCH 2/5] virtio_blk: simplify refcounting Christoph Hellwig
2022-02-02 15:56 ` Christoph Hellwig
2022-02-03 6:27 ` Michael S. Tsirkin
2022-02-03 6:27 ` Michael S. Tsirkin
2022-02-03 9:15 ` Stefan Hajnoczi
2022-02-03 9:15 ` Stefan Hajnoczi
2022-02-03 13:06 ` Christoph Hellwig [this message]
2022-02-03 13:06 ` Christoph Hellwig
2022-02-02 15:56 ` [PATCH 3/5] memstick/ms_block: " Christoph Hellwig
2022-02-02 15:56 ` Christoph Hellwig
2022-02-02 15:56 ` [PATCH 4/5] memstick/mspro_block: fix handling of read-only devices Christoph Hellwig
2022-02-02 15:56 ` Christoph Hellwig
2022-02-02 15:56 ` [PATCH 5/5] memstick/mspro_block: simplify refcounting Christoph Hellwig
2022-02-02 15:56 ` Christoph Hellwig
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=20220203130622.GA12361@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=jasowang@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=maximlevitsky@gmail.com \
--cc=mst@redhat.com \
--cc=oakad@yahoo.com \
--cc=pbonzini@redhat.com \
--cc=stefanha@redhat.com \
--cc=ulf.hansson@linaro.org \
--cc=virtualization@lists.linux-foundation.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 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.