]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: check ntwrk_buf_start for NULL before dereferencing it
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 12 Dec 2018 22:06:16 +0000 (08:06 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:28 +0000 (20:02 +0100)
commit705d3aec9fa4afc9df33a930ad9742d0fb9aa1f8
tree07263f9f6d4178d41ed47a1832ed8c2586abadeb
parentb46dc93fbcb07e94b032a5d15f5430d6c5565ce2
cifs: check ntwrk_buf_start for NULL before dereferencing it

[ Upstream commit 59a63e479ce36a3f24444c3a36efe82b78e4a8e0 ]

RHBZ: 1021460

There is an issue where when multiple threads open/close the same directory
ntwrk_buf_start might end up being NULL, causing the call to smbCalcSize
later to oops with a NULL deref.

The real bug is why this happens and why this can become NULL for an
open cfile, which should not be allowed.
This patch tries to avoid a oops until the time when we fix the underlying
issue.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/readdir.c