From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qcow2: Fix alloc_clusters_noref() overflow detection
Date: Mon, 5 May 2014 11:36:15 +0200 [thread overview]
Message-ID: <20140505093615.GD3317@noname.str.redhat.com> (raw)
In-Reply-To: <1399174300-27583-1-git-send-email-mreitz@redhat.com>
Am 04.05.2014 um 05:31 hat Max Reitz geschrieben:
> If the very first allocation has a length of 0, the free_cluster_index
> is still 0 after the for loop, which means that subtracting one from it
> will underflow and signal an invalid range of clusters by returning
> -EFBIG. However, there is no such range, as its length is 0.
>
> Fix this by preventing underflows on free_cluster_index during the
> check.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
Heh, I wondered about this when I reviewed that other patch, and came to
the conclusion that it probably doesn't happen. Did you find a case
where it does happen in fact?
Anyway, this can't hurt:
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
next prev parent reply other threads:[~2014-05-05 9:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 3:31 [Qemu-devel] [PATCH] qcow2: Fix alloc_clusters_noref() overflow detection Max Reitz
2014-05-05 9:36 ` Kevin Wolf [this message]
2014-05-05 15:51 ` Max Reitz
2014-05-05 12:22 ` Stefan Hajnoczi
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=20140505093615.GD3317@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).