]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: sendfile fails with ktls offload
authorRohit Maheshwari <rohitm@chelsio.com>
Wed, 7 Oct 2020 18:40:21 +0000 (00:10 +0530)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Oct 2020 23:42:02 +0000 (16:42 -0700)
commit837ea1b185cb5d7f8aba3da4c273a99cbe007e42
treea3db866389275cebeeed6388010f0ec6b91b6b7f
parent1741a1ab237f719b90171975e636f931a3029093
net/tls: sendfile fails with ktls offload

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: e31ec02c9978 ("net/tls: Add generic NIC offload infrastructure")
Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_device.c