Received: by 10.192.165.156 with SMTP id m28csp1157455imm; Wed, 11 Apr 2018 13:32:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/SHi5YpFcGdf5KO4vh/45uRZeRlIwWLZSBE4bokyQeKAsi2R83EYsHsEG9pnpuWgLbY6wV X-Received: by 10.167.130.2 with SMTP id k2mr5269923pfi.14.1523478726040; Wed, 11 Apr 2018 13:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523478725; cv=none; d=google.com; s=arc-20160816; b=gn58zJZOk5grSf28AAtlVQAnwstPqRNNWy7GeYoSxW/XENmf6bUnigthqRWHyFX5W6 0vCO7NbF8u9hn7txqA9C4d6v0fUrXuMvqDVHL+ImswtIhRyX6Ec8qddMFc5Sjb4CO+Lt DlbV0RnPYr7PRcnvURXHDfLCgF7b01/hqLWoZtT9W+rvcgvwqZVG+iIokR4/50WB8f2R nDTDh3topAYaHy4MER8WVfDKytMtaZZmfHC0GBjJMt8IbunGAFwT6eUF7GoBY4ymGiJl NlHHLjMgxPE+xNbejOhYhN6nlMKbTHwwx9TJrGM8HEk/uOiiUZm3XZXPXxjoq7DfjIIm pByA== 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=CQqi1xQROkROuBK2r+KjSIVCI47TFsJwOtFWnPJUb6Q=; b=wozqDduk8XVjPe8MqcKyo01ijJpnpXiHrPiylThZi0oQapbgf8Zzy56mpkNJaLlEJz fJTBmrP7b/KlBCQOPHG6P3E7hXTtgSAd4KTPLhqRsnb0/84DKrsnZiDQJ4V5oQrkv5ZR 4tAmM14KNdGtjoOn1ogupxjerL03ERHP38OmlHV78CzIsmAoPVOOnBD4iRULMEYfIXcw KFN9LYyk02RKwbx/BxUrfRDchx8yCgVJt6tbfFEGogzlVl2UPQPt4vRulPFdCB6LqXv4 HHMstXiyqN0Av68jpMsHy1BpuM5vCECyhn7Da/TvCp11bSDaWIfa4f/TU2AWemlMO1Cb k6Tg== 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 o69si1371157pfi.157.2018.04.11.13.31.29; Wed, 11 Apr 2018 13:32:05 -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 S932890AbeDKSvd (ORCPT + 99 others); Wed, 11 Apr 2018 14:51:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33068 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932879AbeDKSvb (ORCPT ); Wed, 11 Apr 2018 14:51:31 -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 AA42FE3F; Wed, 11 Apr 2018 18:51:30 +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.4 141/190] sparc64: ldc abort during vds iso boot Date: Wed, 11 Apr 2018 20:36:27 +0200 Message-Id: <20180411183600.871074219@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@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.4-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);