]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: don't pay attention to sk_write_pending when pushing partial records
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 5 Nov 2019 22:24:34 +0000 (14:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Nov 2019 01:33:32 +0000 (17:33 -0800)
commit0c601ddc02bffde6b48c9b3034a2b830a43824dc
tree7cad23cdb54a207b0864e45218995ce047112e3c
parent3bda41a6d194d79a997fdd4361f296f7d1eea8e0
net/tls: don't pay attention to sk_write_pending when pushing partial records

sk_write_pending being not zero does not guarantee that partial
record will be pushed. If the thread waiting for memory times out
the pending record may get stuck.

In case of tls_device there is no path where parial record is
set and writer present in the first place. Partial record is
set only in tls_push_sg() and tls_push_sg() will return an
error immediately. All tls_device callers of tls_push_sg()
will return (and not wait for memory) if it failed.

Fixes: b574142da9d5 ("net/tls: Add support for async encryption of records for performance")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_device.c
net/tls/tls_sw.c