Bug 1884149 - dracut generates broken initramfs images when /etc/ld.so.preload contains a non-existing library
Summary: dracut generates broken initramfs images when /etc/ld.so.preload contains a n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dracut
Version: 8.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Lukáš Nykrýn
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-01 07:54 UTC by Renaud Métrich
Modified: 2021-05-18 15:03 UTC (History)
3 users (show)

Fixed In Version: dracut-049-129.git20210107.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 15:02:47 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github dracutdevs dracut pull 936 0 None closed dracut-install: ignore bogus preload libs 2021-02-09 16:22:41 UTC

Description Renaud Métrich 2020-10-01 07:54:16 UTC
This bug was initially created as a copy of Bug #1884147

I am copying this bug because: 

Also applies to RHEL 8.


Description of problem:

When specifying a non-existing library in /etc/ld.so.preload, dracut generates a broken initramfs image, containing everything except a few binaries which are symlinks to other binaries, e.g.:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
lrwxrwxrwx   1 root     root            4 Feb 28  2020 usr/bin/awk -> gawk
lrwxrwxrwx   1 root     root           16 Feb 28  2020 usr/sbin/halt -> ../bin/systemctl
lrwxrwxrwx   1 root     root           11 Feb 28  2020 usr/sbin/ping -> ../bin/ping
lrwxrwxrwx   1 root     root           14 Feb 28  2020 usr/sbin/udevadm -> ../bin/udevadm
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This prevents the system from booting.


Version-Release number of selected component (if applicable):

dracut from RHEL 7 and RHEL 8


How reproducible:

Always


Steps to Reproduce:
1. Create /etc/ld.so.preload with a non-existing library

  # echo "/lib64/libfoo.so" > /etc/ld.so.preload

2. Build the initramfs

  # dracut /tmp/initramfs.img $(uname -r)

3. Compare with the good one in /boot

  # diff -u /tmp/initramfs.img $(uname -r).img /boot/initramfs-$(uname -r).img

Actual results:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
+lrwxrwxrwx   1 root     root            4 Feb 28  2020 usr/bin/awk -> gawk
+lrwxrwxrwx   1 root     root           16 Feb 28  2020 usr/sbin/halt -> ../bin/systemctl
+lrwxrwxrwx   1 root     root           11 Feb 28  2020 usr/sbin/ping -> ../bin/ping
+lrwxrwxrwx   1 root     root           14 Feb 28  2020 usr/sbin/udevadm -> ../bin/udevadm
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Output may vary.


Expected results:

All files included and symlinks created

Additional info:

Running dracut in debug shows "dracut-install" is failing but reporting success anyway:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
dracut-install: Handle 'ping'
dracut-install: find_binary(ping) == /usr/sbin/ping
dracut-install: find_binary(ping) == /usr/bin/ping
dracut-install: dracut_install '/usr/sbin/ping'
dracut-install: dracut_install('/usr/sbin/ping', '/usr/sbin/ping')
dracut-install: dracut_install('/usr/bin/ping', '/usr/bin/ping')
ERROR: ld.so: object '/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
dracut-install: ldd: 'ERROR: ld.so: object '/lib64/libfoo.so' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
dracut-install: '
dracut-install: dracut_install('/lib64/libfoo.so'', '/lib64/libfoo.so'')
...
dracut-install: cp '/usr/bin/ping' '/var/tmp/dracut.yEP3o0/initramfs/usr/bin/ping'
dracut-install: dracut_install ret = 2
dracut-install: '/usr/bin/ping' install error
dracut-install: dracut_install '/usr/bin/ping'
dracut-install: dracut_install('/usr/bin/ping', '/usr/bin/ping')
dracut-install: hash hit items for '/usr/bin/ping'
dracut-install: dracut_install '/usr/bin/ping' OK
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 7 errata-xmlrpc 2021-05-18 15:02:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dracut bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1661


Note You need to log in before you can comment on or make changes to this bug.