[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
Re: [Qemu-devel] [PATCH v2] qemu-nbd: only send a limited number of errno codes on the wire
Fri, 08 May 2015 15:04:53 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
-----BEGIN PGP SIGNED MESSAGE-----
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----