Re: [Qemu-devel] [PATCH 1/2] nbd: Drop connection if broken server is detected

2017-08-11 Thread Eric Blake
On 08/11/2017 03:01 PM, Eric Blake wrote: > On 08/11/2017 02:41 PM, Eric Blake wrote: >>> Hmm, was it correct even before your patch? Is it safe to enter a coroutine >>> (which we've scheduled by nbd_recv_coroutines_enter_all()), which is >>> actually >>> yielded inside nbd_rwv (not our yield in nb

Re: [Qemu-devel] [PATCH 1/2] nbd: Drop connection if broken server is detected

2017-08-11 Thread Eric Blake
On 08/11/2017 02:41 PM, Eric Blake wrote: >> Hmm, was it correct even before your patch? Is it safe to enter a coroutine >> (which we've scheduled by nbd_recv_coroutines_enter_all()), which is >> actually >> yielded inside nbd_rwv (not our yield in nbd_co_receive_reply)? > > I'm honestly not sure

Re: [Qemu-devel] [PATCH 1/2] nbd: Drop connection if broken server is detected

2017-08-11 Thread Eric Blake
On 08/11/2017 09:53 AM, Vladimir Sementsov-Ogievskiy wrote: > 11.08.2017 17:15, Eric Blake wrote: >> On 08/11/2017 02:48 AM, Vladimir Sementsov-Ogievskiy wrote: >>> 11.08.2017 05:37, Eric Blake wrote: As soon as the server is sending us garbage, we should quit trying to send further messa

Re: [Qemu-devel] [PATCH 1/2] nbd: Drop connection if broken server is detected

2017-08-11 Thread Vladimir Sementsov-Ogievskiy
11.08.2017 17:15, Eric Blake wrote: On 08/11/2017 02:48 AM, Vladimir Sementsov-Ogievskiy wrote: 11.08.2017 05:37, Eric Blake wrote: As soon as the server is sending us garbage, we should quit trying to send further messages to the server, and allow all pending coroutines for any remaining repli

Re: [Qemu-devel] [PATCH 1/2] nbd: Drop connection if broken server is detected

2017-08-11 Thread Eric Blake
On 08/11/2017 02:48 AM, Vladimir Sementsov-Ogievskiy wrote: > 11.08.2017 05:37, Eric Blake wrote: >> As soon as the server is sending us garbage, we should quit >> trying to send further messages to the server, and allow all >> pending coroutines for any remaining replies to error out. >> Failure t

Re: [Qemu-devel] [PATCH 1/2] nbd: Drop connection if broken server is detected

2017-08-11 Thread Vladimir Sementsov-Ogievskiy
11.08.2017 05:37, Eric Blake wrote: As soon as the server is sending us garbage, we should quit trying to send further messages to the server, and allow all pending coroutines for any remaining replies to error out. Failure to do so can let a malicious server cause the client to hang, for example

[Qemu-devel] [PATCH 1/2] nbd: Drop connection if broken server is detected

2017-08-10 Thread Eric Blake
As soon as the server is sending us garbage, we should quit trying to send further messages to the server, and allow all pending coroutines for any remaining replies to error out. Failure to do so can let a malicious server cause the client to hang, for example, if the server sends an invalid magic