Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] CIFS: handle guest access errors to Windows shares
@ 2016-11-29 11:36 Mark Syms
       [not found] ` <20161129113646.13360-2-mark.syms-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Syms @ 2016-11-29 11:36 UTC (permalink / raw)
  To: sfrench-eUNUBHrolfbYtjvyW6yDsg, linux-cifs-u79uwXL29TY76Z2rM5mHXA
  Cc: mark.syms-Sxgqhf6Nn4DQT0dZR+AlfA

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-04-11  4:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29 11:36 [PATCH] CIFS: handle guest access errors to Windows shares Mark Syms
     [not found] ` <20161129113646.13360-2-mark.syms-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>
2016-11-29 15:43   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox