Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp732414imm; Thu, 13 Sep 2018 06:59:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYAbEkUJ+jl1gRRTVcYWsRYQ/5bBLe873uos9gpRaxFA0YgkBIO97zd0N3VcJ3fI6bCGfxW X-Received: by 2002:a63:550b:: with SMTP id j11-v6mr4917374pgb.167.1536847195652; Thu, 13 Sep 2018 06:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847195; cv=none; d=google.com; s=arc-20160816; b=WHLhXe8UhdfOy17YsPF0K1zsdbXdFqdUYBNBjASMRWSjwZhNSrg0heF62+rG/huaPe Zsuw6+7PMIRITj7k8Ev9VBkC2bzSwg6JQd7Jhty1b/NnxvGSV2idSQl+ZETB6ykgBIdy dDmaN281paFhkrFgBDZGY0t80a1wgYrwAQiLe5Bp6iJBM8R/sLlhYVWqIMDSHP9Moy7b kVxwjdy9hVM/KVbGUyhHTS8pb3ykMmzPW3NXR12lTN2M+HHVwsXd3rnE4pd4zhy+RAt6 blQVjj956LPdmtwtFkDNSPky/gOc1kbOqxFTh86o+ZoIdAxY82CnNIR6AZB0/iCS/NP9 3hpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=e/5Hpsk8vlzt8gRY18w5Df+KzQrjo2/FHknZmoXsBv4=; b=tGssMvxZiFOk3Z3g7o+uwxLV+lnChLokhHSbYSPpjtaKK13E6QHdDwJF4o3Q4ODW6m vi52lCpsrM1w9Dsrkh3PDQaomysRJgsxJWVWAjC2Siq7m7XgF+G5nR00dDB9Z3VicMyQ E2snOnHp0rbn1K99MO/MB6UnfCZScy6cYj5cajSS4vSwSEqSm/cyaB35xgyy6Dl+x5VF Xp5HkyLijNjBAjUHJKCUS4hVIlP/3HOIiTzedZH1R5oiW1X8J8UXsMvfIJLI6Pjs89KV PIzH58qbNjKWVZjkqKjMFzi9Hab7Y88VkNIDzeTO9pquzJKoPJ+fn+uX5eHWV6Rw2Gzf LsGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si3972739pgk.600.2018.09.13.06.59.39; Thu, 13 Sep 2018 06:59:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731556AbeIMTJM (ORCPT + 99 others); Thu, 13 Sep 2018 15:09:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34820 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731116AbeIMTJL (ORCPT ); Thu, 13 Sep 2018 15:09:11 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BF8B4D0E; Thu, 13 Sep 2018 13:59:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve French , Aurelien Aptel , Sasha Levin Subject: [PATCH 4.18 123/197] smb3: if server does not support posix do not allow posix mount option Date: Thu, 13 Sep 2018 15:31:12 +0200 Message-Id: <20180913131846.465029010@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steve French [ Upstream commit 8505c8bfd85a260c9dc5c47e15bd8c5357fcbcd2 ] If user specifies "posix" on an SMB3.11 mount, then fail the mount if server does not return the POSIX negotiate context indicating support for posix. Signed-off-by: Steve French Reviewed-by: Aurelien Aptel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/cifs/connect.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3031,11 +3031,15 @@ cifs_get_tcon(struct cifs_ses *ses, stru } #ifdef CONFIG_CIFS_SMB311 - if ((volume_info->linux_ext) && (ses->server->posix_ext_supported)) { - if (ses->server->vals->protocol_id == SMB311_PROT_ID) { + if (volume_info->linux_ext) { + if (ses->server->posix_ext_supported) { tcon->posix_extensions = true; printk_once(KERN_WARNING "SMB3.11 POSIX Extensions are experimental\n"); + } else { + cifs_dbg(VFS, "Server does not support mounting with posix SMB3.11 extensions.\n"); + rc = -EOPNOTSUPP; + goto out_fail; } } #endif /* 311 */