• Jeff Layton's avatar
    cifs: correctly handle NULL tcon pointer in CIFSTCon · 8d1bca32
    Jeff Layton authored
    Long ago (in commit 00e485b0), 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 c1508ca2 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: default avatarMartijn Uffing <mp3project@sarijopen.student.utwente.nl>
    Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
    Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
    8d1bca32
connect.c 103 KB