]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies()
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Fri, 24 Sep 2021 03:18:37 +0000 (03:18 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 13 Jan 2022 17:42:17 +0000 (18:42 +0100)
BugLink: https://bugs.launchpad.net/bugs/1953387
[ Upstream commit acde891c243c1ed85b19d4d5042bdf00914f5739 ]

Directly using _usecs_to_jiffies() might be unsafe, so it's
better to use usecs_to_jiffies() instead.
Because we can see that the result of _usecs_to_jiffies()
could be larger than MAX_JIFFY_OFFSET values without the
check of the input.

Fixes: c410bf01933e ("Fix the excessive initial retransmission timeout")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/rxrpc/rtt.c

index 928d8b34a3eeee8685edc2f617a47036b9fac0ba..f3f87c9f0209ddce7b9245b934c52c26ba768db2 100644 (file)
@@ -23,7 +23,7 @@ static u32 rxrpc_rto_min_us(struct rxrpc_peer *peer)
 
 static u32 __rxrpc_set_rto(const struct rxrpc_peer *peer)
 {
-       return _usecs_to_jiffies((peer->srtt_us >> 3) + peer->rttvar_us);
+       return usecs_to_jiffies((peer->srtt_us >> 3) + peer->rttvar_us);
 }
 
 static u32 rxrpc_bound_rto(u32 rto)