Re: [net] net/tls: fix corrupted data in recvmsg

2020-11-14 Thread Vadim Fedorenko
On 15.11.2020 03:54, Jakub Kicinski wrote: Please don't top post. On Sun, 15 Nov 2020 02:26:30 + Vadim Fedorenko wrote: No, I don't have any BPFs in test. If we have Application Data in TCP queue then tls_sw_advance_skb will change ctx->control from 0x16 to 0x17 (TLS_RECORD_TYPE_DATA) an

Re: [net] net/tls: fix corrupted data in recvmsg

2020-11-14 Thread Jakub Kicinski
Please don't top post. On Sun, 15 Nov 2020 02:26:30 + Vadim Fedorenko wrote: > No, I don't have any BPFs in test. > If we have Application Data in TCP queue then tls_sw_advance_skb > will change ctx->control from 0x16 to 0x17 (TLS_RECORD_TYPE_DATA) > and the loop will continue. Ah! Missed tha

Re: [net] net/tls: fix corrupted data in recvmsg

2020-11-14 Thread Vadim Fedorenko
No, I don't have any BPFs in test. If we have Application Data in TCP queue then tls_sw_advance_skb will change ctx->control from 0x16 to 0x17 (TLS_RECORD_TYPE_DATA) and the loop will continue. The patched if will make zc = true and data will be decrypted into msg->msg_iter. After that the loop wi

Re: [net] net/tls: fix corrupted data in recvmsg

2020-11-14 Thread Jakub Kicinski
On Sat, 14 Nov 2020 07:09:42 +0300 Vadim Fedorenko wrote: > 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 D

[net] net/tls: fix corrupted data in recvmsg

2020-11-13 Thread Vadim Fedorenko
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