panic=-1 is completely ignored by the initrd causing unexpected behaviour
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Unassigned | ||
Disco |
Fix Released
|
Medium
|
Unassigned | ||
Eoan |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
in Ubuntu Core we default to using panic=-1 on the kernel command line (documented at [1]) to speed up the auto-rollback mechanism of the kernel. on a kernel level this works just fine and the system reboots immediately ...
when in the initramfs during boot and a panic occurs, no reboot happens at all, the initrd spawns a shell regardless of the panic= value ...
[Test case]
Before booting change root=$foo to root=x$foo - this will make it panic. Then test that
1) "panic=-1" causes an immediate reboot
2) "panic=5" waits 5 seconds
3) no "panic" drops you to a shell
[Regression potential]
This adds some very specific checks for -1 in places that use ${panic}, as such the regression potential is somewhat limited. If there were a regression, it could be a syntax error (causing boot to fail) or a sleep not working correctly (causing sleep to, well, not sleep) - but that's unrealistic.
[Other info]
this is caused by a filter in /usr/share/
panic=*)
;;
this function only lets positive values through, else panic= simply gets unset
the panic() function itself is also not capable of handling negative values, it has a sleep call that interprets negative values as commandline options instead of simply ignoring a negative sleep time [2] (line 11).
the filter in the init script should allow the -1 value (to comply with the kernel documentation and behaviour) and the panic() function should properly skip the sleep call when a negative value for panic= is set.
[1] https:/
[2] https:/
tags: | added: rls-ee-incoming |
Changed in initramfs-tools (Ubuntu): | |
importance: | Undecided → Medium |
Changed in initramfs-tools (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in initramfs-tools (Ubuntu Bionic): | |
importance: | Undecided → Medium |
tags: | removed: rls-ee-incoming |
tags: | added: id-5cf9304627a12b717bdbab7a |
description: | updated |
Changed in initramfs-tools (Ubuntu Disco): | |
status: | New → In Progress |
Changed in initramfs-tools (Ubuntu Disco): | |
importance: | Undecided → Medium |
targeting to xenial and bionic since we need this SRUed for Ubuntu Core installs.