[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200910.122241.1357846174503997660.davem@davemloft.net>
Date: Thu, 10 Sep 2020 12:22:41 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: penguin-kernel@...ove.SAKURA.ne.jp
Cc: jmaloy@...hat.com, ying.xue@...driver.com,
parthasarathy.bhuvaragan@...il.com, kuba@...nel.org,
netdev@...r.kernel.org, tipc-discussion@...ts.sourceforge.net
Subject: Re: [PATCH] tipc: fix shutdown() of connection oriented socket
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Date: Sat, 5 Sep 2020 15:14:47 +0900
> I confirmed that the problem fixed by commit 2a63866c8b51a3f7 ("tipc: fix
> shutdown() of connectionless socket") also applies to stream socket.
>
> ----------
> #include <sys/socket.h>
> #include <unistd.h>
> #include <sys/wait.h>
>
> int main(int argc, char *argv[])
> {
> int fds[2] = { -1, -1 };
> socketpair(PF_TIPC, SOCK_STREAM /* or SOCK_DGRAM */, 0, fds);
> if (fork() == 0)
> _exit(read(fds[0], NULL, 1));
> shutdown(fds[0], SHUT_RDWR); /* This must make read() return. */
> wait(NULL); /* To be woken up by _exit(). */
> return 0;
> }
> ----------
>
> Since shutdown(SHUT_RDWR) should affect all processes sharing that socket,
> unconditionally setting sk->sk_shutdown to SHUTDOWN_MASK will be the right
> behavior.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Applied and queued up for -stable, thank you.
Powered by blists - more mailing lists