]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: correctly handle NULL tcon pointer in CIFSTCon
authorJeff Layton <jlayton@redhat.com>
Sun, 12 Jun 2011 01:17:10 +0000 (21:17 -0400)
committerSteve French <sfrench@us.ibm.com>
Mon, 13 Jun 2011 20:34:34 +0000 (20:34 +0000)
commitaaed035052704a97d0e08d5b327b7aa07c455c7c
tree734c3909bd750f8de39d04ee656eae6d31d2e24a
parentc48197f9ca43ffa050f60cbe422f8d3802aa3b8d
cifs: correctly handle NULL tcon pointer in CIFSTCon

Long ago (in commit 2903dd13), I added some code to handle share-level
passwords in CIFSTCon. That code ignored the fact that it's legit to
pass in a NULL tcon pointer when connecting to the IPC$ share on the
server.

This wasn't really a problem until recently as we only called CIFSTCon
this way when the server returned -EREMOTE. With the introduction of
commit 8cb56d5f however, it gets called this way on every mount, causing
an oops when share-level security is in effect.

Fix this by simply treating a NULL tcon pointer as if user-level
security were in effect. I'm not aware of any servers that protect the
IPC$ share with a specific password anyway. Also, add a comment to the
top of CIFSTCon to ensure that we don't make the same mistake again.

Cc: <stable@kernel.org>
Reported-by: Martijn Uffing <mp3project@sarijopen.student.utwente.nl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/connect.c