Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1516854ybb; Sat, 11 Apr 2020 05:27:00 -0700 (PDT) X-Google-Smtp-Source: APiQypJT0Dnl4fjiVUuoHtdQ75Y0jdzaAEPS9z1RQiBZSc/+7GkIbWWdW09A11oTVFZRg+MyUFy3 X-Received: by 2002:a37:9e08:: with SMTP id h8mr1130273qke.369.1586608020319; Sat, 11 Apr 2020 05:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586608020; cv=none; d=google.com; s=arc-20160816; b=k/iJLrPoIX/jxm8pQ6NMQC5W10l8eOIkUpwstiVIITacPEnF2IgIUwR0sez+6D8KBL oTqki6fD/tEBSEyCjGCUo/uFpjsFX/uutTJTDlWUMhUOYI3KfP0zZNLTYCmN6iPvnDT3 CJfhtXzRqLoETQeOfAK/rMmpqf2alvJqIFswXM9y4FlaGGSYBj02lJxzRHhMaY4RRIC6 LxjJAtNv6+TpEYnlDxSZO/fsImlrWaYhfCWDUwBPYFsDPkXyXvmH06ysWeCoS+RJd36M /vaW3oNpoLiuSauXIyhLiALBzaib+H362cSfuzlkh6OFK6Ly18Xm8ZVF+gVN0TiYtquE DC5g== 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=5/Bzn2U+dsJGP2U4jXEhohLleCZ7E/XwUOqqPrmLbck=; b=AYgnIdwHX76wk8RyJqr2TJuRq2PWVeibVGggK2ZCjIx5/0VY9H+Zoai372Ke0rhWFo exP5EsietIab4ffWNUgoZwe+eq5CU0DBN/jA/VsprKCE7a1eTZ6/+PD0uOLNQ81CW/T0 ayBLUGJdX8+LulG7xh4JCmGP5WS0iOtf7MiPbd5VVWlJkbjl2WspyJ2N7VISYsziBJaj fbl6ykID7co6dGsMdWldCl/OteWOTWO+7m/3BvYL4mfgLaiJ24IdAfVVX+mH1eSF7SFh whwsrUZWB0gDC8zJoDI4oa2oSra7Hh3n+lFjRXNBRmoph29cen0tsElh3yfF6Bl8XTxH YmJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="j/CJL9xZ"; 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 g15si2701685qka.307.2020.04.11.05.26.46; Sat, 11 Apr 2020 05:27:00 -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="j/CJL9xZ"; 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 S1728601AbgDKMZ2 (ORCPT + 99 others); Sat, 11 Apr 2020 08:25:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:50974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727788AbgDKMQj (ORCPT ); Sat, 11 Apr 2020 08:16:39 -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 7085420692; Sat, 11 Apr 2020 12:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586607399; bh=WLjTGfAMIh/dxbygmZhyz+9HAKYXuj2WS8AFJSWjkck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/CJL9xZErB6US2fSGzXl3U67ugv05eOfR7tEQdCtWN8Jfc9hqI0pGcMptWrveV1v IdKp5S/EBiiMt4YUTGN2yVhgoXybluv+MoUX+mBX7Z5QZkh9+NsZrVYvNxvRCwkkLs AQufKc4ERsCgdQ7dWVqPhUVZnfLIHbE9hZyJDfTw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells Subject: [PATCH 4.19 22/54] rxrpc: Fix sendmsg(MSG_WAITALL) handling Date: Sat, 11 Apr 2020 14:09:04 +0200 Message-Id: <20200411115510.720343132@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200411115508.284500414@linuxfoundation.org> References: <20200411115508.284500414@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 @@ -62,8 +62,8 @@ static int rxrpc_wait_for_tx_window_noni 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);