]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: tls, update curr on splice as well
authorJohn Fastabend <john.fastabend@gmail.com>
Wed, 6 Dec 2023 23:27:05 +0000 (15:27 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Dec 2023 17:52:28 +0000 (09:52 -0800)
The curr pointer must also be updated on the splice similar to how
we do this for other copy types.

Fixes: d829e9c4112b ("tls: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Reported-by: Jann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20231206232706.374377-2-john.fastabend@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_sw.c

index 316f761879624d688af85b60527868d5f0d00a49..e37b4d2e2acde25d6879770629b3996d03860c56 100644 (file)
@@ -952,6 +952,8 @@ static int tls_sw_sendmsg_splice(struct sock *sk, struct msghdr *msg,
                }
 
                sk_msg_page_add(msg_pl, page, part, off);
+               msg_pl->sg.copybreak = 0;
+               msg_pl->sg.curr = msg_pl->sg.end;
                sk_mem_charge(sk, part);
                *copied += part;
                try_to_copy -= part;