]> Gentwo Git Trees - linux/.git/commit
ksmbd: close accepted socket when per-IP limit rejects connection
authorJoshua Rogers <linux@joshua.hu>
Sat, 8 Nov 2025 14:59:23 +0000 (22:59 +0800)
committerSteve French <stfrench@microsoft.com>
Sun, 9 Nov 2025 23:47:52 +0000 (17:47 -0600)
commit98a5fd31cbf72d46bf18e50b3ab0ce86d5f319a9
tree1317104aa262b5a084c62da667fdd1d11aaa74cd
parente904d81ad1c04394e1cda4610de799a006cc141c
ksmbd: close accepted socket when per-IP limit rejects connection

When the per-IP connection limit is exceeded in ksmbd_kthread_fn(),
the code sets ret = -EAGAIN and continues the accept loop without
closing the just-accepted socket. That leaks one socket per rejected
attempt from a single IP and enables a trivial remote DoS.

Release client_sk before continuing.

This bug was found with ZeroPath.

Cc: stable@vger.kernel.org
Signed-off-by: Joshua Rogers <linux@joshua.hu>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/transport_tcp.c