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: 986545 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KLU3uEX1"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42bwWZ3cYYz9sD9 for ; Fri, 19 Oct 2018 17:10:34 +1100 (AEDT) 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 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