]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
rxrpc: Fix resend event time calculation
authorMarc Dionne <marc.dionne@auristor.com>
Fri, 30 Mar 2018 20:04:44 +0000 (21:04 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commita4b02dc8722eb6f9222cd9bdf0b40a99cc4a7fc0
treecec400a3b559d0a75a0f4c2b05f8f844507e52c0
parent4e54e74d94e09ea7cea7953cebd4f5561f7bfe23
rxrpc: Fix resend event time calculation

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 59299aa1028fce051adbd25aaff7c387b865cd6d ]

Commit a158bdd3 ("rxrpc: Fix call timeouts") reworked the time calculation
for the next resend event.  For this calculation, "oldest" will be before
"now", so ktime_sub(oldest, now) will yield a negative value.  When passed
to nsecs_to_jiffies which expects an unsigned value, the end result will be
a very large value, and a resend event scheduled far into the future.  This
could cause calls to stall if some packets were lost.

Fix by ordering the arguments to ktime_sub correctly.

Fixes: a158bdd3247b ("rxrpc: Fix call timeouts")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/rxrpc/call_event.c