cifs: lock chan_lock outside match_session
authorShyam Prasad N <sprasad@microsoft.com>
Mon, 20 Feb 2023 13:02:11 +0000 (13:02 +0000)
committerSteve French <stfrench@microsoft.com>
Thu, 23 Mar 2023 04:15:40 +0000 (23:15 -0500)
commit2f4e429c846972c8405951a9ff7a82aceeca7461
tree1c7ce858d3bd5422746f717fc54be8c74dc69375
parent2f0e4f0342201fe2228fcc2301cc2b42ae04b8e3
cifs: lock chan_lock outside match_session

Coverity had rightly indicated a possible deadlock
due to chan_lock being done inside match_session.
All callers of match_* functions should pick up the
necessary locks and call them.

Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Cc: stable@vger.kernel.org
Fixes: 724244cdb382 ("cifs: protect session channel fields with chan_lock")
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c