Commit b3a03b54 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller
Browse files

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: default avatarTariq Toukan <tariqt@nvidia.com>
Fixes: 86b259f6 ("tls: rx: device: bound the frag walk")
Tested-by: default avatarShai Amiram <samiram@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7e01c7f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1012,7 +1012,7 @@ int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx)
	struct sk_buff *skb_iter;
	int left;

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