Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1154633pxb; Thu, 23 Sep 2021 20:21:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdyHja++Vhbm9BnRJpfWgac89bL3O7s17xfIil8Lm3gRnjxANgQDCA9Grjz0GUnJdQfw62 X-Received: by 2002:aa7:c80d:: with SMTP id a13mr2493732edt.71.1632453677612; Thu, 23 Sep 2021 20:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632453677; cv=none; d=google.com; s=arc-20160816; b=Ki8vTntIhXY5ADGuSB5kclgsLlPeljFbisDQm19LRJet27c5twOtJlCErCIjiHtlt/ 2vgkdM/dXnYmRc4rgH4Yaxyz+uLPJtU/ILUIpaMnqIzSN+cxUUcFs5p8R+pzYKDxciRL gkyTQle25fxT/bmVYZyULsRDeC463/TyT3nJWdVIUIAk2UHAXVHxzxX8oiRDRbEXbpI+ RttyyTyS0UMQEhWicIhAcge2MVJH33kKtJnDYqTD+sZXRqrvQq8FHHuZbE4vnDZLsa8h 08dUXNoylcyJaYEiabny1Lr4E9FWqCA7QwEnwnNMt9LXua3UltRII5m+cH3oJCW9k0J+ I4uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=QOwIl7AHksewtPb879DKRqSv6j3s+NvzMjwmQJIit8k=; b=mliSf7fpSN/y6qWA9ds0c7MsIIldWm1oAUGvkMJVWKDVPAL/45pcxuX2IF+ZfvPKxG 72IspUtQDDNSHrYhIxaW/h4yykm1eneuQbC9w3qo+CANlVLQQrcKUDoaE5VuS1yKEDG/ hr2BNQSslr9Dpsc0yw7Y09Mh1c4hyoesmMOnKwadNHcawFTjJSottGnYk1s8DWDtOhHr eGFT+1gNKPl/CAskyNZUr1r/JZI6AFz3nfIX/wRkTzHEdGKxUSOzNYO8xzVNP8HBbjg8 O/+el7X0R1tUMlbCp6WiHH4VndsFJbcMhYR99r/X4P0x3SPCNGBYjm7Jvyv4BCNeN206 iVFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si8553143ejg.73.2021.09.23.20.20.53; Thu, 23 Sep 2021 20:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244009AbhIXDUl (ORCPT + 99 others); Thu, 23 Sep 2021 23:20:41 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:37644 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231680AbhIXDUl (ORCPT ); Thu, 23 Sep 2021 23:20:41 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-01 (Coremail) with SMTP id qwCowACnrQmRQ01hNyXQAA--.62110S2; Fri, 24 Sep 2021 11:18:41 +0800 (CST) From: Jiasheng Jiang To: dhowells@redhat.com, marc.dionne@auristor.com, davem@davemloft.net, kuba@kernel.org Cc: linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH 3/3] rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies() Date: Fri, 24 Sep 2021 03:18:37 +0000 Message-Id: <1632453517-782538-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: qwCowACnrQmRQ01hNyXQAA--.62110S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtr1xtr43Gr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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- net/rxrpc/rtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.7.4