On Sun, Feb 09, 2020 at 12:24:34PM +0100, gregkh@linuxfoundation.org wrote:
The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to stable@vger.kernel.org.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 114de38225d9b300f027e2aec9afbb6e0def154b Mon Sep 17 00:00:00 2001 From: Trond Myklebust trondmy@gmail.com Date: Sun, 2 Feb 2020 17:53:54 -0500 Subject: [PATCH] NFS: Directory page cache pages need to be locked when read
When a NFS directory page cache page is removed from the page cache, its contents are freed through a call to nfs_readdir_clear_array(). To prevent the removal of the page cache entry until after we've finished reading it, we must take the page lock.
Fixes: 11de3b11e08c ("NFS: Fix a memory leak in nfs_readdir") Cc: stable@vger.kernel.org # v2.6.37+ Signed-off-by: Trond Myklebust trond.myklebust@hammerspace.com Reviewed-by: Benjamin Coddington bcodding@redhat.com Signed-off-by: Anna Schumaker Anna.Schumaker@Netapp.com
I've also grabbed 6089dd0d7310 ("NFS: Fix bool initialization/comparison") and queued both for 4.9 and 4.4.