]> git.itanic.dy.fi Git - linux-stable/commit
NFS: Fix use-after-free in nfs4_init_client()
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 2 Jun 2021 18:31:20 +0000 (14:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jun 2021 09:59:45 +0000 (11:59 +0200)
commit3e3c7ebbfac152d08be75c92802a64a1f6471a15
tree6a2fc0038e9ac955921046ab159f3eea3bf84e8e
parent83668ab1dbbf064c24d6dc090987b3d359551447
NFS: Fix use-after-free in nfs4_init_client()

commit 476bdb04c501fc64bf3b8464ffddefc8dbe01577 upstream.

KASAN reports a use-after-free when attempting to mount two different
exports through two different NICs that belong to the same server.

Olga was able to hit this with kernels starting somewhere between 5.7
and 5.10, but I traced the patch that introduced the clear_bit() call to
4.13. So something must have changed in the refcounting of the clp
pointer to make this call to nfs_put_client() the very last one.

Fixes: 8dcbec6d20 ("NFSv41: Handle EXCHID4_FLAG_CONFIRMED_R during NFSv4.1 migration")
Cc: stable@vger.kernel.org # 4.13+
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4client.c