From 2c3e2ed2bf4aa61bf317545fe428ff3adac95f92 Mon Sep 17 00:00:00 2001 From: Jianfeng Tan Date: Mon, 19 Aug 2019 23:13:03 +0800 Subject: unix: return ECONNRESET if peer closed with data not read For SOCK_STREAM type unix socket, we shall return ECONNRESET if peer is closed with data not read. We explictly set a flag when closing one end, to differentiate from just shutdown (where zero shall be returned). Fixes: #735 Signed-off-by: Jianfeng Tan --- pkg/sentry/fs/host/socket.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/sentry/fs') diff --git a/pkg/sentry/fs/host/socket.go b/pkg/sentry/fs/host/socket.go index 2392787cb..107336a3e 100644 --- a/pkg/sentry/fs/host/socket.go +++ b/pkg/sentry/fs/host/socket.go @@ -385,3 +385,6 @@ func (c *ConnectedEndpoint) RecvMaxQueueSize() int64 { func (c *ConnectedEndpoint) Release() { c.ref.DecRefWithDestructor(c.close) } + +// CloseUnread implements transport.ConnectedEndpoint.CloseUnread. +func (c *ConnectedEndpoint) CloseUnread() {} -- cgit v1.2.3