]> git.baikalelectronics.ru Git - kernel.git/commit
CIFS: Fix a possible memory corruption during reconnect
authorPavel Shilovsky <pshilov@microsoft.com>
Fri, 4 Nov 2016 18:50:31 +0000 (11:50 -0700)
committerPavel Shilovsky <pshilov@microsoft.com>
Mon, 5 Dec 2016 20:08:33 +0000 (12:08 -0800)
commit1a2b81f05dad0a7fa45d8f77d67c948d9f95d5a5
tree46d7d80876843d554ffc9ca45ef74a2ba0233dc7
parent7e5931c16173c28bd06964840e1b6ddb8ab9f042
CIFS: Fix a possible memory corruption during reconnect

We can not unlock/lock cifs_tcp_ses_lock while walking through ses
and tcon lists because it can corrupt list iterator pointers and
a tcon structure can be released if we don't hold an extra reference.
Fix it by moving a reconnect process to a separate delayed work
and acquiring a reference to every tcon that needs to be reconnected.
Also do not send an echo request on newly established connections.

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/cifsproto.h
fs/cifs/connect.c
fs/cifs/smb2pdu.c
fs/cifs/smb2proto.h