diff options
author | r.hering@avm.de <r.hering@avm.de> | 2018-01-12 15:42:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-15 14:21:57 -0500 |
commit | 30be8f8dba1bd2aff73e8447d59228471233a3d4 (patch) | |
tree | 752832ec446e7514fc64428f06a65fe2a2c28012 /include/net | |
parent | 95ef498d977bf44ac094778fd448b98af158a3e6 (diff) | |
download | linux-30be8f8dba1bd2aff73e8447d59228471233a3d4.tar.bz2 |
net/tls: Fix inverted error codes to avoid endless loop
sendfile() calls can hang endless with using Kernel TLS if a socket error occurs.
Socket error codes must be inverted by Kernel TLS before returning because
they are stored with positive sign. If returned non-inverted they are
interpreted as number of bytes sent, causing endless looping of the
splice mechanic behind sendfile().
Signed-off-by: Robert Hering <r.hering@avm.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/tls.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index 936cfc5cab7d..9185e53a743c 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -170,7 +170,7 @@ static inline bool tls_is_pending_open_record(struct tls_context *tls_ctx) static inline void tls_err_abort(struct sock *sk) { - sk->sk_err = -EBADMSG; + sk->sk_err = EBADMSG; sk->sk_error_report(sk); } |