Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4232534ybb; Tue, 7 Apr 2020 03:29:26 -0700 (PDT) X-Google-Smtp-Source: APiQypJwAZ0fLG4FlM3IEz7P5W1e3wbdYssRUUMJ/1leDhKJg17Y6lZCfvVRvPsULY8ekgIug6ef X-Received: by 2002:a05:6830:146:: with SMTP id j6mr927962otp.117.1586255366516; Tue, 07 Apr 2020 03:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586255366; cv=none; d=google.com; s=arc-20160816; b=yVbQ7GUGEzLYEb4a8ZxkbdfbMTh0fbp6vtoD1YWQLwV7JBgsM+vrXpdgSAiuVBKGeQ eCvhdOHoTOae7Q8Lr9LjwFNsgIQcrs28h8CvS9AJpf5e8cwvJwOOWBKNQ8uBMS7NGKe4 P7pRpUVf873fT5AXJ8gsW1wNU4sMBcSZcjDV3/kF8eDdYgVKvzd6B7EcY1ArCgvrHYrf EaqePGFgNI1kUPUbjh3NKqHYNjQWnQmmWFGlKtEIP9P5nA3t9hLSECbW2bTCT+H7cAyJ v5PibQmCjHxuOmxtIKAhimq3uudNxQwIRD/HMj1+/eR3pk4pBZF/m/YtJKYaq9hoYOsf 8kmA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ciFliOa4yATREHDUxg8n4CFtRW8Da7lqBmA+XOSh99o=; b=twkktuCNslZy5yGeeHTxgfvea0zlIElmE1czPgeFvhbSufakBKm2QYL8+YogrV1Bnc 84c2S5IpLD+QCT/YUtjocEp5tzbqO66wJZFs/r87yO5KdnCDNHLjKipCuDl17RgMON5G vcSexEnNfynI8qcVdfxttO/kzKNJT7eVqOqDwbDop2LGvsuToEP7iccHCo8tSwbosiAC h+bIhMrGrVQxhimtL+xbI6X6bXcV7tWLlq4vPLXDvhB8NIvTe9Fi+PTOU10eAPYPYJzP uDCGAnQ89pPsEI1m7evksxIi9IvCUIJs9lp1gvwh66/mzPpo+aueiaSozRWf10lcmOFL OjYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="XzMI/GEL"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si971742otp.241.2020.04.07.03.29.14; Tue, 07 Apr 2020 03:29:26 -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="XzMI/GEL"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728483AbgDGK2b (ORCPT + 99 others); Tue, 7 Apr 2020 06:28:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:35882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbgDGKZU (ORCPT ); Tue, 7 Apr 2020 06:25:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 733F82074F; Tue, 7 Apr 2020 10:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586255119; bh=o5+VVv/NdrgfdXFjKKdDinBsvD48G4NvcvDVyOKNL5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XzMI/GELhSra/yZ7N9G2I3Mh0DC8bBKtu4oTvQ1RDjs5+XtnRMfd71rEkQzKVvJyU uWmSJVbs26AgPYW84ZGgMKhIEQeH2Rf01bcN/mdtwEtLvECd2j2RbL15I8/zqRNnXx vzGXpxqUoWVSufYvg75GgVLaHq7UxIxBuvT65910= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells Subject: [PATCH 5.5 38/46] rxrpc: Fix sendmsg(MSG_WAITALL) handling Date: Tue, 7 Apr 2020 12:22:09 +0200 Message-Id: <20200407101503.512089696@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200407101459.502593074@linuxfoundation.org> References: <20200407101459.502593074@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 commit 498b577660f08cef5d9e78e0ed6dcd4c0939e98c upstream. 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: Greg Kroah-Hartman --- net/rxrpc/sendmsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/rxrpc/sendmsg.c +++ b/net/rxrpc/sendmsg.c @@ -58,8 +58,8 @@ static int rxrpc_wait_for_tx_window_wait 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);