Skip to content

Commit

Permalink
rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies()
Browse files Browse the repository at this point in the history
[ Upstream commit acde891 ]

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: c410bf0 ("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>
  • Loading branch information
JiangJias authored and gregkh committed Nov 18, 2021
1 parent 9fcd75e commit eade470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rxrpc/rtt.c
Expand Up @@ -22,7 +22,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)
Expand Down

0 comments on commit eade470

Please sign in to comment.