qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 3/3] iotests/283: Check that finalize drops backup-top
Date: Fri, 19 Feb 2021 16:59:02 +0100	[thread overview]
Message-ID: <244e3b6f-591c-2e5b-64a8-b0f7eb295220@redhat.com> (raw)
In-Reply-To: <20210219153348.41861-4-mreitz@redhat.com>

On 19.02.21 16:33, Max Reitz wrote:
> Without any of HEAD^ or HEAD^^ applied, qemu will most likely crash on
> the qemu-io invocation, for a variety of immediate reasons.  The
> underlying problem is generally a use-after-free access into
> backup-top's BlockCopyState.
> 
> With only HEAD^ applied, qemu-io will run into an EIO (which is not
> capture by the output, but you can see that the qemu-io invocation will
> be accepted (i.e., qemu-io will run) in contrast to the reference
> output, where the node name cannot be found), and qemu will then crash
> in query-named-block-nodes: bdrv_get_allocated_file_size() detects
> backup-top to be a filter and passes the request through to its child.
> However, after bdrv_backup_top_drop(), that child is NULL, so the
> recursive call crashes.
> 
> With HEAD^^ applied, this test should pass.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   tests/qemu-iotests/283     | 55 ++++++++++++++++++++++++++++++++++++++
>   tests/qemu-iotests/283.out | 15 +++++++++++
>   2 files changed, 70 insertions(+)
> 
> diff --git a/tests/qemu-iotests/283 b/tests/qemu-iotests/283
> index 79643e375b..509dcbbcf4 100755
> --- a/tests/qemu-iotests/283
> +++ b/tests/qemu-iotests/283
> @@ -97,3 +97,58 @@ vm.qmp_log('blockdev-add', **{
>   vm.qmp_log('blockdev-backup', sync='full', device='source', target='target')
>   
>   vm.shutdown()
> +
> +
> +"""
> +Check that the backup-top node is gone after job-finalize.
> +
> +During finalization, the node becomes inactive and can no longer
> +function.  If it is still present, new parents might be attached, and
> +there would be no meaningful way to handle their I/O requests.
> +"""

Oh no, 297/pylint complains that this “string statement has no effect”. 
  Guess it should be a normal comment under the following print() then...

Max

> +print('\n=== backup-top should be gone after job-finalize ===\n')



  reply	other threads:[~2021-02-19 16:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 15:33 [PATCH 0/3] backup-top: Don't crash on post-finalize accesses Max Reitz
2021-02-19 15:33 ` [PATCH 1/3] backup: Remove nodes from job in .clean() Max Reitz
2021-02-24 15:33   ` Kevin Wolf
2021-02-19 15:33 ` [PATCH 2/3] backup-top: Refuse I/O in inactive state Max Reitz
2021-02-19 15:33 ` [PATCH 3/3] iotests/283: Check that finalize drops backup-top Max Reitz
2021-02-19 15:59   ` Max Reitz [this message]
2021-02-24 15:50     ` Kevin Wolf

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=244e3b6f-591c-2e5b-64a8-b0f7eb295220@redhat.com \
    --to=mreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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;
as well as URLs for NNTP newsgroup(s).