summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2026-10-09 12:02:13 +0200
committerNamjae Jeon <linkinjeon@kernel.org>2026-10-09 19:58:40 +0900
commitc6d95b5ff9e1f69d18cbb8fb837cd57a4b8fa18d (patch)
tree0e47ae306a3bcb94c7c033294befce1bc5e26c3c /include/uapi
parentabea8cf175b4686427ad542735b9e8536e2c505c (diff)
downloadlinux-next-c6d95b5ff9e1f69d18cbb8fb837cd57a4b8fa18d.tar.gz
linux-next-c6d95b5ff9e1f69d18cbb8fb837cd57a4b8fa18d.zip
smb: smbdirect: don't hand out already failed sockets in smbdirect_socket_accept()
A socket on the ready list is in SMBDIRECT_SOCKET_NEGOTIATE_RUNNING, but it may fail before smbdirect_socket_accept() picks it up, e.g. RDMA_CM_EVENT_DISCONNECTED already moved it to SMBDIRECT_SOCKET_DISCONNECTED. smbdirect_socket_accept() unconditionally overwrote the status with SMBDIRECT_SOCKET_CONNECTED and handed out the already disconnected socket. smbdirect_socket_cleanup_work() then called rdma_disconnect() on it again, and before the recent commit smbdirect_socket_destroy_sync() waited forever for an RDMA_CM_EVENT_DISCONNECTED that already happened. Now we check first_error and change the status to SMBDIRECT_SOCKET_CONNECTED only via cmpxchg() from SMBDIRECT_SOCKET_NEGOTIATE_RUNNING, while we still hold listen.lock. If the socket already failed, we move it to the orphaned list and queue purge_orphaned_work, like smbdirect_listen_orphan_socket() does, and try the next one. If we only found failed sockets, we wait for the next one. Fixes: dc691b91ad16 ("smb: smbdirect: introduce smbdirect_socket_{listen,accept}()") Reported-by: Sashiko <sashiko-bot+sashiko@kernel.org> Closes: https://sashiko.dev/#/patchset/cover.1791224972.git.metze%40samba.org Closes: https://sashiko.dev/#/bug/linux-f9dbca09-30a7-4145-9bdb-4676759982c8 Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: Paulo Alcantara <pc@manguebit.org> Cc: Tom Talpey <tom@talpey.com> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions