Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2503519pxj; Mon, 10 May 2021 04:42:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkcQS8f9eSQycX+F0HazRSx+eCdfCobIVv+U5MCLW96STh2nDXlCPi4Jh+gz9wl+Q75ZyB X-Received: by 2002:a17:906:17cc:: with SMTP id u12mr25024017eje.170.1620646937880; Mon, 10 May 2021 04:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620646937; cv=none; d=google.com; s=arc-20160816; b=BAzIL6g3JlATGrwspcOnK7HLDOO99cJ8EHwxLSTEydGfWdsEm2Rs47uywAseLkthzM jdA0h0WwMWRFHhrPOmGoS24GmVE9G9xy6rdYSNa5nrGV7ZH2YHIU+2Fa+4bLMvor8r6h 63BFy5+KqW7xB7D/QsMI/6S0pIxXl/9Tj2zRLvgSAGvZ3O31EPGYS6u9R71R1AgdZMMy /fJ2Hih4R7dPWk3XosSCdxRfBrMOo6dydg9N7krzYGfbH/b3/WrhijxEMkTW7Zg0aBQ/ pHFYTPvCK3BQ6CFwqNk0EMfo3Vwpf7SroYQrHqm1WRFKMx0EktiP+iKUPsvRCBV5ui+c CxLg== 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=jVE9J1MVol2D595FBeqWYuq5PyOvjBZaPwvFi7084IKuNvqVmqBCFYAfPaqWp0/D6I VHp8OAPnFhi1g5AbskglBm7fLLJJfJRZej6CwdzcKDyarptybAOQ3hAbT7V/o3JKzXKr UXW+65d3grLOpjUw9RnyUrAXvrbChfbUkC3GXCwA2+jQYiblUqPpNuAbO/H47lEoz4Fk aHXe/a8W0ILqbpYHZhp/803l7TJp8GT7bWgh11zHiM6RKmSeWsIlgkgjqjAl9tnPPI/k rCH3XRoKUBuRFLfsxFcz2H3xP+VyQ9P7W9a8U3qi+CMOT2PoS1xtsF4r1ho+tVOVOwih +FZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XGKALcU4; 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 z15si13180767edc.219.2021.05.10.04.41.54; Mon, 10 May 2021 04:42:17 -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=XGKALcU4; 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 S240919AbhEJLhH (ORCPT + 99 others); Mon, 10 May 2021 07:37:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:41652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232382AbhEJKxt (ORCPT ); Mon, 10 May 2021 06:53:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F0F526162B; Mon, 10 May 2021 10:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643297; bh=LrpWikjAJmVDEgKRQhs4/S4vGblFHh9JVcW3zUzIXvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XGKALcU4Tv/jDmkCXXbV8wJn2rhyF/oX54sXwTY2AF58EqYivaI39MjP8SdiintKz BQhOnI0ZCeBFlbNexpLTBWwkA8cG0NBwvENagpvu9XJM0IZPVAWkrld/9xUKL0e7GZ Kb6cSS46d0FEudFp5ZVpKLAXc75E85CXnl7yTod4= 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.10 258/299] smb3: when mounting with multichannel include it in requested capabilities Date: Mon, 10 May 2021 12:20:55 +0200 Message-Id: <20210510102013.470319072@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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);