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

Andy Whitcroft apw at canonical.com
Tue Oct 4 14:59:51 UTC 2011


From: Jeff Layton <jlayton at 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 at kernel.org
Reported-and-Tested-by: Sandro Bonazzola <sandro.bonazzola at gmail.com>
Signed-off-by: Jeff Layton <jlayton at redhat.com>
Signed-off-by: Steve French <sfrench at us.ibm.com>

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

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;
 }
-- 
1.7.4.1





More information about the kernel-team mailing list