From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C928CC352A3 for ; Mon, 10 Feb 2020 13:09:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9EF2120708 for ; Mon, 10 Feb 2020 13:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581340175; bh=RFgo86AgtcQiK8ya9+btawEpmHzxa7nsZHx6nqzGrKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZqJ0HOm/VD/3oBh5yTfGgS0S5MCUWoYTQ+Qeb2vD1Ko20tutP9jjEYRGB4vLsg7Gf 1cF74gLXpQ19yRAPvtBbHzeoJ0UwzIXND98EQDq5u4OlEDPxT0sZJy9YkVe74SpT20 GiicKSAjqiVE5r+DLMEEkyHT6e3l6OZzOFVwHzGs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728642AbgBJNJe (ORCPT ); Mon, 10 Feb 2020 08:09:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:36808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729393AbgBJMjS (ORCPT ); Mon, 10 Feb 2020 07:39:18 -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 4BBC52465D; Mon, 10 Feb 2020 12:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338358; bh=RFgo86AgtcQiK8ya9+btawEpmHzxa7nsZHx6nqzGrKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=greybt3YYMszq1/8iS0mjYnhr+kZigRgIrtdvAtoA9KJGNwhmzpg8hPcaPDVBOFHC Qhm+vge6QiIfzkU2t+7CyxmRtmFStbCHiitPpGOnX7Q2MbN4JvhfH7jwl08kNyime3 f5LXlUJs/eU9NL6pw4aU0qE/ZIQGFAoa/rbHdnj4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells Subject: [PATCH 5.5 017/367] rxrpc: Fix insufficient receive notification generation Date: Mon, 10 Feb 2020 04:28:50 -0800 Message-Id: <20200210122425.460330074@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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);