[Bug 328334] Re: cpio does not exit non-zero when errors encountered, mkinitramfs masks error codes

Kees Cook kees at ubuntu.com
Thu Feb 12 01:29:14 UTC 2009


** Bug watch added: Debian Bug tracker #514938
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514938

** Also affects: initramfs-tools (Debian) via
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514938
   Importance: Unknown
       Status: Unknown

** Changed in: initramfs-tools (Ubuntu)
   Importance: Undecided => Medium

** Description changed:

  Binary package hint: cpio
  
  It seems that cpio does not actually use the error codes it sets while
  running, and always exits with 0.  This will break anything that expects
- cpio to fail if it encounter problems.  This is especially a problem for update-initramfs:
+ cpio to fail if it encounters problems.  This is especially a problem for update-initramfs:
  
  from mkinitramfs:
  (cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}") || exit 1
  
  Basically, this would only fail if there was a problem writing outfile,
  and doesn't fail if there are problems dereferencing symlinks.  As a
  result, totally broken initramfs images can be created if things happen
  to be missing from the filesystem (there was a system that built
  initramfs images while /sbin/udevadm was missing, e.g.).
  
  Additionally, the pipe to gzip causes any error codes from cpio to be
  ignored.

-- 
cpio does not exit non-zero when errors encountered, mkinitramfs masks error codes
https://bugs.launchpad.net/bugs/328334
You received this bug notification because you are a member of Kernel
Bugs, which is subscribed to initramfs-tools in ubuntu.




More information about the kernel-bugs mailing list