From: Jeff Layton Date: Fri, 9 Nov 2007 23:25:04 +0000 (+0000) Subject: [CIFS] fix oops on second mount to same server when null auth is used X-Git-Tag: v2.6.24-rc3~156^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9b8f5f573770f33b28c45255ac82e6457278c782;p=linux-2.6-omap-h63xx.git [CIFS] fix oops on second mount to same server when null auth is used When a share is mounted using no username, cifs_mount sets volume_info.username as a NULL pointer, and the sesInfo userName as an empty string. The volume_info.username is passed to a couple of other functions to see if there is an existing unc or tcp connection that can be used. These functions assume that the username will be a valid string that can be passed to strncmp. If the pointer is NULL, then the kernel will oops if there's an existing session to which the string can be compared. This patch changes cifs_mount to set volume_info.username to an empty string in this situation, which prevents the oops and should make it so that the comparison to other null auth sessions match. Signed-off-by: Jeff Layton Signed-off-by: Steve French --- diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 53629b8bc8a..64dd22239b2 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES @@ -1,5 +1,6 @@ Version 1.52 ------------ +Fix oops on second mount to server when null auth is used. Version 1.51 ------------ diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 380ee9991f2..1102160f666 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1790,7 +1790,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, if (volume_info.nullauth) { cFYI(1, ("null user")); - volume_info.username = NULL; + volume_info.username = ""; } else if (volume_info.username) { /* BB fixme parse for domain name here */ cFYI(1, ("Username: %s", volume_info.username));