From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.11] qcow2: Fix overly broad madvise()
Date: Wed, 15 Nov 2017 14:51:01 +0100 [thread overview]
Message-ID: <bcb8ada9-059f-1bc6-10f3-94eeeb29ffab@redhat.com> (raw)
In-Reply-To: <w51efozkiwf.fsf@maestria.local.igalia.com>
[-- Attachment #1: Type: text/plain, Size: 991 bytes --]
On 2017-11-15 10:09, Alberto Garcia wrote:
> On Tue 14 Nov 2017 07:41:27 PM CET, Max Reitz wrote:
>> @mem_size and @offset are both size_t, thus subtracting them from one
>> another will just return a big size_t if mem_size < offset -- even more
>> obvious here because the result is stored in another size_t.
>>
>> Checking that result to be positive is therefore not sufficient to
>> excluse the case that offset > mem_size. Thus, we currently sometimes
>> issue an madvise() over a very large address range.
>>
>> This is triggered by iotest 163, but with -m64, this does not result in
>> tangible problems. But with -m32, this test produces three segfaults,
>> all of which are fixed by this patch.
>>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>
> Oh, I guess this happens when the page size is larger than the cluster
> size? Otherwise I don't see how...
>
> Reviewed-by: Alberto Garcia <berto@igalia.com>
Yes, the test uses 512 byte clusters.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
next prev parent reply other threads:[~2017-11-15 13:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-14 18:41 [Qemu-devel] [PATCH for-2.11] qcow2: Fix overly broad madvise() Max Reitz
2017-11-14 19:51 ` Eric Blake
2017-11-15 9:09 ` Alberto Garcia
2017-11-15 13:51 ` Max Reitz [this message]
2017-11-15 11:04 ` [Qemu-devel] [Qemu-block] " Darren Kenny
2017-11-15 11:09 ` Darren Kenny
2017-11-15 20:30 ` [Qemu-devel] " Max Reitz
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=bcb8ada9-059f-1bc6-10f3-94eeeb29ffab@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@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).