On Sun, Feb 09, 2020 at 12:24:34PM +0100, gregkh@xxxxxxxxxxxxxxxxxxx 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@xxxxxxxxxxxxxxx>. thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 114de38225d9b300f027e2aec9afbb6e0def154b Mon Sep 17 00:00:00 2001 From: Trond Myklebust <trondmy@xxxxxxxxx> 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@xxxxxxxxxxxxxxx # v2.6.37+ Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> Reviewed-by: Benjamin Coddington <bcodding@xxxxxxxxxx> Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
I've also grabbed 6089dd0d7310 ("NFS: Fix bool initialization/comparison") and queued both for 4.9 and 4.4. -- Thanks, Sasha