Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3836208ybb; Mon, 6 Apr 2020 17:09:47 -0700 (PDT) X-Google-Smtp-Source: APiQypKeKE0bCU+rv6YtS4bhlLaGtrD9C+8ptyuWpAILg2Lu22xYewGYZ/3xZ9MSY15F9WklqPA+ X-Received: by 2002:a4a:a747:: with SMTP id h7mr1482228oom.2.1586218187470; Mon, 06 Apr 2020 17:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586218187; cv=none; d=google.com; s=arc-20160816; b=iRNNe9jlLc06HB1QzFrjNO743OsBhl/xwDFpvm2lgN59yw+BWCEwe+xm4yzZQ3CKaf DR81MLrqHSNkxUJrlxkJZUd2cuqYrlLEldJfZ+ZSZdwAE8JB1sGzIGvvukWJZisRZw5Q a+FIbgIzifD3J7sRs+eL7K8K0R+1Y+/6T12CJhe1dWoeXWIw0oH8pHUe9eIFea9QJwwV MTTvQxeopmIMe2ob/MSTpe2W7byZZEUZF0yeBSkuRzdz2D+p1spWYwvXntZgaFwi7hmT VHOvXz5nU6nxZJ5dk0zsFfgvtkv++zu82Ai9ftnqfiYU45yGvr94/YUKVtFH8rnipsB1 CLdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V3/aNAlsqWufkoeBTEo1se/ZHDMcObegNSL0SiAtSbg=; b=UUxRyv/XVJ5mvxc/ibmprSapYUiMqVT1usOw+JGsCBEYPVc8MW0FYvDRP+IbqEBbN/ 1yCbuOYoiDYtx0dczi2sdDEvV66B+mb+nRmq6E94GOM0/4Qk0w2qmsvAIw3B26BlWxo2 ZyoZxwkQ96r60RdxN1KbeDvmBGP0gugVY/wHE5WdFX4lwJv2+cxzFGb+YjYouy2wD36R i6n43Q1d4vFs/DPfJG7rDcGeOYuS1jt0Tl8bTUyoCyfD2f5MhMRIVDjsgl3mz2xy9vJ+ IaOexyBwfpMAXPdPS7idOFOMtt3R4SCArw9zRW4FONr4SU2Ncmrg/kot02zWo+hdVYCo 0WTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Yzy6Q74d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16si503485otc.180.2020.04.06.17.09.35; Mon, 06 Apr 2020 17:09:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Yzy6Q74d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727547AbgDGAJG (ORCPT + 99 others); Mon, 6 Apr 2020 20:09:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:34110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbgDGABS (ORCPT ); Mon, 6 Apr 2020 20:01:18 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 66F342078C; Tue, 7 Apr 2020 00:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586217678; bh=fJFGi6T4K+Duqo6Kk0lU0Jzj/CXZAnUEMHj1mfeAFuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yzy6Q74d3MUg6Xc46N/Wk7ucskXKDzwthp+ZZ8Tmua1KFffM6N5sP0GmmCMtWFyoI ETtOUEeeZ4KvvGq44Dn0i5em2HfwnWiJrLVUfGXH64wiPoH3XvRF5jl2R1l3hj4ldz Wz8Uu3D91+YcsyoRF9lVNN21urIeB78aBnkGvtXA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Howells , Sasha Levin , linux-afs@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.5 15/35] rxrpc: Fix sendmsg(MSG_WAITALL) handling Date: Mon, 6 Apr 2020 20:00:37 -0400 Message-Id: <20200407000058.16423-15-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200407000058.16423-1-sashal@kernel.org> References: <20200407000058.16423-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells [ Upstream commit 498b577660f08cef5d9e78e0ed6dcd4c0939e98c ] Fix the handling of sendmsg() with MSG_WAITALL for userspace to round the timeout for when a signal occurs up to at least two jiffies as a 1 jiffy timeout may end up being effectively 0 if jiffies wraps at the wrong time. Fixes: bc5e3a546d55 ("rxrpc: Use MSG_WAITALL to tell sendmsg() to temporarily ignore signals") Signed-off-by: David Howells Signed-off-by: Sasha Levin --- net/rxrpc/sendmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c index 1eccfb92c9e15..0fcf157aa09f8 100644 --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -71,8 +71,8 @@ static int rxrpc_wait_for_tx_window_waitall(struct rxrpc_sock *rx, rtt = READ_ONCE(call->peer->rtt); rtt2 = nsecs_to_jiffies64(rtt) * 2; - if (rtt2 < 1) - rtt2 = 1; + if (rtt2 < 2) + rtt2 = 2; timeout = rtt2; tx_start = READ_ONCE(call->tx_hard_ack); -- 2.20.1