Messages in this thread | | | Date | Tue, 15 Mar 2022 12:49:24 +0100 | From | Stefano Garzarella <> | Subject | Re: [RFC PATCH v1 3/3] af_vsock: SOCK_SEQPACKET broken buffer test |
| |
On Tue, Mar 15, 2022 at 09:34:35AM +0000, Krasnov Arseniy Vladimirovich wrote: >On 15.03.2022 11:36, Stefano Garzarella wrote: >> >> Is this the right behavior? If read() fails because the buffer is invalid, do we throw out the whole packet? >> >> I was expecting the packet not to be consumed, have you tried AF_UNIX, does it have the same behavior? > >I've just checked AF_UNIX implementation of SEQPACKET receive in net/unix/af_unix.c. So, if 'skb_copy_datagram_msg()' >fails, it calls 'skb_free_datagram()'. I think this means that whole sk buff will be dropped, but anyway, i'll check >this behaviour in practice. See '__unix_dgram_recvmsg()' in net/unix/af_unix.c. >
Yep. you are right it seems to be discarded but I don't know that code very well, so better to test as you said ;-)
Thanks, Stefano
| |