cifs: fix race in assemble_neg_contexts()
authorPaulo Alcantara <pc@cjr.nz>
Thu, 29 Dec 2022 15:33:56 +0000 (12:33 -0300)
committerSteve French <stfrench@microsoft.com>
Wed, 4 Jan 2023 06:11:17 +0000 (00:11 -0600)
commit775e44d6d86dca400d614cbda5dab4def4951fe7
tree64db3c9c8fb08014aaf74c1e253037df635f2dfe
parent9e6002c8738a9d5675ba706fcdbc0a544f814974
cifs: fix race in assemble_neg_contexts()

Serialise access of TCP_Server_Info::hostname in
assemble_neg_contexts() by holding the server's mutex otherwise it
might end up accessing an already-freed hostname pointer from
cifs_reconnect() or cifs_resolve_server().

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c