Received: by 10.192.165.156 with SMTP id m28csp1103332imm; Wed, 11 Apr 2018 12:28:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Jon0lMWSReL5yd902w8pElIUNzWZyiulByvc0ZcpxEjA2EscDjq2oW7dDCSHg7BDnRNkk X-Received: by 2002:a17:902:28e4:: with SMTP id f91-v6mr6567729plb.336.1523474902946; Wed, 11 Apr 2018 12:28:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474902; cv=none; d=google.com; s=arc-20160816; b=ihxvIAoK9tdOdUFlLL52ninK09dVlaMLB1QBJCCQvz+NiazD1AJYK+TZ4LYRne4atD qpUBBOyJV2MSjMa7GZZN8Ux7zpNdamiqWSGBuz1t226he6CBOU/rda0XwYNDys8e0s/s WlLS7Z59yMziuvDnyDcqfZWi0ar8/StNyPJimn4Y4dBA7kUpGN6V5ajbEOsjZRPo1BI2 l4/EqPFUTbAyRbnfaiNqwozou92W8TlqnmTBGuXqHkcLxO6dQZ4Safu4PbwKH0QrWjBo QhurjcEkl4WZtxJOiOeUkLcrA3W+wOkNokT0u3kf2UF+ioEWeYFQLxS/IiXM5Z2ExLcZ 1Yug== 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 :arc-authentication-results; bh=alYglEAltJa407oohQwgGsJ9owcT3QPkOxb4qoWHRQc=; b=QHvsQvwR593a+W1k47ZMnWIdZk8+0V1uCeHEb+jdarZFo0TBNJ4RDnKTq8bI7wYlTj Ji5kZuHNRfFBcmoiQ0/4CstCswJcwqk1IKDXhDiZcXCdScz+b4RvKaRwiK9vXwJwKXDS lkikytpMYF5Vj+Y48ivnfCnsHJZN4fOp+tZIhWhpkKLuEgLli1X31FvYdiA20nPotF27 5QpbgaL46gn8bCZ4hEDlp0tavAJQNev6ndBNfV1kd2ntnTRFouoAXhKddyyA/IRRKNsT qhD/hjNCssKLjEw8V5ElC5gFgibMf7GWzmQrb7/W3Eg5kuj9LQInoOnanUZ/I3BCOjng r8wQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h3-v6si1708390plh.385.2018.04.11.12.27.46; Wed, 11 Apr 2018 12:28:22 -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; 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 S934714AbeDKTDj (ORCPT + 99 others); Wed, 11 Apr 2018 15:03:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38990 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934641AbeDKTDe (ORCPT ); Wed, 11 Apr 2018 15:03:34 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 17CD0E63; Wed, 11 Apr 2018 19:03:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jagannathan Raman , Aaron Young , Alexandre Chartre , Bijan Mottahedeh , Liam Merwick , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 239/310] sparc64: ldc abort during vds iso boot Date: Wed, 11 Apr 2018 20:36:18 +0200 Message-Id: <20180411183632.768848978@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- arch/sparc/kernel/ldc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c @@ -1733,9 +1733,14 @@ static int read_nonraw(struct ldc_channe lp->rcv_nxt = p->seqid; + /* + * 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 = rx_advance(lp, new); - goto no_data; + break; } if (p->stype & (LDC_ACK | LDC_NACK)) { err = data_ack_nack(lp, p);