]> 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)
commit7cd7dca6d54181a7b8789ed839f1e06a081b550e
treefbdae0142d8aa39da8bb3e0a136688178a764385
parenta10a587e61e70b9b852947dc4b757e55f83e5c97
cifs: fix race in assemble_neg_contexts()

[ Upstream commit da8d2a3e939bd0912e206d8f564f8156a3035497 ]

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