]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: fix corrupted data in recvmsg
authorVadim Fedorenko <vfedorenko@novek.ru>
Sun, 15 Nov 2020 04:16:00 +0000 (07:16 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 17 Nov 2020 01:11:02 +0000 (17:11 -0800)
commit18446b495183118061a0b078b42c5ce3de543d41
tree3bf4493610baaf5474748c8d38e9305d9c0ed256
parentb2dd6065bcba6f080dec80d9c0c989e760118cb1
net/tls: fix corrupted data in recvmsg

If tcp socket has more data than Encrypted Handshake Message then
tls_sw_recvmsg will try to decrypt next record instead of returning
full control message to userspace as mentioned in comment. The next
message - usually Application Data - gets corrupted because it uses
zero copy for decryption that's why the data is not stored in skb
for next iteration. Revert check to not decrypt next record if
current is not Application Data.

Fixes: b359aa1a348b ("tls: Fix recvmsg() to be able to peek across multiple records")
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Link: https://lore.kernel.org/r/1605413760-21153-1-git-send-email-vfedorenko@novek.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_sw.c