diff options
author | Dave Watson <davejwatson@fb.com> | 2018-05-01 23:05:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-02 01:57:52 +0300 |
commit | c212d2c7fc4736d49be102fb7a1a545cdc2f1fea (patch) | |
tree | f4ebbd4af00a32f8f96ea2d92498c533d33da615 /include/net/tls.h | |
parent | edd7ceb78296fb1574958991b6655c3c2cedf124 (diff) | |
download | linux-c212d2c7fc4736d49be102fb7a1a545cdc2f1fea.tar.xz |
net/tls: Don't recursively call push_record during tls_write_space callbacks
It is reported that in some cases, write_space may be called in
do_tcp_sendpages, such that we recursively invoke do_tcp_sendpages again:
[ 660.468802] ? do_tcp_sendpages+0x8d/0x580
[ 660.468826] ? tls_push_sg+0x74/0x130 [tls]
[ 660.468852] ? tls_push_record+0x24a/0x390 [tls]
[ 660.468880] ? tls_write_space+0x6a/0x80 [tls]
...
tls_push_sg already does a loop over all sending sg's, so ignore
any tls_write_space notifications until we are done sending.
We then have to call the previous write_space to wake up
poll() waiters after we are done with the send loop.
Reported-by: Andre Tomt <andre@tomt.net>
Signed-off-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tls.h')
-rw-r--r-- | include/net/tls.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index 3da8e13a6d96..b400d0bb7448 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -148,6 +148,7 @@ struct tls_context { struct scatterlist *partially_sent_record; u16 partially_sent_offset; unsigned long flags; + bool in_tcp_sendpages; u16 pending_open_record_frags; int (*push_pending_record)(struct sock *sk, int flags); |