]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: don't leak partially sent record in device mode
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 10 Apr 2019 18:04:31 +0000 (11:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Apr 2019 20:07:02 +0000 (13:07 -0700)
commit7a905c692e14efb25ec264363a01deb4d30aa74d
tree1161595f0333fca7a5f419b3200b15eee8a21ce3
parentae86042c88a29ab40a2d9dee88c40aaa2eec7956
net/tls: don't leak partially sent record in device mode

David reports that tls triggers warnings related to
sk->sk_forward_alloc not being zero at destruction time:

WARNING: CPU: 5 PID: 6831 at net/core/stream.c:206 sk_stream_kill_queues+0x103/0x110
WARNING: CPU: 5 PID: 6831 at net/ipv4/af_inet.c:160 inet_sock_destruct+0x15b/0x170

When sender fills up the write buffer and dies from
SIGPIPE.  This is due to the device implementation
not cleaning up the partially_sent_record.

This is because commit 4e09428b5ad7 ("net/tls: Add support for async encryption of records for performance")
moved the partial record cleanup to the SW-only path.

Fixes: 4e09428b5ad7 ("net/tls: Add support for async encryption of records for performance")
Reported-by: David Beckett <david.beckett@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tls.h
net/tls/tls_device.c
net/tls/tls_main.c
net/tls/tls_sw.c