Bug #5104
closedreboot should check for (and remove) extra -B zfs-bootfs options.
100%
Description
background: if /lib/svc/method/fs-usr fails to run bootadm update-archive for any reason, it will use eeprom bootcmd to get arguments for reboot -f, and reboots the system.
the problem is that reboot command will verify the provided arguments in parse_fastboot_args(), in process it will construct new -B zfs-bootfs=... and it will inject this in between kernel and remaining options. the resulting string is passed then to uadmin(). in case of repeated boots the argument list will grow too long for uadmin (and there will be memory corruption in reboot command):
mdep = /platform/i86pc/kernel/amd64/unix -B zfs-bootfs=rpool/ROOT/hipster-4,bootpath="/pci@0,0/pci15ad,1976@10/sd@0,0:b" -B zfs-bootfs=rpool/ROOT/hipster-4,bootpath="/pci@0,0/pci15ad,1976@10/sd@0,0:b" -B zfs-bootfs=rpool/287,bootpath="/pci@0,0/pci15ad,1976@10/sd@0,0:b",diskdevid="id1,sd@n6000c296ec96a302dff57c7f7d6ce73a/b"]^E^H
reboot: uadmin failed: File name too long
(the looping reboot is another issue, perhaps the more appropriate action in this case would be boot to single user mode so admin will have chance to fix the issue).
to reproduce, grab an eeprom bootcmd output and use the value with reboot -f
Updated by Electric Monk almost 9 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 9e573dcc6440324d76c37be570afdef86f045685
commit 9e573dcc6440324d76c37be570afdef86f045685 Author: Toomas Soome <tsoome@me.com> Date: 2014-11-25T15:15:39.000Z 5104 reboot should check for (and remove) extra -B zfs-bootfs options. Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com> Approved by: Gordon Ross <gwr@nexenta.com>