Message ID | 20220211214919.08417C340E9@smtp.kernel.org |
---|---|
State | New |
Headers | show |
Series | + hugetlbfs-fix-a-truncation-issue-in-hugepages-parameter.patch added to -mm tree | expand |
--- a/mm/hugetlb.c~hugetlbfs-fix-a-truncation-issue-in-hugepages-parameter +++ a/mm/hugetlb.c @@ -4159,10 +4159,10 @@ static int __init hugepages_setup(char * pr_warn("HugeTLB: architecture can't support node specific alloc, ignoring!\n"); return 0; } + if (tmp >= nr_online_nodes) + goto invalid; node = tmp; p += count + 1; - if (node < 0 || node >= nr_online_nodes) - goto invalid; /* Parse hugepages */ if (sscanf(p, "%lu%n", &tmp, &count) != 1) goto invalid;