| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/27 15:09 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch series relocates build-time host utility `gen_init_cpio` and helper script `gen_initramfs.sh` from `usr/` to `scripts/`, updating Makefiles, Documentation, MAINTAINERS, and selftest references accordingly. No executable kernel runtime code (vmlinux or modules) is added or modified.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/27 15:09 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit b788baf82fd1780536a088930b5fdb66d49d895e\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Sep 27 15:09:16 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/Documentation/driver-api/early-userspace/early_userspace_support.rst b/Documentation/driver-api/early-userspace/early_userspace_support.rst\nindex 60d1e1bc9413b..1070f82e35788 100644\n--- a/Documentation/driver-api/early-userspace/early_userspace_support.rst\n+++ b/Documentation/driver-api/early-userspace/early_userspace_support.rst\n@@ -55,9 +55,9 @@ user root (0). INITRAMFS_ROOT_GID can be set to a group ID that needs\n to be mapped to group root (0).\n \n A source file must be directives in the format required by the\n-usr/gen_init_cpio utility (run 'usr/gen_init_cpio -h' to get the\n+scripts/gen_init_cpio utility (run 'scripts/gen_init_cpio -h' to get the\n file format). The directives in the file will be passed directly to\n-usr/gen_init_cpio.\n+scripts/gen_init_cpio.\n \n When a combination of directories and files are specified then the\n initramfs image will be an aggregate of all of them. In this way a user\n@@ -69,17 +69,17 @@ early userspace image can be built by an unprivileged user.\n \n As a technical note, when directories and files are specified, the\n entire CONFIG_INITRAMFS_SOURCE is passed to\n-usr/gen_initramfs.sh. This means that CONFIG_INITRAMFS_SOURCE\n+scripts/gen_initramfs.sh. This means that CONFIG_INITRAMFS_SOURCE\n can really be interpreted as any legal argument to\n gen_initramfs.sh. If a directory is specified as an argument then\n the contents are scanned, uid/gid translation is performed, and\n-usr/gen_init_cpio file directives are output. If a file is\n-specified as an argument to usr/gen_initramfs.sh then the\n+scripts/gen_init_cpio file directives are output. If a file is\n+specified as an argument to scripts/gen_initramfs.sh then the\n contents of the file are simply copied to the output. All of the output\n directives from directory scanning and file contents copying are\n-processed by usr/gen_init_cpio.\n+processed by scripts/gen_init_cpio.\n \n-See also 'usr/gen_initramfs.sh -h'.\n+See also 'scripts/gen_initramfs.sh -h'.\n \n Where's this all leading?\n =========================\n@@ -142,7 +142,7 @@ b) some device and filesystem drivers built as modules and stored in an\n \n c) using initramfs. The call to prepare_namespace() must be skipped.\n This means that a binary must do all the work. Said binary can be stored\n- into initramfs either via modifying usr/gen_init_cpio.c or via the new\n+ into initramfs either via modifying scripts/gen_init_cpio.c or via the new\n initrd format, an cpio archive. It must be called \"/init\". This binary\n is responsible to do all the things prepare_namespace() would do.\n \ndiff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.rst b/Documentation/filesystems/ramfs-rootfs-initramfs.rst\nindex 165117a721cee..4263fe06115de 100644\n--- a/Documentation/filesystems/ramfs-rootfs-initramfs.rst\n+++ b/Documentation/filesystems/ramfs-rootfs-initramfs.rst\n@@ -155,7 +155,7 @@ specification such as the following example::\n dir /mnt 755 0 0\n file /init initramfs/init.sh 755 0 0\n \n-Run \"usr/gen_init_cpio\" (after the kernel build) to get a usage message\n+Run \"scripts/gen_init_cpio\" (after the kernel build) to get a usage message\n documenting the above file format.\n \n One advantage of the configuration file is that root access is not required to\n@@ -167,9 +167,9 @@ Documentation/driver-api/early-userspace/early_userspace_support.rst for more de\n The kernel does not depend on external cpio tools. If you specify a\n directory instead of a configuration file, the kernel's build infrastructure\n creates a configuration file from that directory (usr/Makefile calls\n-usr/gen_initramfs.sh), and proceeds to package up that directory\n-using the config file (by feeding it to usr/gen_init_cpio, which is created\n-from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is\n+scripts/gen_initramfs.sh), and proceeds to package up that directory\n+using the config file (by feeding it to scripts/gen_init_cpio, which is created\n+from scripts/gen_init_cpio.c). The kernel's build-time cpio creation code is\n entirely self-contained, and the kernel's boot-time extractor is also\n (obviously) self-contained.\n \n@@ -313,7 +313,7 @@ the above threads) is:\n 2) The cpio archive format chosen by the kernel is simpler and cleaner (and\n thus easier to create and parse) than any of the (literally dozens of)\n various tar archive formats. The complete initramfs archive format is\n- explained in buffer-format.rst, created in usr/gen_init_cpio.c, and\n+ explained in buffer-format.rst, created in scripts/gen_init_cpio.c, and\n extracted in init/initramfs.c. All three together come to less than 26k\n total of human-readable text.\n \ndiff --git a/MAINTAINERS b/MAINTAINERS\nindex cc3cae2e378b3..6a76fbf6ed575 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -14139,6 +14139,7 @@ F:\tscripts/basic/\n F:\tscripts/clang-tools/\n F:\tscripts/container\n F:\tscripts/dummy-tools/\n+F:\tscripts/gen_init*\n F:\tscripts/include/\n F:\tscripts/install.sh\n F:\tscripts/mk*\ndiff --git a/Makefile b/Makefile\nindex 751a08643bf85..bc97a8c08e20c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -298,6 +298,7 @@ no-dot-config-targets := $(clean-targets) \\\n \t\t\t %asm-generic kernelversion %src-pkg dt_binding_check \\\n \t\t\t dt_style_selftest \\\n \t\t\t outputmakefile rustavailable rustfmt rustfmtcheck \\\n+\t\t\t scripts_gen_init_cpio \\\n \t\t\t run-command\n no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \\\n \t\t\t image_name\n@@ -1528,9 +1529,9 @@ ifdef CONFIG_HEADERS_INSTALL\n prepare: headers\n endif\n \n-PHONY += usr_gen_init_cpio\n-usr_gen_init_cpio: scripts_basic\n-\t$(Q)$(MAKE) $(build)=usr usr/gen_init_cpio\n+PHONY += scripts_gen_init_cpio\n+scripts_gen_init_cpio: scripts_basic\n+\t$(Q)$(MAKE) $(build)=scripts scripts/gen_init_cpio\n \n PHONY += scripts_unifdef\n scripts_unifdef: scripts_basic\n@@ -1831,7 +1832,7 @@ distclean: mrproper\n # Packaging of the kernel to various formats\n # ---------------------------------------------------------------------------\n \n-modules-cpio-pkg: usr_gen_init_cpio\n+modules-cpio-pkg: scripts_gen_init_cpio\n \n %src-pkg: FORCE\n \t$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@\ndiff --git a/scripts/.gitignore b/scripts/.gitignore\nindex 4215c2208f7e4..7004565439107 100644\n--- a/scripts/.gitignore\n+++ b/scripts/.gitignore\n@@ -1,5 +1,6 @@\n # SPDX-License-Identifier: GPL-2.0-only\n /asn1_compiler\n+/gen_init_cpio\n /gen_packed_field_checks\n /generate_rust_target\n /insert-sys-cert\ndiff --git a/scripts/Makefile b/scripts/Makefile\nindex 3434a82a119f0..3d50805b0885a 100644\n--- a/scripts/Makefile\n+++ b/scripts/Makefile\n@@ -53,6 +53,9 @@ ifdef CONFIG_BUILDTIME_MCOUNT_SORT\n HOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED\n endif\n \n+hostprogs += gen_init_cpio\n+always-$(CONFIG_BLK_DEV_INITRD) += gen_init_cpio\n+\n # The following programs are only built on demand\n hostprogs += unifdef gen_packed_field_checks\n \ndiff --git a/scripts/Makefile.package b/scripts/Makefile.package\nindex 6d36786ba31ce..948ad5b679d11 100644\n--- a/scripts/Makefile.package\n+++ b/scripts/Makefile.package\n@@ -198,7 +198,7 @@ tar%-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar.% FORCE\n \t$(Q)$(MAKE) -f $(srctree)/Makefile INSTALL_MOD_PATH=$@/$(INSTALL_MOD_PATH) modules_install\n \n quiet_cmd_cpio = CPIO $@\n- cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $\u003c\n+ cmd_cpio = $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs.sh -o $@ $\u003c\n \n modules-$(KERNELRELEASE)-$(ARCH).cpio: .tmp_modules_cpio\n \t$(call cmd,cpio)\ndiff --git a/usr/gen_init_cpio.c b/scripts/gen_init_cpio.c\nsimilarity index 100%\nrename from usr/gen_init_cpio.c\nrename to scripts/gen_init_cpio.c\ndiff --git a/usr/gen_initramfs.sh b/scripts/gen_initramfs.sh\nsimilarity index 99%\nrename from usr/gen_initramfs.sh\nrename to scripts/gen_initramfs.sh\nindex 7eba2fddf0ef2..27ac1fd48001a 100755\n--- a/usr/gen_initramfs.sh\n+++ b/scripts/gen_initramfs.sh\n@@ -247,4 +247,4 @@ done\n \n # If output_file is set we will generate cpio archive\n # we are careful to delete tmp files\n-usr/gen_init_cpio $output $timestamp $cpio_list\n+scripts/gen_init_cpio $output $timestamp $cpio_list\ndiff --git a/scripts/remove-stale-files b/scripts/remove-stale-files\nindex 6e39fa8540df2..e46337e4bfb8f 100755\n--- a/scripts/remove-stale-files\n+++ b/scripts/remove-stale-files\n@@ -26,3 +26,5 @@ rm -f scripts/selinux/genheaders/genheaders\n rm -f *.spec\n \n rm -f lib/test_fortify.log\n+\n+rm -f usr/gen_init_cpio\ndiff --git a/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py b/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py\nindex d7776f072e034..93787a1cd1566 100644\n--- a/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py\n+++ b/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py\n@@ -338,7 +338,7 @@ class TestSavedCmdParser(unittest.TestCase):\n \n # gen_initramfs.sh command tests\n def test_gen_initramfs(self):\n- cmd = \"sh ../usr/gen_initramfs.sh -o usr/initramfs_data.cpio -l usr/.initramfs_data.cpio.d ../usr/default_cpio_list\"\n+ cmd = \"sh ../scripts/gen_initramfs.sh -o usr/initramfs_data.cpio -l usr/.initramfs_data.cpio.d ../usr/default_cpio_list\"\n expected = \"../usr/default_cpio_list\"\n self._assert_parsing(cmd, expected)\n \ndiff --git a/tools/testing/selftests/kho/vmtest.sh b/tools/testing/selftests/kho/vmtest.sh\nindex 0014bd76e88de..1e86ffcc3a79e 100755\n--- a/tools/testing/selftests/kho/vmtest.sh\n+++ b/tools/testing/selftests/kho/vmtest.sh\n@@ -100,7 +100,7 @@ file /init $tmp_dir/init 0755 0 0\n file /kernel $kernel 0644 0 0\n EOF\n \n-\t\"$build_dir/usr/gen_init_cpio\" \"$tmp_dir/cpio_list\" \u003e \"$initrd\"\n+\t\"$build_dir/scripts/gen_init_cpio\" \"$tmp_dir/cpio_list\" \u003e \"$initrd\"\n }\n \n function run_qemu() {\ndiff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/nolibc/Makefile.nolibc\nindex f70c8dfca0186..380200b152e4d 100644\n--- a/tools/testing/selftests/nolibc/Makefile.nolibc\n+++ b/tools/testing/selftests/nolibc/Makefile.nolibc\n@@ -295,7 +295,7 @@ run-user: nolibc-test\n \t$(Q)$(REPORT) $(CURDIR)/run.out\n \n initramfs.cpio: kernel nolibc-test\n-\t$(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(objtree)/usr/gen_init_cpio - \u003e initramfs.cpio\n+\t$(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(objtree)/scripts/gen_init_cpio - \u003e initramfs.cpio\n \n initramfs: nolibc-test\n \t$(QUIET_MKDIR)mkdir -p initramfs\ndiff --git a/usr/.gitignore b/usr/.gitignore\nindex 8996e7a889024..13bf7a38355ce 100644\n--- a/usr/.gitignore\n+++ b/usr/.gitignore\n@@ -1,4 +1,6 @@\n # SPDX-License-Identifier: GPL-2.0-only\n-/gen_init_cpio\n /initramfs_data.cpio\n /initramfs_inc_data\n+\n+# Keep around until cleanup in scripts/remove-stale-files\n+/gen_init_cpio\ndiff --git a/usr/Kconfig b/usr/Kconfig\nindex 9279a2893ab0e..f87dd4bac4183 100644\n--- a/usr/Kconfig\n+++ b/usr/Kconfig\n@@ -13,7 +13,7 @@ config INITRAMFS_SOURCE\n \t to be used as an initramfs image. Directories should contain a\n \t filesystem layout to be included in the initramfs image. Files\n \t should contain entries according to the format described by the\n-\t \"usr/gen_init_cpio\" program in the kernel tree.\n+\t \"scripts/gen_init_cpio\" program in the kernel tree.\n \n \t When multiple directories and files are specified then the\n \t initramfs image will be the aggregate of all of them.\ndiff --git a/usr/Makefile b/usr/Makefile\nindex e8f42478a0b76..5b97ee66c00a0 100644\n--- a/usr/Makefile\n+++ b/usr/Makefile\n@@ -16,8 +16,6 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o\n \n $(obj)/initramfs_data.o: $(obj)/initramfs_inc_data\n \n-hostprogs := gen_init_cpio\n-\n ramfs-input := $(CONFIG_INITRAMFS_SOURCE)\n cpio-data :=\n \n@@ -72,7 +70,7 @@ quiet_cmd_initfs = GEN $@\n # 2) There are changes in which files are included (added or deleted)\n # 3) If gen_init_cpio are newer than initramfs_data.cpio\n # 4) Arguments to gen_initramfs.sh changes\n-$(obj)/initramfs_data.cpio: $(src)/gen_initramfs.sh $(obj)/gen_init_cpio $(deps_initramfs) FORCE\n+$(obj)/initramfs_data.cpio: $(srctree)/scripts/gen_initramfs.sh scripts/gen_init_cpio $(deps_initramfs) FORCE\n \t$(call if_changed,initfs)\n \n endif\n"
} |
| 2/1 | 2026/09/27 15:09 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series relocates build-time host utility `gen_init_cpio` and helper script `gen_initramfs.sh` from `usr/` to `scripts/`, updating Makefiles, Documentation, MAINTAINERS, and selftest references accordingly. No executable kernel runtime code (vmlinux or modules) is added or modified.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit b788baf82fd1780536a088930b5fdb66d49d895e
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Sep 27 15:09:16 2026 +0000
syz-cluster: applied patch under review
diff --git a/Documentation/driver-api/early-userspace/early_userspace_support.rst b/Documentation/driver-api/early-userspace/early_userspace_support.rst
index 60d1e1bc9413b..1070f82e35788 100644
--- a/Documentation/driver-api/early-userspace/early_userspace_support.rst
+++ b/Documentation/driver-api/early-userspace/early_userspace_support.rst
@@ -55,9 +55,9 @@ user root (0). INITRAMFS_ROOT_GID can be set to a group ID that needs
to be mapped to group root (0).
A source file must be directives in the format required by the
-usr/gen_init_cpio utility (run 'usr/gen_init_cpio -h' to get the
+scripts/gen_init_cpio utility (run 'scripts/gen_init_cpio -h' to get the
file format). The directives in the file will be passed directly to
-usr/gen_init_cpio.
+scripts/gen_init_cpio.
When a combination of directories and files are specified then the
initramfs image will be an aggregate of all of them. In this way a user
@@ -69,17 +69,17 @@ early userspace image can be built by an unprivileged user.
As a technical note, when directories and files are specified, the
entire CONFIG_INITRAMFS_SOURCE is passed to
-usr/gen_initramfs.sh. This means that CONFIG_INITRAMFS_SOURCE
+scripts/gen_initramfs.sh. This means that CONFIG_INITRAMFS_SOURCE
can really be interpreted as any legal argument to
gen_initramfs.sh. If a directory is specified as an argument then
the contents are scanned, uid/gid translation is performed, and
-usr/gen_init_cpio file directives are output. If a file is
-specified as an argument to usr/gen_initramfs.sh then the
+scripts/gen_init_cpio file directives are output. If a file is
+specified as an argument to scripts/gen_initramfs.sh then the
contents of the file are simply copied to the output. All of the output
directives from directory scanning and file contents copying are
-processed by usr/gen_init_cpio.
+processed by scripts/gen_init_cpio.
-See also 'usr/gen_initramfs.sh -h'.
+See also 'scripts/gen_initramfs.sh -h'.
Where's this all leading?
=========================
@@ -142,7 +142,7 @@ b) some device and filesystem drivers built as modules and stored in an
c) using initramfs. The call to prepare_namespace() must be skipped.
This means that a binary must do all the work. Said binary can be stored
- into initramfs either via modifying usr/gen_init_cpio.c or via the new
+ into initramfs either via modifying scripts/gen_init_cpio.c or via the new
initrd format, an cpio archive. It must be called "/init". This binary
is responsible to do all the things prepare_namespace() would do.
diff --git a/Documentation/filesystems/ramfs-rootfs-initramfs.rst b/Documentation/filesystems/ramfs-rootfs-initramfs.rst
index 165117a721cee..4263fe06115de 100644
--- a/Documentation/filesystems/ramfs-rootfs-initramfs.rst
+++ b/Documentation/filesystems/ramfs-rootfs-initramfs.rst
@@ -155,7 +155,7 @@ specification such as the following example::
dir /mnt 755 0 0
file /init initramfs/init.sh 755 0 0
-Run "usr/gen_init_cpio" (after the kernel build) to get a usage message
+Run "scripts/gen_init_cpio" (after the kernel build) to get a usage message
documenting the above file format.
One advantage of the configuration file is that root access is not required to
@@ -167,9 +167,9 @@ Documentation/driver-api/early-userspace/early_userspace_support.rst for more de
The kernel does not depend on external cpio tools. If you specify a
directory instead of a configuration file, the kernel's build infrastructure
creates a configuration file from that directory (usr/Makefile calls
-usr/gen_initramfs.sh), and proceeds to package up that directory
-using the config file (by feeding it to usr/gen_init_cpio, which is created
-from usr/gen_init_cpio.c). The kernel's build-time cpio creation code is
+scripts/gen_initramfs.sh), and proceeds to package up that directory
+using the config file (by feeding it to scripts/gen_init_cpio, which is created
+from scripts/gen_init_cpio.c). The kernel's build-time cpio creation code is
entirely self-contained, and the kernel's boot-time extractor is also
(obviously) self-contained.
@@ -313,7 +313,7 @@ the above threads) is:
2) The cpio archive format chosen by the kernel is simpler and cleaner (and
thus easier to create and parse) than any of the (literally dozens of)
various tar archive formats. The complete initramfs archive format is
- explained in buffer-format.rst, created in usr/gen_init_cpio.c, and
+ explained in buffer-format.rst, created in scripts/gen_init_cpio.c, and
extracted in init/initramfs.c. All three together come to less than 26k
total of human-readable text.
diff --git a/MAINTAINERS b/MAINTAINERS
index cc3cae2e378b3..6a76fbf6ed575 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14139,6 +14139,7 @@ F: scripts/basic/
F: scripts/clang-tools/
F: scripts/container
F: scripts/dummy-tools/
+F: scripts/gen_init*
F: scripts/include/
F: scripts/install.sh
F: scripts/mk*
diff --git a/Makefile b/Makefile
index 751a08643bf85..bc97a8c08e20c 100644
--- a/Makefile
+++ b/Makefile
@@ -298,6 +298,7 @@ no-dot-config-targets := $(clean-targets) \
%asm-generic kernelversion %src-pkg dt_binding_check \
dt_style_selftest \
outputmakefile rustavailable rustfmt rustfmtcheck \
+ scripts_gen_init_cpio \
run-command
no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
image_name
@@ -1528,9 +1529,9 @@ ifdef CONFIG_HEADERS_INSTALL
prepare: headers
endif
-PHONY += usr_gen_init_cpio
-usr_gen_init_cpio: scripts_basic
- $(Q)$(MAKE) $(build)=usr usr/gen_init_cpio
+PHONY += scripts_gen_init_cpio
+scripts_gen_init_cpio: scripts_basic
+ $(Q)$(MAKE) $(build)=scripts scripts/gen_init_cpio
PHONY += scripts_unifdef
scripts_unifdef: scripts_basic
@@ -1831,7 +1832,7 @@ distclean: mrproper
# Packaging of the kernel to various formats
# ---------------------------------------------------------------------------
-modules-cpio-pkg: usr_gen_init_cpio
+modules-cpio-pkg: scripts_gen_init_cpio
%src-pkg: FORCE
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.package $@
diff --git a/scripts/.gitignore b/scripts/.gitignore
index 4215c2208f7e4..7004565439107 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
/asn1_compiler
+/gen_init_cpio
/gen_packed_field_checks
/generate_rust_target
/insert-sys-cert
diff --git a/scripts/Makefile b/scripts/Makefile
index 3434a82a119f0..3d50805b0885a 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -53,6 +53,9 @@ ifdef CONFIG_BUILDTIME_MCOUNT_SORT
HOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED
endif
+hostprogs += gen_init_cpio
+always-$(CONFIG_BLK_DEV_INITRD) += gen_init_cpio
+
# The following programs are only built on demand
hostprogs += unifdef gen_packed_field_checks
diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 6d36786ba31ce..948ad5b679d11 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -198,7 +198,7 @@ tar%-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar.% FORCE
$(Q)$(MAKE) -f $(srctree)/Makefile INSTALL_MOD_PATH=$@/$(INSTALL_MOD_PATH) modules_install
quiet_cmd_cpio = CPIO $@
- cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $<
+ cmd_cpio = $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs.sh -o $@ $<
modules-$(KERNELRELEASE)-$(ARCH).cpio: .tmp_modules_cpio
$(call cmd,cpio)
diff --git a/usr/gen_init_cpio.c b/scripts/gen_init_cpio.c
similarity index 100%
rename from usr/gen_init_cpio.c
rename to scripts/gen_init_cpio.c
diff --git a/usr/gen_initramfs.sh b/scripts/gen_initramfs.sh
similarity index 99%
rename from usr/gen_initramfs.sh
rename to scripts/gen_initramfs.sh
index 7eba2fddf0ef2..27ac1fd48001a 100755
--- a/usr/gen_initramfs.sh
+++ b/scripts/gen_initramfs.sh
@@ -247,4 +247,4 @@ done
# If output_file is set we will generate cpio archive
# we are careful to delete tmp files
-usr/gen_init_cpio $output $timestamp $cpio_list
+scripts/gen_init_cpio $output $timestamp $cpio_list
diff --git a/scripts/remove-stale-files b/scripts/remove-stale-files
index 6e39fa8540df2..e46337e4bfb8f 100755
--- a/scripts/remove-stale-files
+++ b/scripts/remove-stale-files
@@ -26,3 +26,5 @@ rm -f scripts/selinux/genheaders/genheaders
rm -f *.spec
rm -f lib/test_fortify.log
+
+rm -f usr/gen_init_cpio
diff --git a/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py b/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py
index d7776f072e034..93787a1cd1566 100644
--- a/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py
+++ b/scripts/sbom/tests/cmd_graph/test_savedcmd_parser.py
@@ -338,7 +338,7 @@ class TestSavedCmdParser(unittest.TestCase):
# gen_initramfs.sh command tests
def test_gen_initramfs(self):
- cmd = "sh ../usr/gen_initramfs.sh -o usr/initramfs_data.cpio -l usr/.initramfs_data.cpio.d ../usr/default_cpio_list"
+ cmd = "sh ../scripts/gen_initramfs.sh -o usr/initramfs_data.cpio -l usr/.initramfs_data.cpio.d ../usr/default_cpio_list"
expected = "../usr/default_cpio_list"
self._assert_parsing(cmd, expected)
diff --git a/tools/testing/selftests/kho/vmtest.sh b/tools/testing/selftests/kho/vmtest.sh
index 0014bd76e88de..1e86ffcc3a79e 100755
--- a/tools/testing/selftests/kho/vmtest.sh
+++ b/tools/testing/selftests/kho/vmtest.sh
@@ -100,7 +100,7 @@ file /init $tmp_dir/init 0755 0 0
file /kernel $kernel 0644 0 0
EOF
- "$build_dir/usr/gen_init_cpio" "$tmp_dir/cpio_list" > "$initrd"
+ "$build_dir/scripts/gen_init_cpio" "$tmp_dir/cpio_list" > "$initrd"
}
function run_qemu() {
diff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/nolibc/Makefile.nolibc
index f70c8dfca0186..380200b152e4d 100644
--- a/tools/testing/selftests/nolibc/Makefile.nolibc
+++ b/tools/testing/selftests/nolibc/Makefile.nolibc
@@ -295,7 +295,7 @@ run-user: nolibc-test
$(Q)$(REPORT) $(CURDIR)/run.out
initramfs.cpio: kernel nolibc-test
- $(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(objtree)/usr/gen_init_cpio - > initramfs.cpio
+ $(QUIET_GEN)echo 'file /init nolibc-test 755 0 0' | $(objtree)/scripts/gen_init_cpio - > initramfs.cpio
initramfs: nolibc-test
$(QUIET_MKDIR)mkdir -p initramfs
diff --git a/usr/.gitignore b/usr/.gitignore
index 8996e7a889024..13bf7a38355ce 100644
--- a/usr/.gitignore
+++ b/usr/.gitignore
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
-/gen_init_cpio
/initramfs_data.cpio
/initramfs_inc_data
+
+# Keep around until cleanup in scripts/remove-stale-files
+/gen_init_cpio
diff --git a/usr/Kconfig b/usr/Kconfig
index 9279a2893ab0e..f87dd4bac4183 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -13,7 +13,7 @@ config INITRAMFS_SOURCE
to be used as an initramfs image. Directories should contain a
filesystem layout to be included in the initramfs image. Files
should contain entries according to the format described by the
- "usr/gen_init_cpio" program in the kernel tree.
+ "scripts/gen_init_cpio" program in the kernel tree.
When multiple directories and files are specified then the
initramfs image will be the aggregate of all of them.
diff --git a/usr/Makefile b/usr/Makefile
index e8f42478a0b76..5b97ee66c00a0 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -16,8 +16,6 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o
$(obj)/initramfs_data.o: $(obj)/initramfs_inc_data
-hostprogs := gen_init_cpio
-
ramfs-input := $(CONFIG_INITRAMFS_SOURCE)
cpio-data :=
@@ -72,7 +70,7 @@ quiet_cmd_initfs = GEN $@
# 2) There are changes in which files are included (added or deleted)
# 3) If gen_init_cpio are newer than initramfs_data.cpio
# 4) Arguments to gen_initramfs.sh changes
-$(obj)/initramfs_data.cpio: $(src)/gen_initramfs.sh $(obj)/gen_init_cpio $(deps_initramfs) FORCE
+$(obj)/initramfs_data.cpio: $(srctree)/scripts/gen_initramfs.sh scripts/gen_init_cpio $(deps_initramfs) FORCE
$(call if_changed,initfs)
endif
|
| 3/2 | 2026/09/27 15:09 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7150 output: 27 thoughts: 716 Thoughts: **Fuzzing Evaluation: Patch Series Analysis** Okay, let's break this down. My task is to decide if this patch series is worth the effort of fuzzing with syzkaller. The initial scan of the diff is promising, but I need to be methodical. Looking at the file changes, I see a mix: documentation updates, MAINTAINERS file adjustments, Makefile modifications, scripts directory changes, tools, and usr-related files. Nothing immediately screams "fuzz me!" but I can't jump to conclusions. Now, let's apply my expertise and reference section 2's criteria. It's about when to *avoid* fuzzing. We only return `WorthFuzzing=false` (negative) if *all* changes fit these categories: non-kernel stuff, documentation, user-space, build systems, or pure logging changes. Let's break down the list: Documentation changes are a definite no-fuzz. MAINTAINERS, Makefile updates, scripts directory modifications, usr/.gitignore, and usr/Kconfig help text adjustments – all clear non-kernel, non-executable, build-system or user-space related. So far, so good. Hold on a second... `usr/gen_init_cpio.c` has been moved to `scripts/gen_init_cpio.c`. The rename similarity is 100%. Ah, it's a host program, a build tool for generating cpio archives. That's *very* important. Even though it's code, it's *not* part of the kernel runtime or a kernel module. It is a user-space tool, even though it's used during the build. Let's recap. I've got build system changes (Makefile, scripts/Makefile, usr/Makefile), build scripts (gen_initramfs.sh), host build tools (`gen_init_cpio.c` moved from usr/ to scripts/), selftests, documentation, and a maintainers file. None of this touches vmlinux or kernel modules. To be absolutely sure, I'm going to do a final check of all the files in the commit. It's always best to be precise. I'm going to look through the patch details, *very* carefully, to confirm that nothing else was touched in the commit. After that check, I can provide my final recommendation. |
| 4/2 | 2026/09/27 15:09 | tool | grepper |
0mArgs:{
"Expression": "gen_init_cpio",
"PathPrefix": "usr"
}Results: {
"Output": "usr/.gitignore-5-# Keep around until cleanup in scripts/remove-stale-files\nusr/.gitignore:6:/gen_init_cpio\n--\nusr/Kconfig=6=config INITRAMFS_SOURCE\n--\nusr/Kconfig-15-\t should contain entries according to the format described by the\nusr/Kconfig:16:\t \"scripts/gen_init_cpio\" program in the kernel tree.\nusr/Kconfig-17-\n--\nusr/Makefile=60=quiet_cmd_initfs = GEN $@\n--\nusr/Makefile-70-# 2) There are changes in which files are included (added or deleted)\nusr/Makefile:71:# 3) If gen_init_cpio are newer than initramfs_data.cpio\nusr/Makefile-72-# 4) Arguments to gen_initramfs.sh changes\nusr/Makefile:73:$(obj)/initramfs_data.cpio: $(srctree)/scripts/gen_initramfs.sh scripts/gen_init_cpio $(deps_initramfs) FORCE\nusr/Makefile-74-\t$(call if_changed,initfs)\n"
} |
| 5/2 | 2026/09/27 15:09 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8686 output: 104 thoughts: 670 Thoughts: **Analysis of the Provided Patchset** Okay, let me quickly assess this change. First, I need to confirm the scope. I see a full `git diff` presented, so that's good. Now, let's break down the touched files. Alright, I'm seeing changes across `Documentation`, `MAINTAINERS`, the build system (`Makefile` variants), several host-side scripts and programs, and some self-tests. Specifically, I'm noticing `gen_init_cpio.c` and `gen_initramfs.sh` being moved, it seems, along with related build and documentation updates. Based on this, and based on my deep understanding of the kernel build process, I can quickly conclude that none of these changes impact the compiled kernel image (`vmlinux`) or any kernel modules. This is all strictly within the realm of documentation, build-time tools, and user-space utilities. No core kernel logic is being touched. This is a pretty straightforward refactoring of build-time tools. Therefore, this means this patch set does not warrant fuzzing. There's simply no new attack surface being introduced that would benefit from fuzzing efforts. The `WorthFuzzing` flag should be set to `false`. I also see no reason to select specific kernel symbols for targeted fuzzing, so `FocusSymbols` remains an empty list. Furthermore, I don't need to enable or disable any specific kernel configurations, so `EnableConfigs` will also be empty. My reasoning is straightforward: the patch series is fundamentally about moving host-side tools, `gen_init_cpio` and `gen_initramfs.sh`, and the associated documentation, build system adjustments, and self-tests, without touching any compiled kernel runtime code. Time to call `set-results`. |
| 6/2 | 2026/09/27 15:09 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch series relocates build-time host utility `gen_init_cpio` and helper script `gen_initramfs.sh` from `usr/` to `scripts/`, updating Makefiles, Documentation, MAINTAINERS, and selftest references accordingly. No executable kernel runtime code (vmlinux or modules) is added or modified.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series relocates build-time host utility `gen_init_cpio` and helper script `gen_initramfs.sh` from `usr/` to `scripts/`, updating Makefiles, Documentation, MAINTAINERS, and selftest references accordingly. No executable kernel runtime code (vmlinux or modules) is added or modified.",
"WorthFuzzing": false
} |
| 7/1 | 2026/09/27 15:09 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|