Received: by 10.213.65.68 with SMTP id h4csp2139419imn; Sun, 8 Apr 2018 20:42:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/5MkAletjP5kxAdfRHEr434F7PmxqVokqJ0nLG/6yVCgA5OCyc9rahYOpU3S5320KoAnv2 X-Received: by 10.101.88.194 with SMTP id e2mr10605237pgu.229.1523245365333; Sun, 08 Apr 2018 20:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523245365; cv=none; d=google.com; s=arc-20160816; b=DfEHAelGyN9OMAmJoqbGEE9h62TmhC2slbsl2+ve/t1/mVOI9YGS9Tnp5ejFFuJblm mksm9Gw3ITFA8PwlYW4E0c7NPh14PbzuX441tgA6tNtMYh/5ypmgXAvVhWGNjkNEhjRS eHGhQ1l4uEg2XuIMFAWRIeaK2qrRPLgtOG0MUuPm01AMxVymS7Ced8tZswvaFoEnXFdz B3Dxxhiak/JCwKj48xp2uahnW9i42xgtvB80B4AlwKdpwlDxzZd+85VuonhyPp9xaHBT 7NFDZ50msq+9o4EUYHFCSbyRuoqGazHemXPxoen88CRNU+t3GPeIzqRIzsPqra+iZGDU 4ChQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=VA+600A/gVzoaBrXLUWbOtFw9f5GI+oV+DnXwHH7BiI=; b=I1L5ujwpiZNFX60mGfZZr1Nml1V4pdE2+MS3pOeTCFxtRtcKBuOZb+DTUw5AMSCi2E q0OKQb8qdrZ2Oop1cleC8xbJtHCzwyY9pvlyotdf7visP69pqvS+8rpGxFJIyvpNVuEt QvTwJP8Y79PG1t4HECu9lpOTkoYTCW576Po7Qffq1eQzzdbrPgFITA1kcWuibACUpf+O l7H8KZYKl4atjnqgJQ2aP8TB1vZ7EYQW+O3Btih1uMlF18xdfmbC+uTB+lB5yT61AiWO omFLIr9dnOd4PRQM7V0ItMQEgrmJCkjSuKyb83O/+ZUC8KSey2CTMTtLu1qr9xJ4wc98 v13Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=eeIlTr/r; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13si4487753pgs.830.2018.04.08.20.42.08; Sun, 08 Apr 2018 20:42:45 -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=@microsoft.com header.s=selector1 header.b=eeIlTr/r; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754787AbeDIDgm (ORCPT + 99 others); Sun, 8 Apr 2018 23:36:42 -0400 Received: from mail-bn3nam01on0124.outbound.protection.outlook.com ([104.47.33.124]:4000 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754386AbeDIAVK (ORCPT ); Sun, 8 Apr 2018 20:21:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VA+600A/gVzoaBrXLUWbOtFw9f5GI+oV+DnXwHH7BiI=; b=eeIlTr/rZk0t+3m3LYuAW7y+BL4VIv+4GZSpbKrwaYzGPr3BBL1QqUh9LPWOd6ilbYlrO/I90oePlzHaNcmO0H6KfpQY0y1sWKqXPWBimGSckAPGdN9bFn74Kck883b88v14eHEF4MSco7Ew0RZNtRkxA7M2Zpk8Iwy606r1xg0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1110.namprd21.prod.outlook.com (52.132.131.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:21:06 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:21:06 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: David Howells , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 164/189] rxrpc: Fix received abort handling Thread-Topic: [PATCH AUTOSEL for 4.15 164/189] rxrpc: Fix received abort handling Thread-Index: AQHTz5hbC40wMXXqmkymBZY25UL7cg== Date: Mon, 9 Apr 2018 00:18:59 +0000 Message-ID: <20180409001637.162453-164-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1110;7:ADPJ3UPcY4iiOAYUXRVvu4WPsCiBy/yA4xKZD/fh1pWnTdGm8Dmfc8gSqTJSYl5nClFrEvr+W/TJMykc9aA2ScR9pwIKRMSDIzr8cdVKd+ncMCfsFbGdE6tn80KyMVk5JBqqdqwNo4v3Kxk0k9j0S9g2Ib+npKa1O3UDPTtAucOBDqwP8z380woA+sJxoLaCfez6yEWAKrvcTew4JkIRua48LkZv3cMkbJ28KtaP5wu4Dk39hHDyoH8QyI8Tlt9W;20:ghj1hvalTCgkupIZa/e1QPOE7trWZ2LMwlA7FxH8Hf+D0EO2iDP31PttQ0vM+YQ/dmLJRTne/+qxPCmme+38RC5vrarpJWmaJGIRNlrLvU508YXcsquYB6Ejv7yw2bWuoetcbMSJmFb2aK1Hd9wAdoM0a/cuCvSfXZPqwnaNj3g= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 705bb387-ee23-4467-aac0-08d59dafc98a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1110; x-ms-traffictypediagnostic: DM5PR2101MB1110: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(158342451672863)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1110;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1110; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(346002)(396003)(39380400002)(39860400002)(199004)(189003)(5660300001)(478600001)(86612001)(3846002)(6116002)(106356001)(6486002)(72206003)(25786009)(10290500003)(8936002)(6436002)(76176011)(2616005)(6506007)(2900100001)(97736004)(486006)(26005)(36756003)(10090500001)(81166006)(8676002)(81156014)(102836004)(2906002)(99286004)(11346002)(476003)(3660700001)(66066001)(6512007)(86362001)(53936002)(105586002)(186003)(5250100002)(14454004)(22452003)(6666003)(2501003)(446003)(7736002)(316002)(1076002)(110136005)(3280700002)(54906003)(68736007)(107886003)(4326008)(305945005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1110;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: YaHM38YwcIfpdnmZ4rALHGbsHc+teer3PLNlAZqLVv3C+6MlhpSQZJqnurV5gLyGeimOVMcouPVx8l5Og0OG7yLbJaN1Gt+0GtPPBWrQJn2wzK3FtJMCb4+RykywY9FQmd5dmJffGIRWTbQjiatDnO815G19t6CRy7JMaMVk9vdBrE9d6sqQnm8KJztnk4V8mZDE4mcu1SvcWk6QuPapKk94XtDRg5S4hl5d8FfMGVqGlKGb1o87tgcl/uLAuI7bxeCgG80/22PGBuB6gNfPRQSJj9xHOiJF9BZaDJAxgkASyv5htBtg7KMEI8I8gsQSPW/3Gbf4Dj6nw/YFgYBIsTaeIwTzICaQYDXIKEXc4JTKRKXJmDCaOwA7dFWXLvvPe2vhPHG3nm3ct9pTPNv3zDLe6mP72VwYC82LZ4jIb78= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 705bb387-ee23-4467-aac0-08d59dafc98a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:59.5805 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells [ Upstream commit 17e9e23b130e4e269fa53c2370325249f3ba75dd ] AF_RXRPC is incorrectly sending back to the server any abort it receives for a client connection. This is due to the final-ACK offload to the connection event processor patch. The abort code is copied into the last-call information on the connection channel and then the event processor is set. Instead, the following should be done: (1) In the case of a final-ACK for a successful call, the ACK should be scheduled as before. (2) In the case of a locally generated ABORT, the ABORT details should be cached for sending in response to further packets related to that call and no further action scheduled at call disconnect time. (3) In the case of an ACK received from the peer, the call should be considered dead, no ABORT should be transmitted at this time. In response to further non-ABORT packets from the peer relating to this call, an RX_USER_ABORT ABORT should be transmitted. (4) In the case of a call killed due to network error, an RX_USER_ABORT ABORT should be cached for transmission in response to further packets, but no ABORT should be sent at this time. Fixes: 3136ef49a14c ("rxrpc: Delay terminal ACK transmission on a client ca= ll") Signed-off-by: David Howells Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/rxrpc/conn_client.c | 3 ++- net/rxrpc/conn_object.c | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index 7f74ca3059f8..064175068059 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -834,7 +834,8 @@ void rxrpc_disconnect_client_call(struct rxrpc_call *ca= ll) * can be skipped if we find a follow-on call. The first DATA packet * of the follow on call will implicitly ACK this call. */ - if (test_bit(RXRPC_CALL_EXPOSED, &call->flags)) { + if (call->completion =3D=3D RXRPC_CALL_SUCCEEDED && + test_bit(RXRPC_CALL_EXPOSED, &call->flags)) { unsigned long final_ack_at =3D jiffies + 2; =20 WRITE_ONCE(chan->final_ack_at, final_ack_at); diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c index c628351eb900..ccbac190add1 100644 --- a/net/rxrpc/conn_object.c +++ b/net/rxrpc/conn_object.c @@ -177,13 +177,21 @@ void __rxrpc_disconnect_call(struct rxrpc_connection = *conn, * through the channel, whilst disposing of the actual call record. */ trace_rxrpc_disconnect_call(call); - if (call->abort_code) { - chan->last_abort =3D call->abort_code; - chan->last_type =3D RXRPC_PACKET_TYPE_ABORT; - } else { + switch (call->completion) { + case RXRPC_CALL_SUCCEEDED: chan->last_seq =3D call->rx_hard_ack; chan->last_type =3D RXRPC_PACKET_TYPE_ACK; + break; + case RXRPC_CALL_LOCALLY_ABORTED: + chan->last_abort =3D call->abort_code; + chan->last_type =3D RXRPC_PACKET_TYPE_ABORT; + break; + default: + chan->last_abort =3D RX_USER_ABORT; + chan->last_type =3D RXRPC_PACKET_TYPE_ABORT; + break; } + /* Sync with rxrpc_conn_retransmit(). */ smp_wmb(); chan->last_call =3D chan->call_id; --=20 2.15.1