lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Sep 2016 09:24:14 +0200
From:   Michal Marek <mmarek@...e.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     linux-kernel@...r.kernel.org, sam@...nborg.org, mmarek@...e.cz,
        joe@...ches.com, lede-dev@...ts.infradead.org,
        openwrt-devel@...ts.openwrt.org
Subject: Re: gen_initramfs_list.sh escaping problem or stale dependency file?

On Mon, Sep 12, 2016 at 05:12:15PM -0700, Florian Fainelli wrote:
> Hi,
> 
> I have a root filesystem embedding filenames that look like these:
> 
> /lib/data/<vid>:<pid>
> 
> these are essentially files that can be matched against an USB
> vendor/product id in an easy way.
> 
> Now, the fun part is that this is only a problem when doing the
> following (using OpenWrt/LEDE as a build system):
> 
> 1:
> - set CONFIG_INITRAMFS_SOURCE=""
> - build kernel modules
> - build my user-space tools
> - build the kernel image
> - reconfigure the kernel to now use an initramfs
> - build the kernel w/ initramfs
> 
> and then back to step 1 with the kernel build, would I hit this error:
> 
> usr/Makefile:64: *** multiple target patterns.  Stop.
[...]
> Which sorts of make sense here because the file name contains a ":"
> which is not escaped, so GNU Make tries to interpret it.
> 
> Now the part that does not quite make sense to me is why this file is
> even relevant here considering that the first thing we do is set
> CONFIG_INITRAMFS_SOURCE="" to disable the initramfs basically.

It is possible that we read usr/Makefile twice for some reason. But the
real problem is the lack of escaping. Can you try the following
(untested) patch?


diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 17fa901418ae..5d3188e74101 100755
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -97,7 +97,10 @@ print_mtime() {
 }
 
 list_parse() {
-	[ ! -L "$1" ] && echo "$1 \\" || :
+	if [ -L "$1" ]; then
+		return
+	fi
+	echo "$1" | sed 's/\([:%]\)/\\\1/g; s/$/ \\/'
 }
 
 # for each file print a line in following format

Thanks,
Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ