public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: stable@vger.kernel.org, jannh@google.com, gregkh@linuxfoundation.org
Cc: john.fastabend@gmail.com, kuba@kernel.org, daniel@iogearbox.net,
	borisp@nvidia.com
Subject: [PATCH] net: tls, update curr on splice as well
Date: Tue,  9 Jan 2024 14:59:56 -0800	[thread overview]
Message-ID: <20240109225956.279609-1-john.fastabend@gmail.com> (raw)

commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.

Backport of upstream fix for tls on 5.x kernels.

The curr pointer must also be updated on the splice similar to how
we do this for other copy types.

Cc: stable@vger.kernel.org # 5.15.x
Cc: stable@vger.kernel.org # 5.10.x
Cc: stable@vger.kernel.org # 5.4.x
Reported-by: Jann Horn <jannh@google.com>
Fixes: d829e9c4112b ("tls: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
 net/tls/tls_sw.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 101d231c1b61..9ff3e4df2d6c 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1216,6 +1216,8 @@ static int tls_sw_do_sendpage(struct sock *sk, struct page *page,
 		}
 
 		sk_msg_page_add(msg_pl, page, copy, offset);
+		msg_pl->sg.copybreak = 0;
+		msg_pl->sg.curr = msg_pl->sg.end;
 		sk_mem_charge(sk, copy);
 
 		offset += copy;
-- 
2.33.0

             reply	other threads:[~2024-01-09 23:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 22:59 John Fastabend [this message]
2024-01-11  9:56 ` [PATCH] net: tls, update curr on splice as well Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2023-12-14 19:45 John Fastabend

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240109225956.279609-1-john.fastabend@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=borisp@nvidia.com \
    --cc=daniel@iogearbox.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jannh@google.com \
    --cc=kuba@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox