Received: by 10.213.65.68 with SMTP id h4csp2119587imn; Sun, 8 Apr 2018 20:11:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx48OrpfjJ9xHhwnZ+ArHcN3NOv9BLHqe6K6GwpcKWH6C7I1J9wV2CH068OrUkNd2CcX0dvVF X-Received: by 2002:a17:902:6184:: with SMTP id u4-v6mr37826745plj.390.1523243382665; Sun, 08 Apr 2018 20:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243382; cv=none; d=google.com; s=arc-20160816; b=aQkK6H9FI7nsLR0rJ6fJ/Xig8hinI/ZVQJFv3mFt2sD9+x/NJOzLtxV/uCpeh/aOt0 4QATn87dYkPmjgaYFkjl72a7qHy9SaPebKhQXgNUYgUrklbOhij48SYjhObpi2Z+0Tb9 7fwRywxZUwsoTZI3XyZvReyABuSq9x5A/FTjJLKTqSv2I8lgDkwmEq+bBO+dr5J1gvTz 5DqsMwKBhr2orUmW9z444dBG3tRwCmS+QoF2sy9usaAJ0r6Fhq7tsHu2z0l49lUUt+Qp AFG4kPLVaKthBM++hGW5ReDSsISY2vgBGyOmACUs6xjQPyHLky2P3wB/5zoRYN4V8i9R hmhA== 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=ILEvKGmpkKKJGWS6ga96BvZT1Au2ngryNO1jUNIiMHU=; b=lREcxsdEANc4VQNyYIlvXaZTU1r7JgJD2Tx602ko+RR+1M0nLQB3PMkpf13OH/2O6X qp526L5rjShm0S+u6NIDc23URU9m8S4+bit48Jx8Uq1b6lw4KgJSC24vMligTo5quk0u 3xaP25CWjA3nTvrh4tDhtYRz1ZWNkmeJffsi1A6xcOw2PG9X5qlB5kiaSjje1OiszG4c Pz4ykI88LZVfyXed5FPN8Bhcj8e0ZKzI8sA8jtbKkYcXyILRek9HtEF2zn5NxD/G0CCL BP4vPIto2HxS5eUovFt8D+qa1fAMNlI1K7ADZGOSKJv9erYoYhXGVDOX9jZ3E7mUUgua rvdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=eEFZDAos; 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 3-v6si15814365plu.465.2018.04.08.20.09.05; Sun, 08 Apr 2018 20:09:42 -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=eEFZDAos; 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 S932414AbeDIClo (ORCPT + 99 others); Sun, 8 Apr 2018 22:41:44 -0400 Received: from mail-by2nam03on0126.outbound.protection.outlook.com ([104.47.42.126]:2432 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755479AbeDIA04 (ORCPT ); Sun, 8 Apr 2018 20:26:56 -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=ILEvKGmpkKKJGWS6ga96BvZT1Au2ngryNO1jUNIiMHU=; b=eEFZDAos/l5Y6u9TFjYU481XtxIQGgE8p0pmvNTGd213whWxQ54i5CuI6XEHjl6t/fkMO6DsfQuOux54jHGbXYxYoNvLr73av2J9Z9uy65Vq1T8L6/KiamEbR6CHollbu+JQGqm4Q5Z+KBhtfUExssPGmJpSQ9+aqn3di8HBTpg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0885.namprd21.prod.outlook.com (52.132.132.154) 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:26:47 +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:26:47 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Jag Raman , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 030/293] sparc64: ldc abort during vds iso boot Thread-Topic: [PATCH AUTOSEL for 4.9 030/293] sparc64: ldc abort during vds iso boot Thread-Index: AQHTz5jygqlrEZg320GmHJ8quCkciA== Date: Mon, 9 Apr 2018 00:23:13 +0000 Message-ID: <20180409002239.163177-30-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0885;7:wQ3TePbkqwI5b8UamSBLvmEruov/IDWntdlCjayKTBQPvGB3R3TOc2HEb5d6F6uALe1rNvjVuGyL2IzY5aUc7s0bblICOjyvhXiZhEEVDufFmaqEsIB9w4fMYNCfCL95OSji6All7zuy3QtyYBA6dseprZJxSesPonbswK4yG0C/1Z5hPtqY/LPUbiOHmptnocc8qN6SsuqvDnKLlYNmunQYU0AalJHbxqBekECVFBntfollvGwybDow9+0Yps1V;20:xy6z5jQX81AacsrTbPLegtWrj1EXxUFHMkRyYnDwAx8C8coFfP6DJkDn5iW/8h3tLso1PXj67sF2eEGxwKhU0SaJtMd09+QHqxBi39cpiXRfRH0WolWp66KGG8jFChfkEP5jcAK68cObY1LfddO2tqbM5ni8elWouSBAn/kJBXU= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 59d5468b-e6f1-4941-9639-08d59db0949b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0885; x-ms-traffictypediagnostic: DM5PR2101MB0885: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0885;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0885; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(396003)(39380400002)(189003)(199004)(2906002)(68736007)(22452003)(316002)(6512007)(5660300001)(6666003)(54906003)(110136005)(486006)(6486002)(102836004)(36756003)(14454004)(99286004)(86612001)(105586002)(72206003)(106356001)(2900100001)(1076002)(97736004)(10090500001)(3280700002)(5250100002)(6436002)(3660700001)(6116002)(3846002)(305945005)(86362001)(59450400001)(66066001)(10290500003)(186003)(81166006)(8936002)(478600001)(476003)(25786009)(81156014)(8676002)(4326008)(7736002)(2501003)(107886003)(6506007)(2616005)(26005)(76176011)(446003)(53936002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0885;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: kfQMhd/zVWSSGQeFTOcDwVj0piOwEZ1VEulLSyvT7RYMQAQxS/qSdxQ2ohlkSCIP17B8aDbpSPAZOKv1zthw0WejvscLXqxBPIZoztv9q+NaILQHmQ+um+1h9IgEPMuiUN3zN3OiDMoRDqUK831d9r4WIIVk4FXjut5uXa3Yea+GoWi4LHN5rDZJ3/sqD4W9/dRNRmg0tUjtL6o6fv6y1v2N/mTpqDRwQ/r/NBAxn2RcTaQ2V+rQy5WMYV9SkFUPYe7uDiyuluMonFiQdW8xfL6HTbG4N0UwD2A801gQ+Ap2lbull34t/ktGrrxNAVAL6izTejMl76nnSsRAUMcB4r1A+XtJ1ZSGkICYcoZWxJNtlriUK/xBzQjUpWrQ2f+iVky2KRnrHp2sEBaJdAPnnKE7I3THYOBj7REqlZBBlTA= 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: 59d5468b-e6f1-4941-9639-08d59db0949b X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:13.7998 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0885 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jag Raman [ Upstream commit 6c95483b768c62f8ee933ae08a1bdbcb78b5410f ] Orabug: 20902628 When an ldc control-only packet is received during data exchange in read_nonraw(), a new rx head is calculated but the rx queue head is not actually advanced (rx_set_head() is not called) and a branch is taken to 'no_data' at which point two things can happen depending on the value of the newly calculated rx head and the current rx tail: - If the rx queue is determined to be not empty, then the wrong packet is picked up. - If the rx queue is determined to be empty, then a read error (EAGAIN) is eventually returned since it is falsely assumed that more data was expected. The fix is to update the rx head and return in case of a control only packet during data exchange. Signed-off-by: Jagannathan Raman Reviewed-by: Aaron Young Reviewed-by: Alexandre Chartre Reviewed-by: Bijan Mottahedeh Reviewed-by: Liam Merwick Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- arch/sparc/kernel/ldc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index 59d503866431..9cc600b2d68c 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c @@ -1733,9 +1733,14 @@ static int read_nonraw(struct ldc_channel *lp, void = *buf, unsigned int size) =20 lp->rcv_nxt =3D p->seqid; =20 + /* + * If this is a control-only packet, there is nothing + * else to do but advance the rx queue since the packet + * was already processed above. + */ if (!(p->type & LDC_DATA)) { new =3D rx_advance(lp, new); - goto no_data; + break; } if (p->stype & (LDC_ACK | LDC_NACK)) { err =3D data_ack_nack(lp, p); --=20 2.15.1