]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
cifs: add spinlock for the openFileList to cifsInodeInfo
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 5 Jun 2019 00:38:38 +0000 (10:38 +1000)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commit15a4a1f30ca68415c37132e5e9a6a16d88c9acd8
treec215ccc4009cef039c371495160e4d441804477d
parentca5ea51118c86d0d2bfede6c75f98732f0abce85
cifs: add spinlock for the openFileList to cifsInodeInfo

BugLink: https://bugs.launchpad.net/bugs/1844558
[ Upstream commit 487317c99477d00f22370625d53be3239febabbe ]

We can not depend on the tcon->open_file_lock here since in multiuser mode
we may have the same file/inode open via multiple different tcons.

The current code is race prone and will crash if one user deletes a file
at the same time a different user opens/create the file.

To avoid this we need to have a spinlock attached to the inode and not the tcon.

RHBZ:  1580165

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/cifs/cifsfs.c
fs/cifs/cifsglob.h
fs/cifs/file.c