acrn-kernel/net/rose
Hyunwoo Kim 14caefcf98 net/rose: Fix to not accept on connected socket
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>
2023-01-28 00:19:57 -08:00
..
Makefile
af_rose.c net/rose: Fix to not accept on connected socket 2023-01-28 00:19:57 -08:00
rose_dev.c
rose_in.c
rose_link.c rose: Fix NULL pointer dereference in rose_send_frame() 2022-11-02 11:57:30 +00:00
rose_loopback.c rose: check NULL rose_loopback_neigh->loopback 2022-08-22 14:24:54 +01:00
rose_out.c
rose_route.c net: rose: fix netdev reference changes 2022-08-01 11:59:23 -07:00
rose_subr.c
rose_timer.c
sysctl_net_rose.c