Re: [PATCH net] tls: set the copy cursor before cloning plaintext

From: patchwork-bot+netdevbpf

Date: Mon Nov 30 2026 - 11:10:11 EST


Hello:

This patch was applied to netdev/net.git (main)
by Willem de Bruijn <willemb@xxxxxxxxxx>:

On Mon, 23 Nov 2026 01:38:42 -0500 you wrote:
> tls_sw_sendmsg_locked() copies into the open record by cloning space
> with tls_clone_plaintext_msg() and filling it with
> sk_msg_memcopy_from_iter(), which starts at sg.curr and sg.copybreak
> as left by whatever last added to the record. The copy trusts other
> paths to leave that cursor in the right state, and they have not.
>
> Since commit d829e9c4112b ("tls: convert to generic sk_msg interface"),
> the path that adds the caller's own pages (sendpage, later splice) did
> not move sg.curr, so the next copy wrote into those pages. Commit
> c5a595000e26 ("net: tls, update curr on splice as well") fixed that by
> making the splice path leave sg.curr at sg.end with copybreak 0. That
> is only correct if the clone adds a new element. sk_msg_clone() instead
> grows the last element when the cloned range is contiguous with it, so
> sg.end does not move, and the copy starts at an unused slot, wraps
> around the ring and writes from sg.start, into the spliced pages again.
>
> [...]

Here is the summary with links:
- [net] tls: set the copy cursor before cloning plaintext
https://git.kernel.org/netdev/net/c/80a141905909

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html