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] [day] [month] [year] [list]
Message-ID: <2025071228-ounce-myself-1550@gregkh>
Date: Sat, 12 Jul 2025 08:50:40 +0200
From: Greg KH <greg@...ah.com>
To: Hauke Mehrtens <hauke@...ke-m.de>
Cc: sashal@...nel.org, linux-kernel@...r.kernel.org, frederic@...nel.org,
	david@...hat.com, viro@...iv.linux.org.uk, paulmck@...nel.org,
	stable@...r.kernel.org
Subject: Re: [PATCH v2] kernel/fork: Increase minimum number of allowed
 threads

On Sat, Jul 12, 2025 at 01:08:29AM +0200, Hauke Mehrtens wrote:
> A modern Linux system creates much more than 20 threads at bootup.
> When I booted up OpenWrt in qemu the system sometimes failed to boot up
> when it wanted to create the 419th thread. The VM had 128MB RAM and the
> calculation in set_max_threads() calculated that max_threads should be
> set to 419. When the system booted up it tried to notify the user space
> about every device it created because CONFIG_UEVENT_HELPER was set and
> used. I counted 1299 calls to call_usermodehelper_setup(), all of
> them try to create a new thread and call the userspace hotplug script in
> it.
> 
> This fixes bootup of Linux on systems with low memory.
> 
> I saw the problem with qemu 10.0.2 using these commands:
> qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic
> 
> Cc: stable@...r.kernel.org
> Signed-off-by: Hauke Mehrtens <hauke@...ke-m.de>
> ---
>  kernel/fork.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/fork.c b/kernel/fork.c
> index 7966c9a1c163..388299525f3c 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -115,7 +115,7 @@
>  /*
>   * Minimum number of threads to boot the kernel
>   */
> -#define MIN_THREADS 20
> +#define MIN_THREADS 600
>  
>  /*
>   * Maximum number of threads
> -- 
> 2.50.1
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/process/submitting-patches.rst for what
  needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ