From: Jakub Kicinski <kuba@kernel.org>
To: Jiang Wang <jiang.wang@bytedance.com>, <cong.wang@bytedance.com>
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com>,
<bpf@vger.kernel.org>, Casey Schaufler <casey@schaufler-ca.com>,
"David S. Miller" <davem@davemloft.net>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>,
Eric Dumazet <edumazet@google.com>,
Christian Brauner <christian.brauner@ubuntu.com>,
Rao Shoaib <Rao.Shoaib@oracle.com>,
Kuniyuki Iwashima <kuniyu@amazon.co.jp>,
Jakub Sitnicki <jakub@cloudflare.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf v1] unix: fix an issue in unix_shutdown causing the other end read/write failures
Date: Fri, 19 Nov 2021 06:14:19 -0800 [thread overview]
Message-ID: <20211119061419.270007d9@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20211111140000.GA10779@axis.com>
On Thu, 11 Nov 2021 15:00:02 +0100 Vincent Whitchurch wrote:
> On Mon, Oct 04, 2021 at 11:25:28PM +0000, Jiang Wang wrote:
> > Commit 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap")
> > sets unix domain socket peer state to TCP_CLOSE
> > in unix_shutdown. This could happen when the local end is shutdown
> > but the other end is not. Then the other end will get read or write
> > failures which is not expected.
> >
> > Fix the issue by setting the local state to shutdown.
> >
> > Fixes: 94531cfcbe79 (af_unix: Add unix_stream_proto for sockmap)
> > Suggested-by: Cong Wang <cong.wang@bytedance.com>
> > Reported-by: Casey Schaufler <casey@schaufler-ca.com>
> > Signed-off-by: Jiang Wang <jiang.wang@bytedance.com>
>
> This patch changed the behaviour of read(2) after a shutdown(2) on the
> local end of a UDS. Before this patch, reading from a UDS after a local
> shutdown(SHUT_RDWR) would return the data written or EOF if there is no
> data, but now it always returns -EINVAL.
>
> For example, the following test program succeeds with "read 16 bytes" on
> v5.14 but fails with "read: Invalid argument" on v5.15 and mainline:
Cong, Jiang, was this regression addressed?
next prev parent reply other threads:[~2021-11-19 14:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-04 23:25 [PATCH bpf v1] unix: fix an issue in unix_shutdown causing the other end read/write failures Jiang Wang
2021-10-05 0:04 ` Casey Schaufler
2021-10-05 22:17 ` Song Liu
2021-10-06 12:50 ` patchwork-bot+netdevbpf
2021-11-11 14:00 ` Vincent Whitchurch
2021-11-19 14:14 ` Jakub Kicinski [this message]
2021-11-19 14:28 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211119061419.270007d9@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
--to=kuba@kernel.org \
--cc=Rao.Shoaib@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=casey@schaufler-ca.com \
--cc=christian.brauner@ubuntu.com \
--cc=cong.wang@bytedance.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jakub@cloudflare.com \
--cc=jiang.wang@bytedance.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kuniyu@amazon.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=vincent.whitchurch@axis.com \
--cc=viro@zeniv.linux.org.uk \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).