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  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 20 Mar 2014 23:00:45 +0100
From:	Alexander Holler <>
Cc:	Andrew Morton <>,
	Alexander Holler <>
Subject: [PATCH v2] initramfs: print error and shell out for unsupported content

The initramfs generation is broken for file and directory names which contain
colons or spaces. Print an error and don't try to continue.


cd linux
make defconfig
echo 'CONFIG_BLK_DEV_INITRD=y' >> .config
echo 'CONFIG_INITRAMFS_ROOT_UID=0' >>.config
echo 'CONFIG_INITRAMFS_ROOT_GID=0' >>.config
echo 'CONFIG_INITRAMFS_SOURCE="/tmp/bugroot"' >>.config

Problem with colons:

mkdir -p /tmp/bugroot/a:b
make -j4 bzImage # no error
make bzImage # try again, oops

Problem with spaces:

mkdir -p /tmp/bugroot/a\ b
make -j4 bzImage # no error
zcat usr/initramfs_data.cpio.gz | cpio --extract --list # oops, no content

Signed-off-by: Alexander Holler <>
 Silly and trivial changes in v2: Fixed a typo and added 'colons and spaces'

 scripts/ | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/scripts/ b/scripts/
index 17fa901..8f4c145 100644
--- a/scripts/
+++ b/scripts/
@@ -171,6 +171,18 @@ dir_filelist() {
 	${dep_list}header "$1"
 	srcdir=$(echo "$1" | sed -e 's://*:/:g')
+	# Files and directories with spaces and colons are unsupported.
+	local unsupported=$(find "${srcdir}" -regex '.*\(:\| \).*')
+	if [ ! -z "${unsupported}" ]; then
+		printf "ERROR: Unable to handle files/directories with " >&2
+		printf "unsupported characters (spaces and colons).\n" >&2
+		printf "Please use other ways to generate a cpio-archive. " >&2
+		printf "Unsupported files and directories are:\n" >&2
+		printf "$unsupported\n" >&2
+		exit 1
+	fi
 	dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n")
 	# If $dirlist is only one line, then the directory is empty

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists