Project

General

Profile

Actions

Bug #5104

closed

reboot should check for (and remove) extra -B zfs-bootfs options.

Added by Toomas Soome about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2014-08-19
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
External Bug:

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

Actions

Also available in: Atom PDF