diff options
| author | David Howells <dhowells@redhat.com> | 2020-03-13 17:30:27 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-08 09:08:45 +0200 |
| commit | c4168080f1d4c6147b30c69c3d40d83464cc0f55 (patch) | |
| tree | 6467cb35c5997f02941b13f525b315ff34d89b4d | |
| parent | be8a3aecd21ae4769766ca6f1a88a1fbfbe2d148 (diff) | |
| download | linux-c4168080f1d4c6147b30c69c3d40d83464cc0f55.tar.gz linux-c4168080f1d4c6147b30c69c3d40d83464cc0f55.tar.bz2 linux-c4168080f1d4c6147b30c69c3d40d83464cc0f55.zip | |
rxrpc: Fix sendmsg(MSG_WAITALL) handling
commit 498b577660f08cef5d9e78e0ed6dcd4c0939e98c upstream.
Fix the handling of sendmsg() with MSG_WAITALL for userspace to round the
timeout for when a signal occurs up to at least two jiffies as a 1 jiffy
timeout may end up being effectively 0 if jiffies wraps at the wrong time.
Fixes: bc5e3a546d55 ("rxrpc: Use MSG_WAITALL to tell sendmsg() to temporarily ignore signals")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | net/rxrpc/sendmsg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 813fd6888142..136eb465bfcb 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -58,8 +58,8 @@ static int rxrpc_wait_for_tx_window_nonintr(struct rxrpc_sock *rx, rtt = READ_ONCE(call->peer->rtt); rtt2 = nsecs_to_jiffies64(rtt) * 2; - if (rtt2 < 1) - rtt2 = 1; + if (rtt2 < 2) + rtt2 = 2; timeout = rtt2; tx_start = READ_ONCE(call->tx_hard_ack); |
