Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jefft opened this issue Jan 19, 2018 · 2 comments

Comments

@jefft
Copy link

jefft commented Jan 19, 2018

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 :)

@milkey-mouse
Copy link

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

@devnoname120
Copy link

Did you try to add update-initramfs to the STDERRED_BLACKLIST environment variable?

See:
https://github.com/ku1ik/stderred/blob/97a51c97f757d3a23efc90b15bf95d5af632c8f8/src/stderred.c#L44C28-L52

If it solves the issue then I'd suggest you do a pull request to exclude it by default just like we already do for bash,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants