qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errn


From: Paolo Bonzini
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

-----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-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]