From patchwork Fri Oct 19 06:10:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10648691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 825C6181D for ; Fri, 19 Oct 2018 06:10:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DAD0289D2 for ; Fri, 19 Oct 2018 06:10:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61DCE289DD; Fri, 19 Oct 2018 06:10:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7499289D2 for ; Fri, 19 Oct 2018 06:10:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726465AbeJSOPI (ORCPT ); Fri, 19 Oct 2018 10:15:08 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41140 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbeJSOPI (ORCPT ); Fri, 19 Oct 2018 10:15:08 -0400 Received: by mail-pg1-f194.google.com with SMTP id 23-v6so15302370pgc.8 for ; Thu, 18 Oct 2018 23:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=IPxEgwcqlymwwVti5clUkm42CPgk2nmXBUBU3JOmdOE=; b=KLU3uEX10VOGFQ6s/yPVaFF/PLPMV82tx/NUCxcBGU0RZWL34cgNboubFIWzCNp/P5 GyP8LdBEMmIvlDTszG873Nhu4iFP6HXQVRDybFw2qFXOejhHVe3xnt2oRZmMP6TFKxlc VZ4hNewImGgHu2M5Xjx+w5zRns2jTaZEGOaPxB/psCMc8yKaZdeNd9rS43FmJuYK23G5 djk0hkz57AOWZxwRMAX+/fFkpDupOUbZslgNviIgNieiJNI4DFzKAIzYh0xPHGs7ZXvm 6VKd8w1W27MLYvpv4yC7aORKFfLOIipUjJsHbDDP/a2Y2IYxOeMTw++zOcMMV1E692io 3ynA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IPxEgwcqlymwwVti5clUkm42CPgk2nmXBUBU3JOmdOE=; b=FLdRvr6BEhnlTiZ2jj1ghH2cwWa0MZfJfoewBPaMsMYgQ661N0autFy6u6DLBBfh88 u9wc9UoiEGsD8JkMZoGlqjAXnkPhK99Q4Qv3G+/+3ZzNN6E8QLWjwyBsEbG8MnvloiJ1 V3tfx4t+0g1gEDN8JzlCJltkni83XDbD/hz+VHWvlJN6WSXEtCSq4Klp5ABIXZv+Im9F 28CgppYrMopVKQ+/fnUpWYwnOJiAvbtQhtjNMs8RAIQcEAoDy5j6zPmCClhd3Y/vFQBK f0udyNANrs+XyWryoaSmFAHM0A/qVSBqmVnYk2uIerHN9Co3NfJSbqH8EctS2NlyK1UI +SDA== X-Gm-Message-State: ABuFfoiRZG92NRoAaS4gjPW2O4CfSGhc8EZYNxvDL1y8uy4PAHkOH7uu sgwJ5bhpLeWqNkm+ZHNC6N8IlPD3NBwcigGSbYePT/24 X-Google-Smtp-Source: ACcGV62FOl3bUNrL59jjps9RviR7XuNI0j/1ju1ipw+3i7vfl0XzgkOUpJp/UD69ku/mUBgm14Y2bg/adsjHSM1/EcM= X-Received: by 2002:a62:444f:: with SMTP id r76-v6mr34248190pfa.111.1539929431766; Thu, 18 Oct 2018 23:10:31 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Fri, 19 Oct 2018 01:10:19 -0500 Message-ID: Subject: [SMB3][PATCH] smb3: do not attempt cifs operation in smb3 query info error path To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If backupuid mount option is sent, we can incorrectly retry (on access denied on query info) with a cifs (FindFirst) operation on an smb3 mount which causes the server to force the session close. We set backup intent on open so no need for this fallback. See kernel bugzilla 201435 Signed-off-by: Steve French CC: Stable Reviewed-by: Ronnie Sahlberg --- fs/cifs/inode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) if (srchinf == NULL) { From 1fcb99e4c257f315de3c6805e6b75af4c044ddc8 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 19 Oct 2018 00:45:21 -0500 Subject: [PATCH] smb3: do not attempt cifs operation in smb3 query info error path If backupuid mount option is sent, we can incorrectly retry (on access denied on query info) with a cifs (FindFirst) operation on an smb3 mount which causes the server to force the session close. We set backup intent on open so no need for this fallback. See kernel bugzilla 201435 Signed-off-by: Steve French CC: Stable --- fs/cifs/inode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 0945d40030eb..7483c09317b9 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -781,7 +781,15 @@ cifs_get_inode_info(struct inode **inode, const char *full_path, } else if (rc == -EREMOTE) { cifs_create_dfs_fattr(&fattr, sb); rc = 0; - } else if (rc == -EACCES && backup_cred(cifs_sb)) { + } else if ((rc == -EACCES) && backup_cred(cifs_sb) && + (strcmp(server->vals->version_string, SMB1_VERSION_STRING) + == 0)) { + /* + * For SMB2 and later the backup intent flag is already + * sent if needed on open and there is no path based + * FindFirst operation to use to retry with + */ + srchinf = kzalloc(sizeof(struct cifs_search_info), GFP_KERNEL); if (srchinf == NULL) { -- 2.17.1