]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix race condition with delayed threads
authorShyam Prasad N <sprasad@microsoft.com>
Tue, 5 Jul 2022 11:16:24 +0000 (11:16 +0000)
committerSteve French <stfrench@microsoft.com>
Tue, 12 Jul 2022 15:35:13 +0000 (10:35 -0500)
commite6589ede4da221682151b8b6078ad2795b5b492d
tree6aa819f3e067c1e9fa5b0d59ac91472f9785acf3
parent0c8b98e40f9d61a6792a879de085b19667a1f51b
cifs: fix race condition with delayed threads

On failure to create a new channel, first cancel the
delayed threads, which could try to search for this
channel, and not find it.

The other option was to put the tcp session for the
channel first, before decrementing chan_count. But
that would leave a reference to the tcp session, when
it has been freed already.

So going with the former option and cancelling the
delayed works first, before rolling back the channel.

Fixes: 31374b92d94a ("cifs: change iface_list from array to sorted linked list")
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Acked-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/sess.c