]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: Do not leak EDEADLK to dgetents64 for STATUS_USER_SESSION_DELETED
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 25 Aug 2021 11:16:56 +0000 (21:16 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:56 +0000 (10:00 +0200)
commit2d1e02598df4ac6b4e1f479c6554ae840e6e6983
tree2ced9358c4d3ff181f2d09d18892fcec77e73f30
parent2307d5f39b3c12fa94dc0c77b07196c523374b30
cifs: Do not leak EDEADLK to dgetents64 for STATUS_USER_SESSION_DELETED

commit 3998f0b8bc49ec784990971dc1f16bf367b19078 upstream.

RHBZ: 1994393

If we hit a STATUS_USER_SESSION_DELETED for the Create part in the
Create/QueryDirectory compound that starts a directory scan
we will leak EDEADLK back to userspace and surprise glibc and the application.

Pick this up initiate_cifs_search() and retry a small number of tries before we
return an error to userspace.

Cc: stable@vger.kernel.org
Reported-by: Xiaoli Feng <xifeng@redhat.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/readdir.c