stderred icon indicating copy to clipboard operation
stderred copied to clipboard

FYI: libstderred.so breaks update-initramfs, yielding unbootable kernel images

Open jefft opened this issue 7 years ago • 2 comments

Not sure if this is libstderred.so's fault, but just FYI: use of libstderred.so can result in an unbootable computer:

https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1729836

Specifically, if you:

  • Use libstderred.so via LD_PRELOAD in ~/.bashrc
  • Become root via 'sudo -sE', preserving your environment (I habitually do this to preserve SSH agent forwarding).
  • Manually 'apt-get update', which happens to involve a kernel update

..then the update-initramfs script will run as a postinst hook. update-initramfs really does not like libstderred.so. Output goes red halfway, and the generated initrd file will contain binary files with ANSI color codes embedded. After a reboot the kernel sees all this and panics.

There's probably something I could add to STDERRED_BLACKLIST but I can't figure out what (I tried update-initramfs, mkinitramfs and bash without success).

LD_PRELOAD is such a glorious footgun :)

jefft avatar Jan 19 '18 05:01 jefft

Using this globally seems like a really bad idea...

twilligon avatar Feb 20 '19 04:02 twilligon