<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/scripts/gen_init_cpio.c, branch master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/scripts/gen_init_cpio.c?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/scripts/gen_init_cpio.c?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2026-10-07T10:11:14Z</updated>
<entry>
<title>gen_init_cpio: stop parsing on lines with a missing argument list</title>
<updated>2026-10-07T10:11:14Z</updated>
<author>
<name>Leizhen Zhang</name>
<email>lzsx618@gmail.com</email>
</author>
<published>2026-10-05T08:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=c8dd1aa0274d8ad3df82ec1b064065f410ce99ed'/>
<id>urn:sha1:c8dd1aa0274d8ad3df82ec1b064065f410ce99ed</id>
<content type='text'>
When a line in the cpio list consists of a file type followed only by
whitespace and no newline (e.g. "slink " as the last line of the file),
strtok(NULL, "\n") returns NULL. main() prints an error and sets ec, but
then carries on and passes the NULL args pointer to the type handler,
which hands it to sscanf() and crashes:

  AddressSanitizer: SEGV on unknown address 0x000000000000
    #4 __isoc99_sscanf
    #5 cpio_mkslink_line usr/gen_init_cpio.c:169

Break out of the loop as is already done for the other format error, so
that the error is reported and gen_init_cpio exits with a failure status.

Found by fuzzing gen_init_cpio built with ASan/UBSan.

Reproducer:
  printf 'slink ' &gt; list &amp;&amp; usr/gen_init_cpio list

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by: Claude:claude-opus-5-5 ASan UBSan
Signed-off-by: Leizhen Zhang &lt;lzsx618@gmail.com&gt;
Link: https://patch.msgid.link/20261005085729.872402-1-lzsx618@gmail.com
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
</content>
</entry>
<entry>
<title>kbuild: Move gen_init_cpio and gen_initramfs.sh to scripts/</title>
<updated>2026-09-29T20:40:23Z</updated>
<author>
<name>Nicolas Schier</name>
<email>nsc@kernel.org</email>
</author>
<published>2026-09-28T17:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=33bef82263082e81406ef5662de2900e24038a78'/>
<id>urn:sha1:33bef82263082e81406ef5662de2900e24038a78</id>
<content type='text'>
gen_init_cpio and gen_initramfs.sh are part of kbuild and required for
all kernel builds w/ CONFIG_BLK_DEV_INITRD.  Move both to scripts/ to be
more clear about their importance.

Link: https://lore.kernel.org/all/aSdrCFkUQup3qb-q@derry.ads.avm.de/
Reviewed-by: Thomas Weißschuh &lt;thomas.weissschuh@linutronix.de&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Signed-off-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Link: https://patch.msgid.link/20260928-move-gen_init_cpio-to-scripts-v4-2-f437a33c40ac@kernel.org
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
</content>
</entry>
</feed>
