Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2537166pxj; Mon, 10 May 2021 05:26:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7sZAFMcOdiAp/ToJ8cQSa9fDpvffEUzQcSTmpZcXihBaKCl50P0U2GMRI1RDIIyixd+HE X-Received: by 2002:a17:906:5584:: with SMTP id y4mr25250752ejp.120.1620649594904; Mon, 10 May 2021 05:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620649594; cv=none; d=google.com; s=arc-20160816; b=HtCdUQbswlTwGPB4xRi4A+R/d2pDFuW8e4iBzH3qRDSQtWR4g8NgRRS5jUvqsa9L73 S2Tb3xE7bXfdYvctFVH8DvPGT4O8hX0DqW6Zui1vN7RvcWD6czFjHJ2OfMckFHoXz5U0 PiYLB/Ua+shmmuz8lAboM74bGYtFremfjPaZXeVvsZqFN6cyW59H5mTte45IlYkQFRCv VVlYWkRSbXf7N83vAm5SlLpR9GyVjea8UTQInPJw4vyymZLKbre2S62lJL4aDCiYrQt3 ihnPB8C7tIrtcedjfLDXEeYGrPeI3ZG4nylcGAVBLKVuLCMWaIxwW6LBnu8BxcGMKPrZ EQZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iIA7jwCTeS2vPfgm4zP8/kGQqKtPAbo1uWKcHGVmcwo=; b=1FKZbvWoSl/MRRvgeG2+ZRklyP0rRPbLMy7vDigpRRVPW/1NMiki/KGs3S91GF47RK V/juuU+VgiV/4Zj14FFYVrDSOOzvKFzCvYX0HNv+6UfPtid+/0V2n0HNwmSj4iC9BgFS r2eqEDiJDilL+3gtqW2mDpMJjkL35KgzvgFePE6VNP0GuOvm3MIHH57/1znkxT4EIrBw gO9HANQZURsDrgJBhY58EdVrMYTUVFHMbuoZxkYAJTwH1yafSsByrkbTV8FMnkbeAzJr LpbCQQSqJi2cFs6OCnHB07NSWZKmNDdDTUbzr/rmoP3swhT72QIBUwc61wyJDnPQnI0K uTOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GolDhtVW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si12967662eds.430.2021.05.10.05.26.10; Mon, 10 May 2021 05:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GolDhtVW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344114AbhEJMPG (ORCPT + 99 others); Mon, 10 May 2021 08:15:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:36544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234990AbhEJLFf (ORCPT ); Mon, 10 May 2021 07:05:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F2C661139; Mon, 10 May 2021 10:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644119; bh=LrpWikjAJmVDEgKRQhs4/S4vGblFHh9JVcW3zUzIXvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GolDhtVW0uDwIC8ymIPrXk5Ymlhgi7gq3uECJSRaYQG34lqsctOIAVGovgpceOCk6 ngxKzA77ie7nls2gNZHnMb5JkkZt+D/hmRO2Oow7fiFi+7VIpGIz6r7hRmkVJU4eo+ k9XlGSjvjiXATph7qsflRVV/mGUd1cUvVgURIylw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Talpey , Shyam Prasad N , Steve French Subject: [PATCH 5.11 296/342] smb3: when mounting with multichannel include it in requested capabilities Date: Mon, 10 May 2021 12:21:26 +0200 Message-Id: <20210510102019.890985141@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102010.096403571@linuxfoundation.org> References: <20210510102010.096403571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steve French commit 679971e7213174efb56abc8fab1299d0a88db0e8 upstream. In the SMB3/SMB3.1.1 negotiate protocol request, we are supposed to advertise CAP_MULTICHANNEL capability when establishing multiple channels has been requested by the user doing the mount. See MS-SMB2 sections 2.2.3 and 3.2.5.2 Without setting it there is some risk that multichannel could fail if the server interpreted the field strictly. Reviewed-By: Tom Talpey Reviewed-by: Shyam Prasad N Cc: # v5.8+ Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2pdu.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -840,6 +840,8 @@ SMB2_negotiate(const unsigned int xid, s req->SecurityMode = 0; req->Capabilities = cpu_to_le32(server->vals->req_capabilities); + if (ses->chan_max > 1) + req->Capabilities |= cpu_to_le32(SMB2_GLOBAL_CAP_MULTI_CHANNEL); /* ClientGUID must be zero for SMB2.02 dialect */ if (server->vals->protocol_id == SMB20_PROT_ID) @@ -1025,6 +1027,9 @@ int smb3_validate_negotiate(const unsign pneg_inbuf->Capabilities = cpu_to_le32(server->vals->req_capabilities); + if (tcon->ses->chan_max > 1) + pneg_inbuf->Capabilities |= cpu_to_le32(SMB2_GLOBAL_CAP_MULTI_CHANNEL); + memcpy(pneg_inbuf->Guid, server->client_guid, SMB2_CLIENT_GUID_SIZE);