diff mbox

[maverick,natty/ti-omap4,CVE,1/1] cifs: add fallback in is_path_accessible for old servers

Message ID 1317740391-16788-4-git-send-email-apw@canonical.com
State New
Headers show

Commit Message

Andy Whitcroft Oct. 4, 2011, 2:59 p.m. UTC
From: Jeff Layton <jlayton@redhat.com>

The is_path_accessible check uses a QPathInfo call, which isn't
supported by ancient win9x era servers. Fall back to an older
SMBQueryInfo call if it fails with the magic error codes.

Cc: stable@kernel.org
Reported-and-Tested-by: Sandro Bonazzola <sandro.bonazzola@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>

(cherry picked from commit 221d1d797202984cb874e3ed9f1388593d34ee22)
CVE-2011-3363
BugLink: http://bugs.launchpad.net/bugs/866034
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 fs/cifs/connect.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 50d60cc..aa92c97 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2422,6 +2422,11 @@  is_path_accessible(int xid, struct cifsTconInfo *tcon,
 			      0 /* not legacy */, cifs_sb->local_nls,
 			      cifs_sb->mnt_cifs_flags &
 				CIFS_MOUNT_MAP_SPECIAL_CHR);
+
+	if (rc == -EOPNOTSUPP || rc == -EINVAL)
+		rc = SMBQueryInformation(xid, tcon, full_path, pfile_info,
+				cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
+				  CIFS_MOUNT_MAP_SPECIAL_CHR);
 	kfree(pfile_info);
 	return rc;
 }