]> git.hungrycats.org Git - linux/commit
ksmbd: track delivery of queued TCP writes
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 3 Nov 2026 17:03:26 +0000 (12:03 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2026 17:10:53 +0000 (12:10 -0500)
commitc814ae191f8ec88e2dc44cff76c8c44cd6b621f7
treed423475fac6db11a59af6eb98f57a19d93d61a11
parent234689e9d91490ecf8184097562187f99e2ebb61
ksmbd: track delivery of queued TCP writes

[ Upstream commit c0632d2010ffc006eed9becc8d0d10d54f294bbd ]

A nonblocking break send must distinguish a PDU accepted by TCP from one
still queued in ksmbd. Retrying an accepted PDU can send duplicates, while
abandoning a partial send can corrupt the stream.

Queue owned PDU bytes when TCP cannot accept the full message. Track the
stream position through socket delivery and TCP ACK, and expose it to break
retries. Bound retained data and stop queued writes during teardown.

Reported-by: Pan Guihua <pan.guihua@datatom.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Stable-dep-of: f728cfee6929 ("ksmbd: fix app-instance non-durable supersede session UAF")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/server/connection.c
fs/smb/server/connection.h
fs/smb/server/transport_tcp.c