mirror-linux/init
Thorsten Blum af06a40474 init: replace simple_strtoul with kstrtoul to improve lpj_setup
Replace simple_strtoul() with the recommended kstrtoul() for parsing the
'lpj=' boot parameter.

Check the return value of kstrtoul() and reject invalid values.  This adds
error handling while preserving existing behavior for valid values, and
removes use of the deprecated simple_strtoul() helper.

Link: https://lkml.kernel.org/r/20251122114539.446937-2-thorsten.blum@linux.dev
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-11-27 14:24:43 -08:00
..
.gitignore kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
.kunitconfig initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
Kconfig liveupdate: kho: move to kernel/liveupdate 2025-11-27 14:24:33 -08:00
Makefile initramfs_test: kunit tests for initramfs unpacking 2025-03-08 12:13:04 +01:00
calibrate.c init: replace simple_strtoul with kstrtoul to improve lpj_setup 2025-11-27 14:24:43 -08:00
do_mounts.c init: replace deprecated strncpy with strscpy_pad 2024-04-30 10:34:29 -07:00
do_mounts.h init: flush async file closing 2024-02-08 18:41:03 +01:00
do_mounts_initrd.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
do_mounts_rd.c initrd: Use str_plural() in rd_load_image() 2025-09-15 14:47:14 +02:00
init_task.c cgroup: replace global percpu_rwsem with per threadgroup resem when writing to cgroup.procs 2025-09-10 07:44:51 -10:00
initramfs.c initramfs: Replace strcpy() with strscpy() in find_link() 2025-09-15 14:52:02 +02:00
initramfs_internal.h init: add initramfs_internal.h 2025-03-04 09:52:36 +01:00
initramfs_test.c initramfs_test: add filename padding test case 2025-08-21 12:00:10 -07:00
main.c init/main.c: wrap long kernel cmdline when printing to logs 2025-11-12 10:00:16 -08:00
noinitramfs.c init: move usermodehelper_enable() to populate_rootfs() 2021-09-08 11:50:27 -07:00
version-timestamp.c ns: move ns type into struct ns_common 2025-09-25 09:23:54 +02:00
version.c init/version.c: Replace strlcpy with strscpy 2023-09-22 09:50:56 -07:00