Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3296749pxk; Mon, 21 Sep 2020 09:58:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPQLeTNfG9TADYfMZVR3DJRQEQ645uWyRbVsjkLLoKRiZnFtL0ajO12zsRUAR+vKaD0I22 X-Received: by 2002:a17:906:9604:: with SMTP id s4mr426264ejx.182.1600707526064; Mon, 21 Sep 2020 09:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707526; cv=none; d=google.com; s=arc-20160816; b=IXctyTWJv+zMjVxLYibUeOQ3anlJhIEDOzQrcCmANrSmxH1qlpnGBcFoVQ8/atq3an A3b+Aapa1876bXJKmQFGcSbLPIh7zRKrCOyTRpGPfOal3p0NhHEq1kMw7lwl0v9I10jC IvXPOZ9PKg6H80peyP/IhcqshTLWfB8cssoGnjxzccFSzUVRKMHqsiLlrudoVV5jkE72 GHyqf6rYO1bBu6I6k3dVr8VD51+cSOfwH7PsaR3I8iCMW+iu4PZ1zXBkIXrtcHNKy/sL 0b0lDenmqwAJViiwu/PfIjBLJbdcrw22pegmcgYUe8ebr1eu/iXoMs5NnrsuvZRDnJ8b PsZA== 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=6EwgEw/aTq+/HuSKTj1pyzQ0K5GYn8O7fWXIu2Ybr/k=; b=pv3ugy5MJ/IO6VpK2qyrGMY5zuVppGKalweyut1Te2S+I6WT7iyqP0JhOk5OYsltl2 1MxOhndgK3eYmyP968Yb/0cFOO1LyvCj+r+AH93dGA2QhJsuRNL/aniAaGV6yvt/Gkt7 JD6hD3MhDXgsWQq5/S+ezJ1G4r52GZ6VdsdMCfpJw8M7Qr38UiiePZ0tt/Tx4wBEWYe2 PzWfEpZYu2r/rS0JOv4vXqWNTFjY+7CFank+8rdFa3McADk0gqA8PRWZthJ8eW2KfuPT 8j8pcp82reMlUjmxltfSCJhvkTjJzjlxp1Vel9LAFInMzXtEJ8QD6oFw5ARyj1vCR3Gl 1YAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="mz/4YL1E"; 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=fail (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 dg23si9027354edb.229.2020.09.21.09.58.21; Mon, 21 Sep 2020 09:58:46 -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=@kernel.org header.s=default header.b="mz/4YL1E"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730185AbgIUQ5B (ORCPT + 99 others); Mon, 21 Sep 2020 12:57:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:49882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729444AbgIUQob (ORCPT ); Mon, 21 Sep 2020 12:44:31 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A149D238E6; Mon, 21 Sep 2020 16:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706658; bh=G4k/FEqhQSblg+6kOPLkOd3CjvibLyPyJmZrlc2TBR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mz/4YL1E7vtjwQPFvTJM/CbTRJU0kviUN4ajQDaI4Bn7b+Epohp68zg3njpjXPL86 kTN7157Xp55jiE+FWOLh5O7IUUsWCWhAehW6XCu+VeTLZuFRFLdk0aOpMsEEFd+tVv VFRsA/yC5wsb/BWCgwCV51y5sayrasKHTnRA/8lg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , "Paulo Alcantara (SUSE)" , Steve French , Sasha Levin Subject: [PATCH 5.8 024/118] cifs: fix DFS mount with cifsacl/modefromsid Date: Mon, 21 Sep 2020 18:27:16 +0200 Message-Id: <20200921162037.431371116@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@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: Ronnie Sahlberg [ Upstream commit 01ec372cef1e5afa4ab843bbaf88a6fcb64dc14c ] RHBZ: 1871246 If during cifs_lookup()/get_inode_info() we encounter a DFS link and we use the cifsacl or modefromsid mount options we must suppress any -EREMOTE errors that triggers or else we will not be able to follow the DFS link and automount the target. This fixes an issue with modefromsid/cifsacl where these mountoptions would break DFS and we would no longer be able to access the share. Signed-off-by: Ronnie Sahlberg Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ce95801e9b664..7708175062eba 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1017,6 +1017,8 @@ handle_mnt_opt: if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID) { rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, true, full_path, fid); + if (rc == -EREMOTE) + rc = 0; if (rc) { cifs_dbg(FYI, "%s: Get mode from SID failed. rc=%d\n", __func__, rc); @@ -1025,6 +1027,8 @@ handle_mnt_opt: } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, false, full_path, fid); + if (rc == -EREMOTE) + rc = 0; if (rc) { cifs_dbg(FYI, "%s: Getting ACL failed with error: %d\n", __func__, rc); -- 2.25.1