Skip to content

Commit b3a03b5

Browse files
kuba-moodavem330
authored andcommitted
tls: rx: device: fix checking decryption status
skb->len covers the entire skb, including the frag_list. In fact we're guaranteed that rxm->full_len <= skb->len, so since the change under Fixes we were not checking decrypt status of any skb but the first. Note that the skb_pagelen() added here may feel a bit costly, but it's removed by subsequent fixes, anyway. Reported-by: Tariq Toukan <[email protected]> Fixes: 86b259f ("tls: rx: device: bound the frag walk") Tested-by: Shai Amiram <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7e01c7f commit b3a03b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tls/tls_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx)
10121012
struct sk_buff *skb_iter;
10131013
int left;
10141014

1015-
left = rxm->full_len - skb->len;
1015+
left = rxm->full_len + rxm->offset - skb_pagelen(skb);
10161016
/* Check if all the data is decrypted already */
10171017
skb_iter = skb_shinfo(skb)->frag_list;
10181018
while (skb_iter && left > 0) {

0 commit comments

Comments
 (0)