Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3731549ybv; Mon, 10 Feb 2020 05:28:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzvGaHFiOF7V6lyk9I72t9OUzlzoR6pu4Js5wqD703CSPsLFNS+r/iCdaDGsaRAvKLzSUQe X-Received: by 2002:aca:1a05:: with SMTP id a5mr819358oia.97.1581341335541; Mon, 10 Feb 2020 05:28:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581341335; cv=none; d=google.com; s=arc-20160816; b=xtWQm7JawYxZjL2JIedifbSca4pJYq0XD2drLAWrf/i/CYIGQVqvSEnLKv7pue2wgl j1Crrb58vOxX4fqvC58d//xC2kQlTeFhUXyvyO3jjLNcBk6GWPCRD7/wOd/sGSPkWbPn KacHGonoderzpcs6HT1POSw4sbkOP6b5w1i/w+hwiLmVCmWkydDn3r69KHk3J4vcAPmM DAPo6+r1wedV3iR0pf1ZakoCLWPKznTekJf/veknfnVpExzwHW6dl6UusYdVwnqc6Jun AdGHHzoaGVikY6E3VkqfTH6XfiMmxWUMRTFsi9kQ4PKWg33OmyNvrYcWAAxDRJR+BXhW qnKg== 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=Utu+MuXvyWazO+cljo687ZGvWCNct8ygY8Cu7ajjEcE=; b=yyA75ES250azFLMBlmDzS1EChjMo8jUKJjy2Y1TKftYf9jvUyvvW5a4hwVs9tB8NEX vJ/DI3a1/XUGVwuvO+N2oPIRUoU6q7HABjTPJxQa76UeKRy2C4aM8n590WYJePriTqky TQcHHxDOzSOAb22qxbQTVmveyN1KWrCMrlvxtf6467gkVTYIHY031b1/heDSycunLpsx hO/xrTdHO4VMC0J4F4Su8OkZhS+5JumPNJOBXRH++DQnpTsQ784UwRk/zzJ2Y/hDRZKM pWa+l1veavULgY2tlhwL7E7jBVQXPMz7CyxZtBGVE5aSqcIUurUP1AnZfQevdZxQevEE fSog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=naJLGMem; 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 u21si178795otq.137.2020.02.10.05.28.43; Mon, 10 Feb 2020 05:28:55 -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=naJLGMem; 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 S1729739AbgBJN1M (ORCPT + 99 others); Mon, 10 Feb 2020 08:27:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:56486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728457AbgBJMgi (ORCPT ); Mon, 10 Feb 2020 07:36:38 -0500 Received: from localhost (unknown [209.37.97.194]) (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 DF0482080C; Mon, 10 Feb 2020 12:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338198; bh=RFgo86AgtcQiK8ya9+btawEpmHzxa7nsZHx6nqzGrKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=naJLGMemygtS3BqivfPkNYfzzemc3mwwZRB8pd+lehVqDkaKYpbnaItczKo/QoC/Y iHR/jrui/TGZyf8ro3JEVscy9pVQeEi59aeFzGokro0JTWJfIEFrq/qODeJFf0xjH/ Bpm4j6LZZxH2SEb15+YaMFgx0B9XRwsKs3XdW/m8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells Subject: [PATCH 5.4 011/309] rxrpc: Fix insufficient receive notification generation Date: Mon, 10 Feb 2020 04:29:27 -0800 Message-Id: <20200210122407.130550741@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122406.106356946@linuxfoundation.org> References: <20200210122406.106356946@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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -599,10 +599,8 @@ ack: false, true, rxrpc_propose_ack_input_data); - if (seq0 == READ_ONCE(call->rx_hard_ack) + 1) { - trace_rxrpc_notify_socket(call->debug_id, serial); - rxrpc_notify_socket(call); - } + trace_rxrpc_notify_socket(call->debug_id, serial); + rxrpc_notify_socket(call); unlock: spin_unlock(&call->input_lock);