From: Kevin Wolf <kwolf@redhat.com>
To: Alberto Garcia <berto@igalia.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v3] qcow2: Avoid integer wraparound in qcow2_co_truncate()
Date: Tue, 5 May 2020 11:16:24 +0200 [thread overview]
Message-ID: <20200505091624.GE5759@linux.fritz.box> (raw)
In-Reply-To: <20200505085412.GD5759@linux.fritz.box>
Am 05.05.2020 um 10:54 hat Kevin Wolf geschrieben:
> Am 04.05.2020 um 19:07 hat Alberto Garcia geschrieben:
> > On Mon 04 May 2020 06:01:19 PM CEST, Eric Blake wrote:
> > >> +_supported_fmt qcow2
> > >> +_supported_proto file
> > >
> > > Do we have to limit it to qcow2 and file? Yes, it's testing a bugfix
> > > for qcow2, but are there other formats that it doesn't hurt to have
> > > the extra testing?
> >
> > It doesn't work with any other format at the moment (meaning: reading
> > the tail of the image after growing it returns the data from the backing
> > file).
> >
> > Also, it seems that qemu-img's -F does not work with other formats
> > either.
> >
> > > Also, I don't see anything preventing this from working with non-file
> > > protocol.
> >
> > Right, that can be updated I guess (whoever commits this, feel free to
> > do it).
>
> I don't know for which protocols it works. I know that qcow2 over nbd
> doesn't work.
>
> But I think there is a more important problem with the test: It seems to
> pass even with old binaries that don't have the fix. Is this only on my
> system or do you get the same?
Ah, I do get the overflow in the calculation of the length for
qcow2_cluster_zeroize(), but size_to_clusters() inside the function
overflows back the other direction, so this ends up with
nb_clusters = 0 and we don't do anything bad.
We could probably trigger a bad case with data_file_raw=on, but then we
don't have a backing file, so nothing sets BDRV_REQ_ZERO_WRITE.
So I guess the bug isn't even really testable, but we just add the test
in case something else in the same scenario breaks?
Kevin
next prev parent reply other threads:[~2020-05-05 9:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 15:52 [PATCH v3] qcow2: Avoid integer wraparound in qcow2_co_truncate() Alberto Garcia
2020-05-04 16:01 ` Eric Blake
2020-05-04 17:07 ` Alberto Garcia
2020-05-05 8:54 ` Kevin Wolf
2020-05-05 9:16 ` Kevin Wolf [this message]
2020-05-05 9:16 ` Alberto Garcia
2020-05-05 9:19 ` Kevin Wolf
2020-05-05 8:33 ` no-reply
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=20200505091624.GE5759@linux.fritz.box \
--to=kwolf@redhat.com \
--cc=berto@igalia.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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).