Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4019612pxb; Wed, 13 Oct 2021 18:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgU1RYa15om/FN0gTrVbUb1B9RB9H8u3oUii1uLnk8dL/u52HLHvAz/6U86FrZB53kLejj X-Received: by 2002:a17:90b:4c4a:: with SMTP id np10mr3167351pjb.233.1634175587529; Wed, 13 Oct 2021 18:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634175587; cv=none; d=google.com; s=arc-20160816; b=rWafssSvif8zHXBAkc7K3M2xFMikc9fNtmBpAyuqgpAYxwBtO+A6+b9txnTiz7S8Bi mUc1knVqFdxzcCzl466YiE6iNjYA4ZVDVDr8B4hkaiMv60C5sHXnr9CHSA88M7rY3D6A QQHaHg1gVFirV/4MZn3BLuzC2ED+1IZfyFaVPKWBF1zwuT1/nygm3VnqUXc+2PoL/4Gm VOcGYB5PQkavYsGscJv2uYaivrM49BUAidbdDWRpx9Vj6h0LU0tKiHQKlaVSPQ0ZzCac 84uGuztj6zh9mC+pH7DGbzEh6gUll0wgFzxkcgDpuOhJeXb6VvuRvTuBZb0iQkAaGSyK 4nJQ== 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=cXDsJZwcPGnM8VGHG0IpAoxbP0pyyAvT5tuCowyt5N1XybO4QqY+xH/JgJCJPZn7aX c30iTxOJh5WV8u6L91bWI9yR0fNOn4kCbSti76K45zFTyYaH/EfFyhQCFdZWbvT2M1Ms qSxZTUzTOTIPniFAnYSUF7oY2xO9cjSrKOYfjLguNTZ6FUBOhVOVssxwYt54xZ8tw/0d BS8Z1M9YkRCK9YXNWeIBvS7mqn4pVpvLAyOxFSkxUYwNae79tZ0tpEFToRqYuHz6Mcme vdoMarE1uXWqpyvkZqVnUUDawC52deGILveuJJXnCwsdXG+1h6cZbZa0RZVt5KrhOsoZ NbXg== 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 h3si2435571pfv.28.2021.10.13.18.39.33; Wed, 13 Oct 2021 18:39:47 -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 S229814AbhJNBic (ORCPT + 99 others); Wed, 13 Oct 2021 21:38:32 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:52224 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229496AbhJNBic (ORCPT ); Wed, 13 Oct 2021 21:38:32 -0400 Received: from localhost.localdomain (unknown [124.16.138.128]) by APP-03 (Coremail) with SMTP id rQCowAAnLqqBiWdhYA+BAw--.50977S2; Thu, 14 Oct 2021 09:36:01 +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 RESEND] rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies() Date: Thu, 14 Oct 2021 01:35:59 +0000 Message-Id: <1634175359-1810410-1-git-send-email-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: rQCowAAnLqqBiWdhYA+BAw--.50977S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtr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k 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