]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
cifs: release auth_key.response for reconnect.
authorShu Wang <shuwang@redhat.com>
Fri, 8 Sep 2017 10:48:33 +0000 (18:48 +0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 5 Oct 2017 17:56:28 +0000 (14:56 -0300)
commit24a1e3740283664c5c33cb530984024d12ed965e
tree0cbb88f34121353f0a5c0c1917485edf2a1c61ff
parent763caeb2b8d131f15ff97008476ffa97bdc32271
cifs: release auth_key.response for reconnect.

BugLink: http://bugs.launchpad.net/bugs/1721550
commit f5c4ba816315d3b813af16f5571f86c8d4e897bd upstream.

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: Shu Wang <shuwang@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/cifs/connect.c