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: <20211129133803.15653-1-yaozhenguo1@gmail.com>
Date:   Mon, 29 Nov 2021 21:38:03 +0800
From:   Zhenguo Yao <yaozhenguo1@...il.com>
To:     mike.kravetz@...cle.com, akpm@...ux-foundation.org,
        mlevitsk@...hat.com
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Zhenguo Yao <yaozhenguo1@...il.com>
Subject: [BUG] hugetlbfs: Fix issue of preallocation of gigantic pages can't work

Preallocation of gigantic pages can't work bacause of commit:b5389086ad7b
(hugetlbfs: extend the definition of hugepages parameter to support node
allocation). When nid is NUMA_NO_NODE(-1), alloc_bootmem_huge_page will
always return without doing allocation. Fix this by adding more check.

Signed-off-by: Zhenguo Yao <yaozhenguo1@...il.com>
---
 mm/hugetlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 60f9b6a9582e..6d1603387914 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2876,7 +2876,7 @@ int __alloc_bootmem_huge_page(struct hstate *h, int nid)
 	struct huge_bootmem_page *m = NULL; /* initialize for clang */
 	int nr_nodes, node;
 
-	if (nid >= nr_online_nodes)
+	if (nid != NUMA_NO_NODE && nid >= nr_online_nodes)
 		return 0;
 	/* do node specific alloc */
 	if (nid != NUMA_NO_NODE) {
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ