From patchwork Tue Mar 10 13:00:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yangerkun X-Patchwork-Id: 11429237 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE8F0924 for ; Tue, 10 Mar 2020 12:32:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C53B52468C for ; Tue, 10 Mar 2020 12:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726315AbgCJMcT (ORCPT ); Tue, 10 Mar 2020 08:32:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:46854 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726252AbgCJMcT (ORCPT ); Tue, 10 Mar 2020 08:32:19 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D43095AD1AB69C88E07F; Tue, 10 Mar 2020 20:32:16 +0800 (CST) Received: from fedora-aep.huawei.cmm (10.175.113.49) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 10 Mar 2020 20:32:10 +0800 From: yangerkun To: , CC: , , , , Subject: [PATCH 4.4.y/4.9.y] NFS: fix highmem leak exist in nfs_readdir_xdr_to_array Date: Tue, 10 Mar 2020 21:00:52 +0800 Message-ID: <20200310130052.5728-1-yangerkun@huawei.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 X-Originating-IP: [10.175.113.49] X-CFilter-Loop: Reflected Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The patch 'e22dea67d2f7 ("NFS: Fix memory leaks and corruption in readdir")' in 4.4.y/4.9.y will introduce a highmem leak. Actually, nfs_readdir_get_array has did what we want to do. No need to call kmap again. Signed-off-by: yangerkun --- fs/nfs/dir.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index c2665d920cf8..2517fcd423b6 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -678,8 +678,6 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, goto out_label_free; } - array = kmap(page); - status = nfs_readdir_alloc_pages(pages, array_size); if (status < 0) goto out_release_array;