Project

General

Profile

Bug #5104

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

Added by Toomas Soome almost 6 years ago. Updated over 5 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:

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

History

#1

Updated by Electric Monk over 5 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

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>

Also available in: Atom PDF