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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240209141637.129e417747ef130255db620d@linux-foundation.org>
Date: Fri, 9 Feb 2024 14:16:37 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Anshuman Khandual <anshuman.khandual@....com>
Cc: linux-mm@...ck.org, Muchun Song <muchun.song@...ux.dev>,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb: Ensure adequate CMA areas available for
 hugetlb_cma[]

On Fri,  9 Feb 2024 12:20:36 +0530 Anshuman Khandual <anshuman.khandual@....com> wrote:

> HugeTLB CMA area array is being created for possible MAX_NUMNODES without
> ensuring corresponding MAX_CMA_AREAS support in CMA. Let's just warn for
> such scenarios indicating need for CONFIG_CMA_AREAS adjustment.
> 
> ...
>
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -7750,6 +7750,13 @@ void __init hugetlb_cma_reserve(int order)
>  	}
>  
>  	reserved = 0;
> +
> +	/*
> +	 * There needs to be enough MAX_CMA_AREAS to accommodate
> +	 * MAX_NUMNODES heap areas being created here. Otherwise
> +	 * adjust CONFIG_CMA_AREAS as required.
> +	 */
> +	VM_WARN_ON(MAX_CMA_AREAS < MAX_NUMNODES);

Could this simply be fixed up in Kconfig logic?

And I think this could be detected at compile-time?  BUILD_BUG_ON()?

>  	for_each_online_node(nid) {
>  		int res;
>  		char name[CMA_MAX_NAME];
> -- 
> 2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ