nuttx/net/local
zhanghongyu 3db1654b80 net/local: remove client from server.lc_waiters when client close
if client is a noblocking socket, user can do close when server has not yet
invoke accept interface, so we need remove this socket from server.lc_waiters.
avoid server socket access the freed memory.

==936564==ERROR: AddressSanitizer: heap-use-after-free on address 0xf23071c8 at pc 0x58eaac3b bp 0xf0b9e218 sp 0xf0b9e208
READ of size 4 at 0xf23071c8 thread T0
    #0 0x58eaac3a in dq_remfirst queue/dq_remfirst.c:45
    #1 0x58fd1efe in local_accept local/local_accept.c:141
    #2 0x58f66df6 in psock_accept socket/accept.c:149
    #3 0x58f672a4 in accept4 socket/accept.c:280
    #4 0x5be9ee0c in accept net/lib_accept.c:50
    #5 0x592d6a5d in uv__accept libuv/src/unix/core.c:502
    #6 0x5930d83b in uv__server_io libuv/src/unix/stream.c:550
    #7 0x592efbde in uv__io_poll libuv/src/unix/posix-poll.c:335
    #8 0x592d649a in uv_run libuv/src/unix/core.c:387
    #9 0x5a7180f7 in service_schedule_loop service/common/service_loop.c:146
    #10 0x591f300b in pthread_startup pthread/pthread_create.c:59
    #11 0x5be8134f in pthread_start pthread/pthread_create.c:139
    #12 0x58ee2762 in pre_start sim/sim_initialstate.c:53

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-07-17 09:01:36 +02:00
..
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
Kconfig net/local: rename NET_LOCAL_VFS_PATH to follow linux 2023-01-04 20:50:38 +08:00
local_accept.c net/local: Support the abstract path to connect 2023-07-14 09:57:24 +08:00
local_bind.c net: remove conn-related casts 2023-05-10 19:32:09 -03:00
local_conn.c sched/getpid: replace syscall getpid/tid/ppid() to kernel version 2023-02-02 10:33:01 +08:00
local_connect.c net: remove conn-related casts 2023-05-10 19:32:09 -03:00
local_fifo.c net/local: Support the socketpair interface of local udp socket. 2023-07-12 03:31:43 +08:00
local_listen.c net/local: Support the abstract path to connect 2023-07-14 09:57:24 +08:00
local_netpoll.c net/local: Support the abstract path to connect 2023-07-14 09:57:24 +08:00
local_recvmsg.c net/local: Support the socketpair interface of local udp socket. 2023-07-12 03:31:43 +08:00
local_recvutils.c net/local: Return -EINVAL if the address length passed to local_bind is too small 2022-12-18 20:12:30 +02:00
local_release.c net/local: remove client from server.lc_waiters when client close 2023-07-17 09:01:36 +02:00
local_sendmsg.c net/local: Support the socketpair interface of local udp socket. 2023-07-12 03:31:43 +08:00
local_sendpacket.c net/local: Remove the sync preamble from datagram 2022-08-10 09:50:25 +03:00
local_sockif.c net/local: Support the socketpair interface of local udp socket. 2023-07-12 03:31:43 +08:00
local.h net/local: Support the socketpair interface of local udp socket. 2023-07-12 03:31:43 +08:00
Make.defs