]> git.baikalelectronics.ru Git - kernel.git/commit
tls: rx: device: bound the frag walk
authorJakub Kicinski <kuba@kernel.org>
Tue, 9 Aug 2022 17:55:43 +0000 (10:55 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 11 Aug 2022 05:53:25 +0000 (22:53 -0700)
commit0ba64651fcb0870308fd15f33c74d0d92c83b7cf
tree728a82e3d5263599475dc14d271080c95577d7f8
parent1fa7327303b0394766cc2e9d7cde0c94c128a844
tls: rx: device: bound the frag walk

We can't do skb_walk_frags() on the input skbs, because
the input skbs is really just a pointer to the tcp read
queue. We need to bound the "is decrypted" check by the
amount of data in the message.

Note that the walk in tls_device_reencrypt() is after a
CoW so the skb there is safe to walk. Actually in the
current implementation it can't have frags at all, but
whatever, maybe one day it will.

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-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_device.c