From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>, Max Reitz <mreitz@redhat.com>,
qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] nbd: Don't inf-loop on early EOF
Date: Wed, 9 Nov 2016 14:05:19 +0100 [thread overview]
Message-ID: <4b3c5574-d1a5-9ce1-f2e5-c70f3ae12515@redhat.com> (raw)
In-Reply-To: <5e7c4a2a-d2d4-7174-471a-d0a5232d2023@redhat.com>
On 07/11/2016 23:45, Eric Blake wrote:
> On 11/07/2016 04:22 PM, Max Reitz wrote:
>> On 07.11.2016 21:38, Eric Blake wrote:
>>> Commit 7d3123e converted a single read_sync() into a while loop
>>> that assumed that read_sync() would either make progress or give
>>> an error. But when the server hangs up early, the client sees
>>> EOF (a read_sync() of 0) and never makes progress, which in turn
>>> caused qemu-iotest './check -nbd 83' to go into an infinite loop.
>>>
>>> Rework the loop to accomodate reads cut short by EOF.
>>>
>>> Reported-by: Max Reitz <mreitz@redhat.com>
>>> Signed-off-by: Eric Blake <eblake@redhat.com>
>>> ---
>>> nbd/client.c | 13 +++++++------
>>> 1 file changed, 7 insertions(+), 6 deletions(-)
>>
>> Reviewed-by: Max Reitz <mreitz@redhat.com>
>>
>> But what about the server's nbd_negotiate_drop_sync()? It uses pretty
>> much the same code, so it seems susceptible to the same issue (only that
>> we don't have a test for that side).
>
> If so, that's an older bug (pre-existing back to at least 2.6?), so it
> should be a separate fix, if anything.
>
> I guess it's time to figure out how to test the server against
> ill-behaved clients...
Using afl perhaps?
Paolo
prev parent reply other threads:[~2016-11-09 13:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 20:38 [Qemu-devel] [PATCH] nbd: Don't inf-loop on early EOF Eric Blake
2016-11-07 22:10 ` [Qemu-devel] [PATCH for-2.8] " Eric Blake
2016-11-07 22:22 ` [Qemu-devel] [PATCH] " Max Reitz
2016-11-07 22:45 ` Eric Blake
2016-11-09 13:05 ` Paolo Bonzini [this message]
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=4b3c5574-d1a5-9ce1-f2e5-c70f3ae12515@redhat.com \
--to=pbonzini@redhat.com \
--cc=eblake@redhat.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).