Skip to content

Commit 498c582

Browse files
author
Sabrina Dubroca
committed
tls: rx: device: don't try to copy too much on detach
Tested: selftests Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2143700 commit d800a7b Author: Jakub Kicinski <[email protected]> Date: Tue Aug 9 10:55:44 2022 -0700 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 <[email protected]> Fixes: 84c61fe ("tls: rx: do not use the standard strparser") Tested-by: Ran Rozenstein <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sabrina Dubroca <[email protected]>
1 parent dc454a0 commit 498c582

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tls/tls_strp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static struct sk_buff *tls_strp_msg_make_copy(struct tls_strparser *strp)
4141
struct sk_buff *skb;
4242
int i, err, offset;
4343

44-
skb = alloc_skb_with_frags(0, strp->anchor->len, TLS_PAGE_ORDER,
44+
skb = alloc_skb_with_frags(0, strp->stm.full_len, TLS_PAGE_ORDER,
4545
&err, strp->sk->sk_allocation);
4646
if (!skb)
4747
return NULL;

0 commit comments

Comments
 (0)