1
0
Fork 0
alistair23-linux/net/tls
Daniel Borkmann 06030dbaf3 tls: fix waitall behavior in tls_sw_recvmsg
Current behavior in tls_sw_recvmsg() is to wait for incoming tls
messages and copy up to exactly len bytes of data that the user
provided. This is problematic in the sense that i) if no packet
is currently queued in strparser we keep waiting until one has been
processed and pushed into tls receive layer for tls_wait_data() to
wake up and push the decrypted bits to user space. Given after
tls decryption, we're back at streaming data, use sock_rcvlowat()
hint from tcp socket instead. Retain current behavior with MSG_WAITALL
flag and otherwise use the hint target for breaking the loop and
returning to application. This is done if currently no ctx->recv_pkt
is ready, otherwise continue to process it from our strparser
backlog.

Fixes: c46234ebb4 ("tls: RX path for ktls")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-15 09:14:30 -07:00
..
Kconfig net/tls: Add generic NIC offload infrastructure 2018-05-01 09:42:47 -04:00
Makefile net/tls: Add generic NIC offload infrastructure 2018-05-01 09:42:47 -04:00
tls_device.c tls: Fix tls_device initialization 2018-05-10 17:54:20 -04:00
tls_device_fallback.c net/tls: Add generic NIC offload infrastructure 2018-05-01 09:42:47 -04:00
tls_main.c tls: fix NULL pointer dereference on poll 2018-06-11 16:29:54 -07:00
tls_sw.c tls: fix waitall behavior in tls_sw_recvmsg 2018-06-15 09:14:30 -07:00