]> git.baikalelectronics.ru Git - kernel.git/commit
tls: rx: device: don't try to copy too much on detach
authorJakub Kicinski <kuba@kernel.org>
Tue, 9 Aug 2022 17:55:44 +0000 (10:55 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 11 Aug 2022 05:53:25 +0000 (22:53 -0700)
commitd02fc779533b86a96c9ac7f9d2f6b09f3ad09761
tree69bbc9081eb324017b05e80621123de8a7645751
parent0ba64651fcb0870308fd15f33c74d0d92c83b7cf
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@nvidia.com>
Fixes: 37c2526e223d ("tls: rx: do not use the standard strparser")
Tested-by: Ran Rozenstein <ranro@nvidia.com>
Link: https://lore.kernel.org/r/20220809175544.354343-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_strp.c