From patchwork Tue Oct 25 16:12:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [lucid/fsl-imx51,CVE,3/3] cifs: check for NULL session password Date: Tue, 25 Oct 2011 06:12:25 -0000 From: Andy Whitcroft X-Patchwork-Id: 121734 Message-Id: <1319559148-30401-5-git-send-email-apw@canonical.com> To: kernel-team@lists.ubuntu.com Cc: Andy Whitcroft From: Jeff Layton It's possible for a cifsSesInfo struct to have a NULL password, so we need to check for that prior to running strncmp on it. Signed-off-by: Jeff Layton Signed-off-by: Steve French (cherry picked from commit 24e6cf92fde1f140d8eb0bf7cd24c2c78149b6b2) CVE-2011-1585 BugLink: http://bugs.launchpad.net/bugs/869208 Signed-off-by: Andy Whitcroft --- fs/cifs/connect.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index bbf1c25..fd70eed 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1583,6 +1583,7 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol) MAX_USERNAME_SIZE)) continue; if (strlen(vol->username) != 0 && + ses->password != NULL && strncmp(ses->password, vol->password ? vol->password : "", MAX_PASSWORD_SIZE))