linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/2] vsock: handle writes to shutdowned socket
@ 2023-08-01 14:17 Arseniy Krasnov
  2023-08-01 14:17 ` [RFC PATCH v1 1/2] vsock: send SIGPIPE on write " Arseniy Krasnov
  2023-08-01 14:17 ` [RFC PATCH v1 2/2] test/vsock: shutdowned socket test Arseniy Krasnov
  0 siblings, 2 replies; 16+ messages in thread
From: Arseniy Krasnov @ 2023-08-01 14:17 UTC (permalink / raw)
  To: Stefan Hajnoczi, Stefano Garzarella, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Michael S. Tsirkin,
	Jason Wang, Bobby Eshleman
  Cc: kvm, virtualization, netdev, linux-kernel, kernel, oxffffaa,
	avkrasnov, Arseniy Krasnov

Hello,

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.

Head for this patchset is:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=9d0cd5d25f7d45bce01bbb3193b54ac24b3a60f3

Arseniy Krasnov (2):
  vsock: send SIGPIPE on write to shutdowned socket
  test/vsock: shutdowned socket test

 net/vmw_vsock/af_vsock.c         |   3 +
 tools/testing/vsock/vsock_test.c | 138 +++++++++++++++++++++++++++++++
 2 files changed, 141 insertions(+)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-08-22 12:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-01 14:17 [RFC PATCH v1 0/2] vsock: handle writes to shutdowned socket Arseniy Krasnov
2023-08-01 14:17 ` [RFC PATCH v1 1/2] vsock: send SIGPIPE on write " Arseniy Krasnov
2023-08-02  7:46   ` Stefano Garzarella
2023-08-04 12:46     ` Arseniy Krasnov
2023-08-04 14:28       ` Stefano Garzarella
2023-08-04 14:34         ` Arseniy Krasnov
2023-08-04 15:02           ` Stefano Garzarella
2023-08-04 16:24             ` Arseniy Krasnov
2023-08-14 19:40             ` Arseniy Krasnov
2023-08-22  9:36               ` Stefano Garzarella
2023-08-14 19:46         ` Arseniy Krasnov
2023-08-22  9:39           ` Stefano Garzarella
2023-08-22 12:51             ` Arseniy Krasnov
2023-08-01 14:17 ` [RFC PATCH v1 2/2] test/vsock: shutdowned socket test Arseniy Krasnov
2023-08-02  8:00   ` Stefano Garzarella
2023-08-04 12:48     ` Arseniy Krasnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).