Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp701795ybv; Thu, 13 Feb 2020 08:02:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyKJQZBUAJ66HEDsy8/a7eGCeL48Bp0mfMEcxguUYZSpIiHhvj1fdmDyWNIO8gakEuuKpRM X-Received: by 2002:a9d:51c1:: with SMTP id d1mr13200354oth.136.1581609720799; Thu, 13 Feb 2020 08:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581609720; cv=none; d=google.com; s=arc-20160816; b=L4pqKtSfB5GxBaf/QeugxbHt/dXpWJ/8jEysYXPeGnIaIYW8SyXCYgfhD1L/4O6vae /+DiwJUacJpwVGVW/ULxjO6+2jooL+b+HNwaemRTp4+IOTSdosYTxLImdCUlbUv1K0U6 URBDk3iExQFss65YSOXOarsHfolWsOPdIzvW8/BCMY+/JaHY66wzHdjo/jwYYwlvL2AF 884UN3ph/C9YlcGP+mGBLTaGgDADXKbZJJnGdyM/LYaLs3dhra7IhJ8Xs/GaZM87bFGW mI7qivOU31wvQq6QzN8NNCanVm9i9SibXkolKkaNV3OWCiL6ZHqhgWZzaRPc5rlrQs57 b5HQ== 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=Nsp9Y58vP00m74WAs9oybnAXQ6f5lf6jlkFoYbN6y/A=; b=DQRvI8/c6Y+d+dZ+9i1PIkHI4OMMAEWdD111GxOuv8epvtN1Xxbj1IwKsapKseFQ/y yheu/Wc1MNHHVHSxkQyhkw75VfqHveOMa3sleTUE0mv40Iq13eOGz+yDXWbF/ZtoSE4H Qm/5sbw+5vVrbujSY7nNl1mbuyKsFRCGyvbAszIf+oP6uTikpurOhEoPn/2EsD8TitS+ N3nf4/Ci+FeJ1XERPwVYfysuBKOzEtDx8g6HqoA1dPjQzNgb3P4Pxdqs9fmtxaEgwrLx 6g9hcdCoMNoSRmjLvz4Ulb+EFR+i+sGkK+BN4PsQpH4pGxsJvr7d18c4UGalzc5np2i3 OW0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MJ6uQsaV; 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 l23si1317777otj.302.2020.02.13.08.01.41; Thu, 13 Feb 2020 08:02:00 -0800 (PST) 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=MJ6uQsaV; 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 S1728390AbgBMPYo (ORCPT + 99 others); Thu, 13 Feb 2020 10:24:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:34480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727671AbgBMPX0 (ORCPT ); Thu, 13 Feb 2020 10:23:26 -0500 Received: from localhost (unknown [104.132.1.104]) (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 95D7A20848; Thu, 13 Feb 2020 15:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607405; bh=wRlQUgsCy4+MCKKHrC6POl2QDk1hXQxl+V6vpyY36C0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJ6uQsaVvYyorUVH+TedbuPj9GXgCCfzRAdEAMyi8DL3UcaCQB1GLYWUpLaz0llK2 MnQlUZiRQx9Wcz9JxLtzauI1fN/gRX1337STDzYGYCMQoHbZABuJDdDJfX44Tcehfw VKjpT58pRbUkIGEMtbwM7L8ylXYTwRr0Y1JzYpz8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells Subject: [PATCH 4.9 009/116] rxrpc: Fix insufficient receive notification generation Date: Thu, 13 Feb 2020 07:19:13 -0800 Message-Id: <20200213151846.347582601@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151842.259660170@linuxfoundation.org> References: <20200213151842.259660170@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 [ Upstream commit f71dbf2fb28489a79bde0dca1c8adfb9cdb20a6b ] In rxrpc_input_data(), rxrpc_notify_socket() is called if the base sequence number of the packet is immediately following the hard-ack point at the end of the function. However, this isn't sufficient, since the recvmsg side may have been advancing the window and then overrun the position in which we're adding - at which point rx_hard_ack >= seq0 and no notification is generated. Fix this by always generating a notification at the end of the input function. Without this, a long call may stall, possibly indefinitely. Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman --- net/rxrpc/input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -582,8 +582,7 @@ ack: immediate_ack, true, rxrpc_propose_ack_input_data); - if (sp->hdr.seq == READ_ONCE(call->rx_hard_ack) + 1) - rxrpc_notify_socket(call); + rxrpc_notify_socket(call); _leave(" [queued]"); }