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: <6ebfdd9a-0919-4c65-a6ab-48ac6c81cd0d@redhat.com>
Date: Fri, 14 Mar 2025 10:08:06 -0400
From: Waiman Long <llong@...hat.com>
To: Xiaomeng Zhang <zhangxiaomeng13@...wei.com>,
 Carlos Llamas <cmllamas@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
 Boqun Feng <boqun.feng@...il.com>, "J. R. Okajima" <hooanon05g@...il.com>,
 Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
 Will Deacon <will@...nel.org>
Subject: Re: [PATCH] lockdep: Fix upper limit for LOCKDEP_BITS configs

On 3/14/25 2:47 AM, Xiaomeng Zhang wrote:
> The upper limit that was initially setup for LOCKDEP_BITS configs
> is too high (24 bit shift), which causes the kernel image size to exceed
> KERNEL_IMAGE_SIZE (1024MB) limit. When LOCKDEP_BITS is set to 24,
> the kernel image size grows to 1562.19MB.
>
> Adjust LOCKDEP_BITS to 22, which results in a kernel image size of
> 888.19MB, keeping it under the KERNEL_IMAGE_SIZE limit while still
> maintaining adequate debug information capacity.
>
> This change prevents the linker error:
>    ld: kernel image bigger than KERNEL_IMAGE_SIZE
>
> Fixes: e638072e6172 ("lockdep: Fix upper limit for LOCKDEP_*_BITS configs")
> Signed-off-by: Xiaomeng Zhang <zhangxiaomeng13@...wei.com>
> ---
>   lib/Kconfig.debug | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 35796c290ca3..6faba965a349 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1504,7 +1504,7 @@ config LOCKDEP_SMALL
>   config LOCKDEP_BITS
>   	int "Size for MAX_LOCKDEP_ENTRIES (as Nth power of 2)"
>   	depends on LOCKDEP && !LOCKDEP_SMALL
> -	range 10 24
> +	range 10 22
>   	default 15
>   	help
>   	  Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message.

The current size of lock_list structure is 56 bytes. If we have 2^24 of 
them, they will occupy 896 Mbytes. That leaves about 100 Mbytes for the 
rest. Yes, we should reduce it further.

Acked-by: Waiman Long <longman@...hat.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ