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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 17 Aug 2018 01:34:30 +0200
From:   Bjørn Forsman <bjorn.forsman@...il.com>
To:     andrzej.p@...sung.com
Cc:     LKML <linux-kernel@...r.kernel.org>, forney@...gle.com,
        Masahiro Yamada <yamada.masahiro@...ionext.com>
Subject: Re: [PATCH] Revert "kbuild: create deterministic initramfs directory listings"

On Thu, 16 Aug 2018 at 18:18, Andrzej Pietrasiewicz
<andrzej.p@...sung.com> wrote:
>
> This reverts commit 9e6e0d5f2a2713402cf9dce69b9f9b516e4185d2.
>
> The reverted commit introduces broken builds. Even though the cpio archive
> does contain all the specified files, it seems that the kernel, while
> populating rootfs, scans the cpio buffer linearly and fails to create
> files whose parent directories are nonexistent at the moment of this failed
> creation. As a result, such files are not accessible when kernel boots into
> initramfs.
>
> Here is how to reproduce, from inside kernel source directory, with the
> patch in question not reverted:
>
> $ mkdir -p ../test/find/me/if/you/can
> $ touch ../test/find/me/if/you/can/file.txt
> $ cat ../initramfs.list
> file /busybox-x86_64 ../initramfs/busybox-x86_64 0755 0 0
> dir /sbin 0755 0 0
> dir /proc 0755 0 0
> dir /sys 0755 0 0
> dir /bin 0755 0 0
> dir /usr 0755 0 0
> dir /usr/sbin 0755 0 0
> dir /usr/bin 0755 0 0
> dir /etc 0755 0 0
> dir /etc/init.d 0755 0 0
> file /etc/inittab ../initramfs/inittab 0755 0 0
> file /etc/init.d/rcS ../initramfs/rcS-x86_64 0755 0 0
> dir /lib 0755 0 0
> dir /lib/modules 0755 0 0
> $ ls ../initramfs
> busybox-x86_64  inittab  rcS-x86_64
> $ cat ../initramfs/inittab
> ::sysinit:/etc/init.d/rcS
> ::askfirst:-/bin/sh
> ::ctrlaltdel:/sbin/reboot
> ::shutdown:/sbin/swapoff -a
> ::shutdown:/sbin/umount -a -r
> ::restart:/sbin/init
> $ cat ../initramfs/rcS-x86_64
> #!/busybox-x86_64 sh
>
> /busybox-x86_64 --install
>
> mount -t proc none /proc
> mount -t sysfs none /sys
>
> mdev -s
> echo /sbin/mdev > /proc/sys/kernel/hotplug
> $ scripts/gen_initramfs_list.sh ../test/ ../initramfs.list
>
> #####################
> # ../test/
> # Last modified: 1534428527.0818855150
>
> file /find/me/if/you/can/file.txt ../test/find/me/if/you/can/file.txt 664 1000 1000
> dir /find/me/if/you/can 775 1000 1000
> dir /find/me/if/you 775 1000 1000
> dir /find/me/if 775 1000 1000
> dir /find/me 775 1000 1000
> dir /find 775 1000 1000

I'm unable to reproduce it. On my system the listing is sorted so that
it works (parent directories appear before files). I tried to run with
LANG=C and it also sorts correctly. What is your LANG=? I think we
better add a LANG=C somewhere in the kernel build system, because I
think you have a LANG= that makes it sort differently. A quick fix
would of course be to insert it right next to sort, but there may be
other places that may break due to LANG= settings.

Best regards,
Bjørn Forsman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ