public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: tls, update curr on splice as well
@ 2023-12-14 19:45 John Fastabend
  2024-01-08 13:10 ` [missing stable fix on 5.x] " Jann Horn
  0 siblings, 1 reply; 4+ messages in thread
From: John Fastabend @ 2023-12-14 19:45 UTC (permalink / raw)
  To: kuba, jannh, daniel; +Cc: john.fastabend, borisp, stable

commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.

Backport of upstream fix for tls on 6.1 and lower 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 # 6.1.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 2e60bf06adff..0323040d34bc 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1225,6 +1225,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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [missing stable fix on 5.x] [PATCH] net: tls, update curr on splice as well
  2023-12-14 19:45 [PATCH] net: tls, update curr on splice as well John Fastabend
@ 2024-01-08 13:10 ` Jann Horn
  2024-01-08 14:07   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Jann Horn @ 2024-01-08 13:10 UTC (permalink / raw)
  To: John Fastabend, stable, Greg Kroah-Hartman
  Cc: Jakub Kicinski, Daniel Borkmann, Boris Pismenny

On Thu, Dec 14, 2023 at 8:45 PM John Fastabend <john.fastabend@gmail.com> wrote:
> commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.
>
> Backport of upstream fix for tls on 6.1 and lower 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 # 6.1.x-

I think this Cc marker was wrong - the commit message says "on 6.1 and
lower kernels", but this marker seems to say "6.1 and *newer*
kernels". The current status is that this issue is fixed on 6.6.7 and
6.1.69, but not on the 5.x stable kernels.

> 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 2e60bf06adff..0323040d34bc 100644
> --- a/net/tls/tls_sw.c
> +++ b/net/tls/tls_sw.c
> @@ -1225,6 +1225,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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [missing stable fix on 5.x] [PATCH] net: tls, update curr on splice as well
  2024-01-08 13:10 ` [missing stable fix on 5.x] " Jann Horn
@ 2024-01-08 14:07   ` Greg Kroah-Hartman
  2024-01-09  0:50     ` John Fastabend
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-08 14:07 UTC (permalink / raw)
  To: Jann Horn
  Cc: John Fastabend, stable, Jakub Kicinski, Daniel Borkmann,
	Boris Pismenny

On Mon, Jan 08, 2024 at 02:10:31PM +0100, Jann Horn wrote:
> On Thu, Dec 14, 2023 at 8:45 PM John Fastabend <john.fastabend@gmail.com> wrote:
> > commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.
> >
> > Backport of upstream fix for tls on 6.1 and lower 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 # 6.1.x-
> 
> I think this Cc marker was wrong - the commit message says "on 6.1 and
> lower kernels", but this marker seems to say "6.1 and *newer*
> kernels". The current status is that this issue is fixed on 6.6.7 and
> 6.1.69, but not on the 5.x stable kernels.

Then can someone provide a working backport to those kernels?  Right
now, this one does not apply at all there.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [missing stable fix on 5.x] [PATCH] net: tls, update curr on splice as well
  2024-01-08 14:07   ` Greg Kroah-Hartman
@ 2024-01-09  0:50     ` John Fastabend
  0 siblings, 0 replies; 4+ messages in thread
From: John Fastabend @ 2024-01-09  0:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jann Horn
  Cc: John Fastabend, stable, Jakub Kicinski, Daniel Borkmann,
	Boris Pismenny

Greg Kroah-Hartman wrote:
> On Mon, Jan 08, 2024 at 02:10:31PM +0100, Jann Horn wrote:
> > On Thu, Dec 14, 2023 at 8:45 PM John Fastabend <john.fastabend@gmail.com> wrote:
> > > commit c5a595000e2677e865a39f249c056bc05d6e55fd upstream.
> > >
> > > Backport of upstream fix for tls on 6.1 and lower 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 # 6.1.x-
> > 
> > I think this Cc marker was wrong - the commit message says "on 6.1 and
> > lower kernels", but this marker seems to say "6.1 and *newer*
> > kernels". The current status is that this issue is fixed on 6.6.7 and
> > 6.1.69, but not on the 5.x stable kernels.
> 
> Then can someone provide a working backport to those kernels?  Right
> now, this one does not apply at all there.

I'll put something together now and run it through some tests then
send it. I'm not sure where I got the notation 6.1.x- to mean <=6.1,
but I don't see it in the stable-kernel-rules.rst at the moment
so maybe I made it up. Sorry about that.

> 
> thanks,
> 
> greg k-h



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-09  0:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-14 19:45 [PATCH] net: tls, update curr on splice as well John Fastabend
2024-01-08 13:10 ` [missing stable fix on 5.x] " Jann Horn
2024-01-08 14:07   ` Greg Kroah-Hartman
2024-01-09  0:50     ` John Fastabend

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox