From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire
Date: Fri, 08 May 2015 15:04:53 +0200 [thread overview]
Message-ID: <554CB475.4030806@redhat.com> (raw)
In-Reply-To: <554CB401.2060608@redhat.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 08/05/2015 15:02, Eric Blake wrote:
>>>>> Do we also want to handle "case 0: return 0;" on either
>>>>> conversion, or even "case 0: abort();" to ensure that
>>>>> callers are using these helpers correctly?
>>>
>>> Yes, it's much better that way.
> Thinking about it a bit more: abort() is fine on the sending side,
> to ensure we aren't putting garbage on the wire; but abort() on
> the receiving side is a bit risky (we should be handling a
> corrupted incoming stream gracefully - a malicious sender should
> not be able to crash us). Of course, once we've detected a
> corrupted incoming stream, we can't do much for the block device
> the stream was supposed to represent (perhaps treat it as EIO and
> declare the device dead), but that's still better than aborting.
I've included "case 0: return 0;" in the pull request.
Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJVTLRxAAoJEL/70l94x66DiU0IAIc9c7XNRGkOzvx8Dr/euTZh
urx9OVG4Mwpust8KDmquuBJUv18Xu+omh9AxWOkF5ChZUGBwVxyt0N4sKPreVXK2
zJgObt+5cV4o1FXMb3QcFn1CD7s6+8V8T2QukGTviCsIwRaovwpBQAMuT4N5aJWY
BTkCE8GiGTVYiWhV+Uz3UML33j5mXJ4WM2LP11ndsKZpFNMvezwo9iyvQe28EqrI
Cj6xz+pLbnOtTu3/Kdf1SMA4FK9loH7/y6fth833TIBE/OIyY+PEtNKoq7TJzc3i
/S58dVjXNZAez1Bf0Hb9rMCKsGg/MSv7mGPU5IsLQSKgZ0i154ZzJFxifkXnzYU=
=fZNP
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2015-05-08 13:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 9:50 [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire Paolo Bonzini
2015-05-08 10:12 ` Markus Armbruster
2015-05-08 10:27 ` Paolo Bonzini
2015-05-08 10:40 ` Richard W.M. Jones
2015-05-08 12:35 ` Eric Blake
2015-05-08 12:40 ` Eric Blake
2015-05-08 12:41 ` Paolo Bonzini
2015-05-08 13:02 ` Eric Blake
2015-05-08 13:04 ` Paolo Bonzini [this message]
2015-05-09 14:29 ` Thomas Schwinge
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=554CB475.4030806@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--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).