Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3547471pxb; Sun, 26 Sep 2021 19:05:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ5VGocVtg9eDg26D3C7GyDocWeJfaX7ViK4T3+wpTZThbz/kl70JmwJpQZMn6+4QDyIkx X-Received: by 2002:a17:90b:14d6:: with SMTP id jz22mr8902379pjb.61.1632708353488; Sun, 26 Sep 2021 19:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632708353; cv=none; d=google.com; s=arc-20160816; b=C9dD4FB1Essfb7pTdB4LmzrvzimgbSScciilFliUuOquupy/CZOdui7VDrr/zTKERp QR0vtbEHyCB2ZHQkRr40LKLb4dHHoBXhKcA/a75BZ1wlJYKDEBLgCS8sZJoPTgDvQ/Vi BMMl1mG8wpC52QiigvPFNG0nKZBdJphrVtZry4Z7JCPunG6AWYAKBJSzG4a1Td1DNSXR e0Y9ck+M2EkYTbe5FAjKjmMsrJel/G1kdrR40yGv+mm00Cp/JWh5eR1A7arlMZdJvsOn i0mKo1PHeg++InO+0TJ7FqldzLw/1I6lhn6/HDKST2cG56FDKzeK0ke5sfWFkprKUXG+ bLEw== 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=gtqSdv6DRphnOA9eq+Zppx9mIEC57sRijcOwSxTUn90=; b=HqYjBFAfGdIps6OmxgD3VNbHBUmXgHqxAqhWfS9LUwa1Hw3OPQ5ZQY+jpD4QMWDK4t hdW5BzsqbfABbLLhdT0rc1f5Hd/BWpDjVGfcEUDmR+Uc3j5Efd8UUscjLGeC/Mkiqbjo CsiOCIasZcTFB6do0f6okc+Y//WU+s+7CnyPGhpUJ3gKPmHEAgDJcoTo2fFw5c7ONEhY xJ/TEdJyKq2H6YXjks/IiuiIy/+6IndEYUO2Xpy8/9VA1NXY8n8YOo/5BFig2h9Oqjob +DWckUdA5SO0oikg5pTEe8B5uCg+Fnm0kpYQaPevl/dD/zy3Q4F9vw1D5T1Rl6Xy2/JQ Eyxw== 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 i4si20874053pgs.164.2021.09.26.19.05.41; Sun, 26 Sep 2021 19:05:53 -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 S232440AbhI0CDx (ORCPT + 99 others); Sun, 26 Sep 2021 22:03:53 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:44610 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232420AbhI0CDw (ORCPT ); Sun, 26 Sep 2021 22:03:52 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-01 (Coremail) with SMTP id qwCowAAXHAj4JVFhgmVmAQ--.12728S2; Mon, 27 Sep 2021 10:01:28 +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: Re:[PATCH 3/3] rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies() Date: Mon, 27 Sep 2021 02:01:26 +0000 Message-Id: <1632708086-782867-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: qwCowAAXHAj4JVFhgmVmAQ--.12728S2 X-Coremail-Ant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CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ Precedence: bulk List-ID: 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: c410bf01 ("rxrpc: 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