Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5257475imu; Tue, 15 Jan 2019 14:13:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN5B5AFf2NuhjFucTkVygZjQaB3g/APDZT1EUWF1ih98xfaXe89+Md0C1PE1Qf7ffcaWwKgi X-Received: by 2002:a17:902:15a8:: with SMTP id m37mr6443804pla.129.1547590415191; Tue, 15 Jan 2019 14:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547590415; cv=none; d=google.com; s=arc-20160816; b=T15J/59RmTfK+1z4vz6yeGPGkVHJSaA+kIDVWr9i5+PNCYD+ev+aBI2+OK5j8XWsJo CTEXqRsrTTEWECq19MDNzCAnbhmg//O+kbjANpp66rkzpit+Srf5WjjgIn9hXurVQpSz wvFUfao6ncYezdg639ktSFre3wA+R1Fb2Nnx5LOgor4XYyK/66OBZzytiKgs891GuuGo u6N5W+neltUnMOfSbziMPbbLgStr8V/ZbtFB5/sGQZnblqJ4lTaaA0+CstOd9QhfGS0w yTUoWXOh1El5kPzuKTcDT/PMkoKi/PTysqLIvQpdISyJfG29gDpiJMzeEvBaSLf6zwKk KLxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B7Y5qXbQf5DMyd7YWYy5tnoncnfJfh0gOq4Ejoc4TOE=; b=PEQ3EurrhpY3Qt/2bZOldrN8yuKCw92FAhH62yT4fpdZ4VB+MRmqb6Is2UVOZ/8jeK hSS6xEsAUXI7ismrjHQjoVyTcwWmMnuoTybDrG3ZF8liRqBjnLUAQFDNmAmHW957iy3Z vz5ny1b01w/FQaDHtTFdnY0PfAIIXp/UgnGkfg9ueCwKLMGXdUdSRFRBWsk2tLvlB1p3 PsgaVn777bkTwioTGRfX/8ec3Me4FRbSHpWgyJ0oXpC+trlPqvZTGjA2mn9M+uuAcT6m kscWJ8MW2tLNxD1odlVxLE0MUozIyLfs4nPkQQtfZo1h371EXt9fsB5tkfVDAAT4/eWg dzdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P+1pGGUo; 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 o184si4096770pgo.591.2019.01.15.14.13.15; Tue, 15 Jan 2019 14:13:35 -0800 (PST) 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=@kernel.org header.s=default header.b=P+1pGGUo; 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 S1731324AbfAOQxQ (ORCPT + 99 others); Tue, 15 Jan 2019 11:53:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:33312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730681AbfAOQnq (ORCPT ); Tue, 15 Jan 2019 11:43:46 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70E642054F; Tue, 15 Jan 2019 16:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547570625; bh=RrA0arMF/Nz22sS6k0+LWbGPU/NOg5lL39yaPkHh5NM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P+1pGGUoaxTzk/2WPwo7cTxpQY7p+bmnk9MVooePWZlQsnrNHUsoBVi/eia0023Ya luxSbVOsyTRZw2muYSOhfnT0lmFTG3XKgJGBH+olnu7kFwMBPlIBia9ZFxD/b/g0OE n8H9ag0o2kudug3cBA86tPrMaRp8xcn3ZzSzuFP0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Shilovsky , Steve French Subject: [PATCH 4.20 13/57] CIFS: Do not set credits to 1 if the server didnt grant anything Date: Tue, 15 Jan 2019 17:35:54 +0100 Message-Id: <20190115154911.473305262@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115154910.734892368@linuxfoundation.org> References: <20190115154910.734892368@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pavel Shilovsky commit 33fa5c8b8a7dbe6353a56eaa654b790348890d42 upstream. Currently we reset the number of total credits granted by the server to 1 if the server didn't grant us anything int the response. This violates the SMB3 protocol - we need to trust the server and use the credit values from the response. Fix this by removing the corresponding code. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French CC: Stable Signed-off-by: Greg Kroah-Hartman --- fs/cifs/transport.c | 2 -- 1 file changed, 2 deletions(-) --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -892,8 +892,6 @@ compound_send_recv(const unsigned int xi for (i = 0; i < num_rqst; i++) if (midQ[i]->resp_buf) credits += ses->server->ops->get_credits(midQ[i]); - if (!credits) - credits = 1; for (i = 0; i < num_rqst; i++) { if (rc < 0)