• Ronnie Sahlberg's avatar
    cifs: fix kref underflow in close_shroot() · 2f94a312
    Ronnie Sahlberg authored
    Fix a bug where we used to not initialize the cached fid structure at all
    in open_shroot() if the open was successful but we did not get a lease.
    This would leave the structure uninitialized and later when we close the handle
    we would in close_shroot() try to kref_put() an uninitialized refcount.
    
    Fix this by always initializing this structure if the open was successful
    but only do the extra get() if we got a lease.
    This extra get() is only used to hold the structure until we get a lease
    break from the server at which point we will kref_put() it during lease
    processing.
    Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    CC: Stable <stable@vger.kernel.org>
    2f94a312
smb2ops.c 124 KB