From patchwork Mon May 8 05:36:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 13234063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 405F1C77B75 for ; Mon, 8 May 2023 05:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbjEHFhK (ORCPT ); Mon, 8 May 2023 01:37:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbjEHFhI (ORCPT ); Mon, 8 May 2023 01:37:08 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593D6A271 for ; Sun, 7 May 2023 22:37:06 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2ac79d4858dso45298731fa.2 for ; Sun, 07 May 2023 22:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683524224; x=1686116224; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ZS7iBiT3MqEhcXXQkzzeQcnpCKE5TAS9/DMn1oh0VNM=; b=ePfzG1OBB13l5ChKS6bHvHTNvxWThXVKgykVTmIWtkn9NTXfkumAZ/TWeQwjFZHM1X HOL4G3Nk1hjY6K39Fq0rGZx9cWjc/6mOBZeLk+7wklVX5Fl3x7+54YO+os9RK4tFH5Rr FzW4st/Vtl8QHCSV/6N1oXt7ZeEu/NbuOGU6gGkNxidStottOV1YAfanZOUVwwdVXVE3 bznYfkMTq6dC/E313Zn/g9vcuIbq03ZqRThBmi0v0LHQiUW3y7S+ZZenf3WNSbp87E/1 XaCzjY/8Cui+bOhK43lUsBruCKCnsnabY44TYN87pe3BguPZ++py4A9KTH4noqz2UVFL zktw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683524224; x=1686116224; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZS7iBiT3MqEhcXXQkzzeQcnpCKE5TAS9/DMn1oh0VNM=; b=b/kEaT95PcaOpR6Qkcfn9/GJ7wHFVMg1t0UJTX7nKJSjgdUdEClaHeGevY6HNZ4gmO NqVpvjzjPO3Yuu+mBigIjy+yNYOgIdyuODR0NttK5wguyZVJa899Kzlz+kFRC/ZmEDgg Kbpg5uY1xuUagRVc15/72XjCC+1u56Spew50BvDhGPrfA1oujU5z0m8QcC5l72j20iwD fquEfvtdBmrazed1qU2CISPFuoUmm92Cvd/DnMeU0i3VNpNC3FirMq82yuLM4Et+l/Sc x9cUPFeAbCQ6P50GXjtWkGRdKAejrYNqWVYV6Oap7V6NXvk0CrXTaMJMIeXCyr1qEiy3 bxEQ== X-Gm-Message-State: AC+VfDy9XidRrE0eLOQG0k0jpxurLnTIB3g2iPDZr+rs7vZRuw2tzrM8 l37cMeoV8oC+CnPoJ56xGw74e2MUr82uNzHINSe6qx2wy3d6uw== X-Google-Smtp-Source: ACHHUZ4AbUTrDAhrw3HVUtrP9NNumAyAzWYCmsqkWoVEBS5WiP3TgTeOfH2JS4QC3ac6SKq2Z3DyAz6GCcnYj4IxVfQ= X-Received: by 2002:a2e:93c3:0:b0:2a8:a5b8:185a with SMTP id p3-20020a2e93c3000000b002a8a5b8185amr2426649ljh.10.1683524223921; Sun, 07 May 2023 22:37:03 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Mon, 8 May 2023 00:36:47 -0500 Message-ID: Subject: [PATCH][CIFS] do not reuse connection if share marked as isolated To: CIFS , samba-technical Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org "SHAREFLAG_ISOLATED_TRANSPORT" indicates that we should not reuse the socket for this share (for future mounts). Mark the socket as server->nosharesock if share flags returned include SHAREFLAG_ISOLATED_TRANSPORT. See MS-SMB2 MS-SMB2 2.2.10 and 3.2.5.5 See attached patch From 4365a391b1b5c0f2a065abafafe4abda9e96038a Mon Sep 17 00:00:00 2001 From: Steve French Date: Sun, 7 May 2023 17:57:17 -0500 Subject: [PATCH] [SMB3.1.1] do not reuse connection if share marked as isolated "SHAREFLAG_ISOLATED_TRANSPORT" indicates that we should not reuse the socket for this share (for future mounts). Mark the socket as server->nosharesock if share flags returned include SHAREFLAG_ISOLATED_TRANSPORT. See MS-SMB2 MS-SMB2 2.2.10 and 3.2.5.5 Signed-off-by: Steve French --- fs/cifs/smb2pdu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index e33ca0d33906..9ed61b6f9b21 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1947,6 +1947,9 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, init_copy_chunk_defaults(tcon); if (server->ops->validate_negotiate) rc = server->ops->validate_negotiate(xid, tcon); + if (rc == 0) /* See MS-SMB2 2.2.10 and 3.2.5.5 */ + if (tcon->share_flags & SMB2_SHAREFLAG_ISOLATED_TRANSPORT) + server->nosharesock = true; tcon_exit: free_rsp_buf(resp_buftype, rsp); -- 2.34.1