]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <alexander.levin@verizon.com>
Fri, 13 Jan 2017 01:56:55 +0000 (20:56 -0500)
commit15a12fbbf365a483b1c19f9caeb707b3bea77e10
tree8f81a4fc64d24a72a038c3686a97f33f8d02f14c
parent51fce08b64ec4d8cb2cc91eb08a84caf29dcd272
CIFS: Fix a possible memory corruption during reconnect

[ Upstream commit 53e0e11efe9289535b060a51d4cf37c25e0d0f2b ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
fs/cifs/cifsglob.h
fs/cifs/cifsproto.h
fs/cifs/connect.c
fs/cifs/smb2pdu.c
fs/cifs/smb2proto.h