• Shu Wang's avatar
    cifs: release auth_key.response for reconnect. · f5c4ba81
    Shu Wang authored
    There is a race that cause cifs reconnect in cifs_mount,
    - cifs_mount
      - cifs_get_tcp_session
        - [ start thread cifs_demultiplex_thread
          - cifs_read_from_socket: -ECONNABORTED
            - DELAY_WORK smb2_reconnect_server ]
      - cifs_setup_session
      - [ smb2_reconnect_server ]
    
    auth_key.response was allocated in cifs_setup_session, and
    will release when the session destoried. So when session re-
    connect, auth_key.response should be check and released.
    
    Tested with my system:
    CIFS VFS: Free previous auth_key.response = ffff8800320bbf80
    
    A simple auth_key.response allocation call trace:
    - cifs_setup_session
    - SMB2_sess_setup
    - SMB2_sess_auth_rawntlmssp_authenticate
    - build_ntlmssp_auth_blob
    - setup_ntlmv2_rsp
    Signed-off-by: default avatarShu Wang <shuwang@redhat.com>
    Signed-off-by: default avatarSteve French <smfrench@gmail.com>
    CC: Stable <stable@vger.kernel.org>
    Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
    f5c4ba81
connect.c 114 KB