machine get stuck at boot if specified 'console=ttyS* ' doesn't exist.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools (Ubuntu) |
Fix Released
|
High
|
Guilherme G. Piccoli | ||
Trusty |
Won't Fix
|
Low
|
Guilherme G. Piccoli | ||
Xenial |
Fix Released
|
High
|
Guilherme G. Piccoli | ||
Bionic |
Fix Released
|
High
|
Guilherme G. Piccoli | ||
Eoan |
Won't Fix
|
Low
|
Guilherme G. Piccoli | ||
Focal |
Fix Released
|
High
|
Guilherme G. Piccoli | ||
Groovy |
Fix Released
|
High
|
Guilherme G. Piccoli |
Bug Description
[Impact]
* Currently, if users provide the wrong console in kernel command-line (like console=ttyS1, when the right one is ttyS0) *and* "quiet" parameter is not provided, we may face an infinite loop on initramfs-tools, effectively blocking the boot.
* Details are: the _log_msg() functions is "void" typed, which means it returns whatever its last command returns; this function is the basic building block for all error/warning messages in initramfs-tools. In case a bad console was provided to kernel on command-line, printf (and apparently all write()-related functions) returns error, and so this error is carried over in _log_msg().
* Happens that checkfs() function has a loop that runs forever in this scenario (*if* fsck is not present in initramfs, and obviously if "quiet" is not provided in the command-line). The situation is easily reproducible.
* This SRU proposes a pretty simple fix: return zero on _log_msg(). We should definitely not brake the boot due to error log functions.
[Test Case]
* To reproduce this, one must boot a system (virtual machine is good) with the wrong console set on kernel command-line through the "console=" parameter *and* not pass the "quiet" parameter.
* Also, e2fsck tool shouldn't be present in the initrd - for that, the 6th field of /etc/fstab (fs_passno) should be 0 and initrd must be recreated after that. This is the default in Ubuntu, though.
[Regression Potential]
* The regression potential is small, we're just returning 0 after a printf that is executed in error paths, so I don't expect any issues from that. But in case something bad happens after this change, I expect a more friendly" breakage, like an initramfs panic (drop to a shell), not a silent failure or boot-loop.
tags: | added: seg sts |
description: | updated |
description: | updated |
description: | updated |
Changed in linux (Ubuntu): | |
assignee: | nobody → Guilherme G. Piccoli (gpiccoli) |
importance: | Undecided → Medium |
status: | New → Confirmed |
description: | updated |
Changed in linux (Ubuntu): | |
importance: | Medium → High |
summary: |
- kernel get stuck at boot if specified 'console=ttyS* ' doesn't exist. + machine get stuck at boot if specified 'console=ttyS* ' doesn't exist. |
Changed in linux (Ubuntu): | |
status: | Confirmed → Incomplete |
Changed in initramfs-tools (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → Guilherme G. Piccoli (gpiccoli) |
no longer affects: | linux (Ubuntu) |
Changed in initramfs-tools (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in initramfs-tools (Ubuntu Eoan): | |
status: | New → Won't Fix |
Changed in initramfs-tools (Ubuntu Trusty): | |
status: | New → Won't Fix |
Changed in initramfs-tools (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in initramfs-tools (Ubuntu Bionic): | |
status: | New → In Progress |
Changed in initramfs-tools (Ubuntu Focal): | |
status: | New → In Progress |
Changed in initramfs-tools (Ubuntu Trusty): | |
importance: | Undecided → High |
Changed in initramfs-tools (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in initramfs-tools (Ubuntu Trusty): | |
importance: | High → Low |
Changed in initramfs-tools (Ubuntu Bionic): | |
importance: | Undecided → High |
Changed in initramfs-tools (Ubuntu Focal): | |
importance: | Undecided → High |
Changed in initramfs-tools (Ubuntu Eoan): | |
importance: | Undecided → Low |
Changed in initramfs-tools (Ubuntu Focal): | |
assignee: | nobody → Guilherme G. Piccoli (gpiccoli) |
Changed in initramfs-tools (Ubuntu Eoan): | |
assignee: | nobody → Guilherme G. Piccoli (gpiccoli) |
Changed in initramfs-tools (Ubuntu Bionic): | |
assignee: | nobody → Guilherme G. Piccoli (gpiccoli) |
Changed in initramfs-tools (Ubuntu Xenial): | |
assignee: | nobody → Guilherme G. Piccoli (gpiccoli) |
Changed in initramfs-tools (Ubuntu Trusty): | |
assignee: | nobody → Guilherme G. Piccoli (gpiccoli) |
description: | updated |
tags: | added: sts-sponsor-mfo |
I've managed to reproduce in 4.4, 4.15, 5.4 (all from Ubuntu releases) and 5.7-rc4-next; also, I think bare-metal usually doesn't reproduce.
Seems like a live-lock situation, I'll attach some calltraces I gathered using sysrqs.
Cheers,
Guilherme