Received: by 10.213.65.68 with SMTP id h4csp1668909imn; Mon, 19 Mar 2018 10:06:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELsz9QBZJZ5y4bt+R2Z7+1IRbg6NTmFXsUnt8+RaxD/Mpv2yVFFWs0GK3sLlh3OakpwWKrfl X-Received: by 2002:a17:902:d03:: with SMTP id 3-v6mr13318289plu.245.1521479176751; Mon, 19 Mar 2018 10:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521479176; cv=none; d=google.com; s=arc-20160816; b=nif98a3C920jWWRhRrzZ9WGFRZHM1prTztTReTv1v/3qunRc9JJGs6ofJ3KRM1BR2Y UNWFsfywcfIYovSvt5QMMfdOE556WYOU0ogcEYPvihxyVsJp5id4qpUdHggMoGn5YUNu Fdcg1AaldWWvghLwxIkeF6Eo0W4KGkY+vjKTndZhATXcdbyFqZJiGIV/udUcFjklRulR N43qld3XL586qLx/d0jDl3tyfni/kxIN9eO4YcnFrOHuaAAmI1t0FpVRgoSyUZsUmzyS wDiJoKSFJhTNZqUhQeGkqyQNnDdNNvgX+dbGLN4LDlY1C3TFIIgIbe8t3d7kGxJV9JSX /aeA== 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=/W1BvYkuxlnyFWZRD/S3Is3szUhIEhdjw6dEVeuBlK8=; b=d2jKR4QbyRYIyj2SNBCq8saSjH1Fc8abNHaOylScoMKdpcyirjbP7zLktLCwtlcxyP PRWZ+QD+JHyCp+pM0b+bTGDdhAbrDYpwB/sjc5VdqEu0IhWOdAqzwjOfc5cAV7Au2nT2 2Z+XaSe8VDJ8IPRDMwxj9dLRMYCJvhNTj1XlxBCdZLB4lxTXd+BQsxRS6gqJYuEDQPi+ anwOrXiYJWH+SQI56TEJj0jzQL9sN6TVmIJhwTUYGSCvSJHuPi+Z8HBFC+waL7d3gB9M PsV60FRRCdNYKIboLceDmc2Yxe1zehGIoQSfAZqEDaSQfP0sTLrhJ8XZrsgvSfj7RTdF cSyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=N9cUeJWe; 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 u70si214555pgd.619.2018.03.19.10.06.02; Mon, 19 Mar 2018 10:06:16 -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=N9cUeJWe; 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 S935225AbeCSRCF (ORCPT + 99 others); Mon, 19 Mar 2018 13:02:05 -0400 Received: from mail-co1nam03on0115.outbound.protection.outlook.com ([104.47.40.115]:37952 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966204AbeCSQLD (ORCPT ); Mon, 19 Mar 2018 12:11:03 -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=/W1BvYkuxlnyFWZRD/S3Is3szUhIEhdjw6dEVeuBlK8=; b=N9cUeJWeFCsfGbDePhmgi3S8bYxpWwi+07YyuuJ5Yce5cPHjxQWLkz+978kr9ZwD/8Lzl5HLu4e+dLFaZg2q8HBH1lYfFze+QHSfzYpWvcjHt9LnuwPswVicEYIQzt8PQeAChAKVjhPWD3fb1Lj8CTbQ2Zpz9r8BxhYBtbX3MO8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0888.namprd21.prod.outlook.com (52.132.132.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:10:47 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:10:47 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Jag Raman , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 145/167] sparc64: ldc abort during vds iso boot Thread-Topic: [PATCH AUTOSEL for 4.4 145/167] sparc64: ldc abort during vds iso boot Thread-Index: AQHTv5yC3zgjdU4WGE+t6KhkqIyhcA== Date: Mon, 19 Mar 2018 16:08:24 +0000 Message-ID: <20180319160513.16384-145-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-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;DM5PR2101MB0888;7:tNII1CMAE/UpmWYf95Ugy2fHTvUDGILHwKmL3FvyuhOaqA1sCahgiFe2R3bbxOdYzImsX70ViyfaGcbPiXU+ZCCP1DlQq5h0OCN+z2zKQh4/3c0NwXmVznMI3VMJqQ8N05KhZyDkWZaRGwi0KLkANnCEhoA9mRjG//VCfYMdEsoJIyouLy2N/I68gS7shGN7GBEdRnBte5hTz+7dTBpPYVeF8UPv9sOKJi1Z2eJ5bzJR2cdWw2vtnsntYE/cAIkr;20:/ACJ7tg8+qKkpB1oqplwp0RNIy8cQL9dU2Jxv3hF8kGotRIzXP4onrnVUzKOX9ua1Olbng4f3l2SmJLfwBVZJQRXHmEFst9vgn8patyWe6HnHCrrt+xIqTfj9jPJuUJPflgL810xCAhDk5AZ3jmJYBAnqiagM5uA91A2ST4kOro= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 521a0e7c-2f85-4da1-0bd3-08d58db3fa17 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0888; x-ms-traffictypediagnostic: DM5PR2101MB0888: 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)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0888;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0888; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(346002)(39860400002)(366004)(39380400002)(376002)(189003)(199004)(6486002)(72206003)(106356001)(86362001)(3660700001)(6436002)(68736007)(53936002)(107886003)(8936002)(81166006)(8676002)(81156014)(2906002)(6116002)(4326008)(6512007)(1076002)(86612001)(66066001)(25786009)(7736002)(3846002)(305945005)(5660300001)(99286004)(5250100002)(110136005)(478600001)(36756003)(54906003)(2501003)(6506007)(186003)(59450400001)(26005)(14454004)(6666003)(2900100001)(316002)(2950100002)(102836004)(10290500003)(3280700002)(97736004)(76176011)(10090500001)(22452003)(105586002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0888;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: eOQZutp3GTqFvC5C56oBRHye8whXOZVplDV3F7+sXVMkfNSx18HGByuDkhlj/d51/jAqNdIwUeWaxqERycvARvX8LN/CTTmUxJUWldSHe0lgLqAVJKH94KFJEGkzOgmGQzVy4ZoXpzPxfkkGXukZBCnLdYJWd4sNk6IsmwsDSgtV7Pb8SFW4JKEr8XkIAd7shfzeAQnott1JTeU1RugI1qv9SWvp82lm1/XFRO+R5nmKKnSxK2sb5vjCbM4YBMU/zZJHPKpr3UdRiglpNUYPHKEh7idyG5U7c0Rlt3VXQn/M9BxpwMhsEoVv7Gq55tca0u86zo2baWqOm32s7jfG/w== 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: 521a0e7c-2f85-4da1-0bd3-08d58db3fa17 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:08:24.8327 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0888 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.14.1