]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix race in assemble_neg_contexts()
authorPaulo Alcantara <pc@cjr.nz>
Thu, 29 Dec 2022 15:33:56 +0000 (12:33 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:24:32 +0000 (07:24 +0100)
commit146159e8a808f22bea20e8372a67a04e5aeaab76
treefbdae0142d8aa39da8bb3e0a136688178a764385
parenta20584b6cf6f3f20cba6548c65a27afa3aae3109
cifs: fix race in assemble_neg_contexts()

[ Upstream commit 775e44d6d86dca400d614cbda5dab4def4951fe7 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/smb2pdu.c