From patchwork Tue Oct 4 14:59:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [maverick, natty/ti-omap4, CVE, 1/1] cifs: add fallback in is_path_accessible for old servers Date: Tue, 04 Oct 2011 04:59:51 -0000 From: Andy Whitcroft X-Patchwork-Id: 117643 Message-Id: <1317740391-16788-4-git-send-email-apw@canonical.com> To: kernel-team@lists.ubuntu.com Cc: Andy Whitcroft From: Jeff Layton 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 Signed-off-by: Jeff Layton Signed-off-by: Steve French (cherry picked from commit 221d1d797202984cb874e3ed9f1388593d34ee22) CVE-2011-3363 BugLink: http://bugs.launchpad.net/bugs/866034 Signed-off-by: Andy Whitcroft --- 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; }