From: Paolo Abeni Date: Thu, 14 Sep 2023 06:19:59 +0000 (+0200) Subject: Merge branch 'vsock-handle-writes-to-shutdowned-socket' X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ea8f505ec51e904f4696b5e3e852b7a51c8e956d;p=linux.git Merge branch 'vsock-handle-writes-to-shutdowned-socket' Arseniy Krasnov says: ==================== vsock: handle writes to shutdowned socket this small patchset adds POSIX compliant behaviour on writes to the socket which was shutdowned with 'shutdown()' (both sides - local with SHUT_WR flag, peer - with SHUT_RD flag). According POSIX we must send SIGPIPE in such cases (but SIGPIPE is not send when MSG_NOSIGNAL is set). First patch is implemented in the same way as net/ipv4/tcp.c:tcp_sendmsg_locked(). It uses 'sk_stream_error()' function which handles EPIPE error. Another way is to use code from net/unix/af_unix.c:unix_stream_sendmsg() where same logic from 'sk_stream_error()' is implemented "from scratch", but it doesn't check 'sk_err' field. I think error from this field has more priority to be returned from syscall. So I guess it is better to reuse currently implemented 'sk_stream_error()' function. Test is also added. ==================== Link: https://lore.kernel.org/r/20230911202027.1928574-1-avkrasnov@salutedevices.com Signed-off-by: Paolo Abeni --- ea8f505ec51e904f4696b5e3e852b7a51c8e956d