From: Jiasheng Jiang Date: Fri, 24 Sep 2021 03:18:37 +0000 (+0000) Subject: rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies() X-Git-Tag: v5.10.88~989 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78fb8c99924291d8f1d1366e467b609c30b7f7f6;p=platform%2Fkernel%2Flinux-rpi.git rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies() [ 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/rxrpc/rtt.c b/net/rxrpc/rtt.c index 4e565ee..be61d6f 100644 --- a/net/rxrpc/rtt.c +++ b/net/rxrpc/rtt.c @@ -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)