lofi_uncompress doesn't initialize all variables
cmd - userland programs
lofiadm started failing to decompress certain images on SmartOS. e.g.:
# cp /usr.lgz /var/tmp/foo.lgz # cd /var/tmp # lofiadm -U foo.lgz lofiadm: could not map file /var/tmp/foo.lgz: Invalid argument <pre> Jerry gave the following analysis: lofi_uncompress is passing in a struct lofi_ioctl that is allocated on the stack (and thus filled with garbage). In the kernel lofi_map_file is calling lofi_init_crypto which looks at a bunch of the garbage fields in the lofi_ioctl struct and since the values are invalid, errors out.