[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220804085950.414bfa41@kernel.org>
Date: Thu, 4 Aug 2022 08:59:50 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tariq Toukan <ttoukan.linux@...il.com>
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
borisp@...dia.com, john.fastabend@...il.com, maximmi@...dia.com,
tariqt@...dia.com, vfedorenko@...ek.ru,
Ran Rozenstein <ranro@...dia.com>,
"gal@...dia.com" <gal@...dia.com>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net-next v3 7/7] tls: rx: do not use the standard
strparser
On Thu, 4 Aug 2022 11:05:18 +0300 Tariq Toukan wrote:
> > trace_tls_device_decrypted(sk, tcp_sk(sk)->copied_seq - rxm->full_len,
>
> Now we see a different trace:
>
> ------------[ cut here ]------------
> WARNING: CPU: 4 PID: 45887 at net/tls/tls_strp.c:53
OK, if you find another I promise I'll try to hassle a machine with
offload from somewhere... here's the fix for the new one:
--->8----------------
tls: rx: device: don't try to copy too much on detach
Another device offload bug, we use the length of the output
skb as an indication of how much data to copy. But that skb
is sized to offset + record length, and we start from offset.
So we end up double-counting the offset which leads to
skb_copy_bits() returning -EFAULT.
Reported-by: Tariq Toukan <tariqt@...dia.com>
Fixes: 84c61fe1a75b ("tls: rx: do not use the standard strparser")
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
net/tls/tls_strp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c
index f0b7c9122fba..9b79e334dbd9 100644
--- a/net/tls/tls_strp.c
+++ b/net/tls/tls_strp.c
@@ -41,7 +41,7 @@ static struct sk_buff *tls_strp_msg_make_copy(struct tls_strparser *strp)
struct sk_buff *skb;
int i, err, offset;
- skb = alloc_skb_with_frags(0, strp->anchor->len, TLS_PAGE_ORDER,
+ skb = alloc_skb_with_frags(0, strp->stm.full_len, TLS_PAGE_ORDER,
&err, strp->sk->sk_allocation);
if (!skb)
return NULL;
--
2.37.1
Powered by blists - more mailing lists