diff options
| author | Wilson Felipe Pereira <wfelipe@google.com> | 2026-08-18 23:16:33 +0000 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-09-13 21:33:30 -0700 |
| commit | 0cc71ffa3734dfb806bccaec7b6fc32cfb4bbb8a (patch) | |
| tree | c7a06b1c7286e5850c7fe2b2afadc425462eda21 /init/Kconfig | |
| parent | f451617518f83523e04afc2442c4df5087a7087e (diff) | |
| download | linux-next-0cc71ffa3734dfb806bccaec7b6fc32cfb4bbb8a.tar.gz linux-next-0cc71ffa3734dfb806bccaec7b6fc32cfb4bbb8a.zip | |
init/Kconfig: make config INIT_ENV_ARG_LIMIT user-configurable
Patch series "init, arch: make command line size and init arg limit
configurable", v2.
This patch series promotes COMMAND_LINE_SIZE from arch/s390/Kconfig to
init/Kconfig to be generally available to other architectures.
In some use cases, such as netboot kernels, rootfs configurations, larger
initramfs setups, require larger sizes. While for embedded workloads, it
can be reduced to save memory.
Since COMMAND_LINE_SIZE can be larger, it also makes sense to allow
INIT_ENV_ARG_LIMIT to be configured.
This patch (of 2):
INIT_ENV_ARG_LIMIT is defined without a prompt string (`int`), making it a
hidden Kconfig symbol that defaults to 32 (or 128 for UML) and cannot be
configured in `make menuconfig`.
Now that CONFIG_COMMAND_LINE_SIZE is configurable across all
architectures, users who select larger kernel command lines (e.g., 4096
bytes) may pass more than 32 command-line arguments or environment
variables (`foo=bar`) to `/sbin/init`. If INIT_ENV_ARG_LIMIT remains
hardcoded at 32, any argument after the 32nd sets the panic_later flag and
causes a hard kernel panic on boot.
Add a prompt string ("Maximum number of kernel command line arguments")
and a `range 32 4096` to `config INIT_ENV_ARG_LIMIT` so that users can
configure their init argument and environment variable limit when needed,
while preserving the existing default of 32 for standard builds.
Link: https://lore.kernel.org/20260818231646.804507-1-wfelipe@google.com
Link: https://lore.kernel.org/20260818231646.804507-3-wfelipe@google.com
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Wilson Felipe Pereira <wfelipe@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'init/Kconfig')
| -rw-r--r-- | init/Kconfig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig index edc79893e1ac..3b141ba427d5 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -231,9 +231,10 @@ config BROKEN_ON_SMP default y config INIT_ENV_ARG_LIMIT - int + int "Maximum number of kernel command line arguments" default 32 if !UML default 128 if UML + range 32 4096 help Maximum of each of the number of arguments and environment variables passed to init from the kernel command line. |
