android_kernel_motorola_sm6225/net/tls
Rohit Maheshwari b2d31640d4 net/tls: sendfile fails with ktls offload
[ Upstream commit ea1dd3e9d080c961b9a451130b61c72dc9a5397b ]

At first when sendpage gets called, if there is more data, 'more' in
tls_push_data() gets set which later sets pending_open_record_frags, but
when there is no more data in file left, and last time tls_push_data()
gets called, pending_open_record_frags doesn't get reset. And later when
2 bytes of encrypted alert comes as sendmsg, it first checks for
pending_open_record_frags, and since this is set, it creates a record with
0 data bytes to encrypt, meaning record length is prepend_size + tag_size
only, which causes problem.
 We should set/reset pending_open_record_frags based on more bit.

Fixes: e8f6979981 ("net/tls: Add generic NIC offload infrastructure")
Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-29 09:54:56 +01: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 net/tls: sendfile fails with ktls offload 2020-10-29 09:54:56 +01:00
tls_device_fallback.c net/tls: fix socket wmem accounting on fallback with netem 2020-01-27 14:51:01 +01:00
tls_main.c net: tls, fix sk_write_space NULL write when tx disabled 2019-09-06 10:22:04 +02:00
tls_sw.c net/tls: Fixed return value when tls_complete_pending_work() fails 2019-09-06 10:22:03 +02:00