lkml.org 
[lkml]   [2021]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH bpf v1] unix: fix an issue in unix_shutdown causing the other end read/write failures
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?

\
 
 \ /
  Last update: 2021-11-19 15:15    [W:1.979 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site