summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHyunwoo Kim <v4bel@theori.io>2023-01-25 02:59:44 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-22 12:50:34 +0100
commita74d3b0ea984c89ab6eff6f98baf03ca30ba8eb8 (patch)
tree8711d3d6b6b5a9d9b86bf524de8688559de4816a /drivers
parentec54c946b4127a6025647020c61cc3ac223f8568 (diff)
net/rose: Fix to not accept on connected socket
[ Upstream commit 14caefcf9837a2be765a566005ad82cd0d2a429f ] If you call listen() and accept() on an already connect()ed rose socket, accept() can successfully connect. This is because when the peer socket sends data to sendmsg, the skb with its own sk stored in the connected socket's sk->sk_receive_queue is connected, and rose_accept() dequeues the skb waiting in the sk->sk_receive_queue. This creates a child socket with the sk of the parent rose socket, which can cause confusion. Fix rose_listen() to return -EINVAL if the socket has already been successfully connected, and add lock_sock to prevent this issue. Signed-off-by: Hyunwoo Kim <v4bel@theori.io> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://lore.kernel.org/r/20230125105944.GA133314@ubuntu Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions