Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Mark Syms <mark.syms-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
To: <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
	<linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: <mark.syms-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] CIFS: handle guest access errors to Windows shares
Date: Tue, 29 Nov 2016 11:36:46 +0000	[thread overview]
Message-ID: <20161129113646.13360-2-mark.syms@citrix.com> (raw)

Commit 1a967d6c9b39c226be1b45f13acd4d8a5ab3dc44 ("correctly to
anonymous authentication for the NTLM(v2) authentication") introduces
a regression in handling errors related to attempting a guest
connection to a Windows share which requires authentication. This
should result in a permission denied error but actually causes the
kernel module to enter a never-ending loop trying to follow a DFS
referal which doesn't exist.

The base cause of this is the failure now occurs later in the process
during tree connect and not at the session setup setup and all errors
in tree connect are interpreted as needing to follow the DFS paths
which isn't in this case correct. So, check the returned error against
EACCES and fail if this is returned error.
---
 fs/cifs/connect.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 4547aed..a1737aa 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3651,6 +3651,9 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
 	if (IS_ERR(tcon)) {
 		rc = PTR_ERR(tcon);
 		tcon = NULL;
+		if (rc == -EACCES) {
+			goto mount_fail_check;
+		}
 		goto remote_path_check;
 	}
 
-- 
2.10.2

             reply	other threads:[~2016-11-29 11:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 11:36 Mark Syms [this message]
     [not found] ` <20161129113646.13360-2-mark.syms-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
2016-11-29 15:43   ` [PATCH] CIFS: handle guest access errors to Windows shares Aurélien Aptel
     [not found]     ` <mpszikis34d.fsf-IBi9RG/b67k@public.gmane.org>
2016-11-29 17:40       ` Germano Percossi
2016-11-29 20:02       ` Mark Syms
     [not found]         ` <0d4b27917f3e4a90a19342a7e27b5d9f-ZIyKOb66IhyzM76k4uAzvRgL0UkB//ZR@public.gmane.org>
2016-11-30 17:32           ` Aurélien Aptel
     [not found]             ` <mpswpfkswko.fsf-IBi9RG/b67k@public.gmane.org>
2016-12-02 16:25               ` Mark Syms
     [not found]                 ` <856abc11c5864627bfcdea9ce0933465-ZIyKOb66IhyzM76k4uAzvRgL0UkB//ZR@public.gmane.org>
2016-12-02 16:42                   ` Steve French
     [not found]                     ` <CAH2r5msRXHseV9A9o=RwDL69v5smXoQZWo_WeT1PEtudzpYiLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-02 16:44                       ` Mark Syms
2016-12-02 17:26                     ` Mark Syms
2017-04-11  4:27               ` Steve French
2017-04-10 17:57   ` Pavel Shilovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161129113646.13360-2-mark.syms@citrix.com \
    --to=mark.syms-sxgqhf6nn4dqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox