lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251112072424.125514-1-peng8420.li@gmail.com>
Date: Wed, 12 Nov 2025 15:24:24 +0800
From: peng8420.li@...il.com
To: linux-mm@...ck.org,
	akpm@...ux-foundation.org
Cc: david@...hat.com,
	osalvador@...e.de,
	jgg@...pe.ca,
	jhubbard@...dia.com,
	peterx@...hat.com,
	linux-kernel@...r.kernel.org,
	dan.j.williams@...el.com,
	"peng8420.li" <peng8420.li@...il.com>
Subject: [PATCH] mm/gup: fix handling of zero page in follow_page_pte()

From: "peng8420.li" <peng8420.li@...il.com>

In some scenarios, `__vm_normal_page` might return NULL.
In this case, if `is_zero_pfn(pte_pfn(pte))` is true, simply return `page = pte_page(pte)`;
no further folio processing is needed.

Signed-off-by: peng8420.li <peng8420.li@...il.com>
---
 mm/gup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/gup.c b/mm/gup.c
index 95d948c8e86c..60ae5f0c20e0 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -838,6 +838,7 @@ static struct page *follow_page_pte(struct vm_area_struct *vma,
 
 		if (is_zero_pfn(pte_pfn(pte))) {
 			page = pte_page(pte);
+			goto out;
 		} else {
 			ret = follow_pfn_pte(vma, address, ptep, flags);
 			page = ERR_PTR(ret);
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ