Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2259056imm; Mon, 28 May 2018 04:58:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoVRLFq0w23bUuTT80pqo7h/fMpcsL5nFJObBH01H32IbzsIZxGS2fOnvDW+czMo0n5KDJH X-Received: by 2002:a63:56:: with SMTP id 83-v6mr10074959pga.29.1527508696001; Mon, 28 May 2018 04:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527508695; cv=none; d=google.com; s=arc-20160816; b=0pUx01lM0dDK8hscb+cFrufDGSkYfj73YfrQLJQ8fAEhDkAUGfxzPSO+a6av6haBYU o4uQ0fAc4ZNWxo4Vdo+tVf2/h/jo04KnGa5n7lq9rhAPnz8EVcnpihQ8bvszW5yrv3Fl 2H3OX2RV5VvNf0Az0nkOvWBa4zXL5HWx2TwjGYK2Pjs0PTPEWAHh+rjvIVyAkMOLCDXH QChD1gwhTzv6nEvxirN1E9YllcGBVCEX0Vm0bthP+WVNz0KsZsledtHCwt4vL7G5CJ1A r3It3yA57HJTflXKrlA8l7j5vCFJm/L1W0ykl/OocX6XTq5uikOctAtcx1SRvzaBok1C YGEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=XZ0iDvbxNEG18JtY0zSQ50EzCHqB0SFDHDiSgEJCinI=; b=OP3AlzAm4n/CoexErBfNs+I3ODH+DUlOM6ju/jMDfCRYuvQllGNfH0WnfHB4z12sXz FtwSgMCCYJVPNfgwaqT1jJ+RtSGCvgP4/uEKKSSLbTM2It6UqQW8zdJCqyajtoaMpaJX oAg1/lCuYRO1pmAXQ4mRrEypeEUTHwvu809085yoIqK+5QlImPXF3d3OApFw0K/9t2sB B5TOViwF1+rF+dGvr6OJED2lLiR5r2Dn/HBaKbNE1JeszFp7oXSu2oIg147GWUyjoyXL 6G2tCQfC8PcgUecSOjU4kPVDLUZAkZ1BRpEOr+Ww0UsERpSRRPXz+YtXgekbE4UhySP0 F7rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ykni9e9Z; 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 y125-v6si7528243pfb.284.2018.05.28.04.58.01; Mon, 28 May 2018 04:58:15 -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=ykni9e9Z; 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 S1423695AbeE1L4j (ORCPT + 99 others); Mon, 28 May 2018 07:56:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:55624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423558AbeE1LIQ (ORCPT ); Mon, 28 May 2018 07:08:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 9A6132087E; Mon, 28 May 2018 11:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505696; bh=SEBNj2dqTp5zdZq2w+DIpQqEVkhTDBUXwPNWnbLztEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ykni9e9Zl6nclilQ1uqwD3nOW/DMxKt8ik4fT4kezwoZGP6dw0n4hkPmx1FyUGqZD gvipEV11aEJLyMC+zeZzCOjhifnyCyVYonS/o2uQwOuQQNicyWddPHHQ2I535e+84I LqjPre+TA7wlZ0SJu+kUX9F6aOS0/bZEhlftYgoY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Dionne , David Howells , Sasha Levin Subject: [PATCH 4.16 096/272] rxrpc: Dont treat call aborts as conn aborts Date: Mon, 28 May 2018 12:02:09 +0200 Message-Id: <20180528100249.227678976@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100240.256525891@linuxfoundation.org> References: <20180528100240.256525891@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Howells [ Upstream commit 57b0c9d49b94bbeb53649b7fbd264603c1ebd585 ] If a call-level abort is received for the previous call to complete on a connection channel, then that abort is queued for the connection processor to handle. Unfortunately, the connection processor then assumes without checking that the abort is connection-level (ie. callNumber is 0) and distributes it over all active calls on that connection, thereby incorrectly aborting them. Fix this by discarding aborts aimed at a completed call. Further, discard all packets aimed at a call that's complete if there's currently an active call on a channel, since the DATA packets associated with the new call automatically terminate the old call. Fixes: 18bfeba50dfd ("rxrpc: Perform terminal call ACK/ABORT retransmission from conn processor") Reported-by: Marc Dionne Signed-off-by: David Howells Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/rxrpc/input.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -1240,16 +1240,19 @@ void rxrpc_data_ready(struct sock *udp_s goto discard_unlock; if (sp->hdr.callNumber == chan->last_call) { - /* For the previous service call, if completed successfully, we - * discard all further packets. + if (chan->call || + sp->hdr.type == RXRPC_PACKET_TYPE_ABORT) + goto discard_unlock; + + /* For the previous service call, if completed + * successfully, we discard all further packets. */ if (rxrpc_conn_is_service(conn) && - (chan->last_type == RXRPC_PACKET_TYPE_ACK || - sp->hdr.type == RXRPC_PACKET_TYPE_ABORT)) + chan->last_type == RXRPC_PACKET_TYPE_ACK) goto discard_unlock; - /* But otherwise we need to retransmit the final packet from - * data cached in the connection record. + /* But otherwise we need to retransmit the final packet + * from data cached in the connection record. */ rxrpc_post_packet_to_conn(conn, skb); goto out_unlock;