crash while checking MD5sums on jigdo include list

Bug #130376 reported by Colin Watson
2
Affects Status Importance Assigned to Milestone
cdrkit (Debian)
Fix Released
Unknown
cdrkit (Ubuntu)
Fix Released
High
Unassigned
Edgy
Invalid
Undecided
Unassigned
Feisty
Fix Released
High
Colin Watson
Gutsy
Fix Released
High
Unassigned
cdrtools (Ubuntu)
Invalid
Undecided
Unassigned
Edgy
Fix Released
High
Unassigned
Feisty
Invalid
Undecided
Unassigned
Gutsy
Invalid
Undecided
Unassigned

Bug Description

The build machine behind cdimage.ubuntu.com was recently upgraded to edgy/amd64. While testing the new system, I found that mkisofs segfaulted while trying to build Ubuntu alternate install CD images. Investigation showed that this is due to incorrect linked list code used while constructing the JTE include and exclude lists for jigdo file generation. This is unlikely to affect normal users of mkisofs, but affects those trying to build Debian or Ubuntu CD images. I would like to propose this for a stable release update in order to fix Ubuntu's production CD image building system without the need for a local build of mkisofs.

This is also Debian bug 411873, and I've sent a patch there to fix the linked list generation. I have applied this patch in cdrkit 9:1.1.6-1ubuntu1 in gutsy. Corresponding patches against edgy and feisty are attached here.

Since the crash is rather dependent on precise details of stack layout, it's not necessarily easy to reproduce directly. However, valgrind picks it up with no trouble. Steps to reproduce on an edgy system with mkisofs and valgrind installed (for feisty and gutsy, substitute "genisoimage" for "mkisofs" throughout:

  mkdir -p /tmp/mkisofs-test
  cd /tmp/mkisofs-test
  mkdir -p t/pool
  dd if=/dev/zero of=t/file bs=1024 count=100
  touch md5
  valgrind mkisofs -o t.iso -jigdo-jigdo t.jigdo -jigdo-template t.template -md5-list md5 -jigdo-force-md5 /pool/ t

The output will contain an error similar to the following (exact numbers are unimportant):

  ==8624== Conditional jump or move depends on uninitialised value(s)
  ==8624== at 0x42BB38: (within /usr/bin/mkisofs)
  ==8624== by 0x40E7D6: (within /usr/bin/mkisofs)
  ==8624== by 0x40EBD9: (within /usr/bin/mkisofs)
  ==8624== by 0x40460E: main (in /usr/bin/mkisofs)
  ==8624== by 0x4C570C3: (below main) (in /lib/libc-2.4.so)

The patch affects only JTE code, so (barring regressions due simply to rebuilding cdrtools), other uses of mkisofs will not be affected. Typical uses of mkisofs to build simple ISO images from a tree of files on disk do not use JTE; it is an advanced feature for use by distributors of heavily-downloaded ISO images.

Revision history for this message
Colin Watson (cjwatson) wrote :

cdrkit (9:1.1.6-1ubuntu1) gutsy; urgency=low

  * Always initialise next pointer of jigdo include and exclude list
    structures (LP: #130376).

 -- Colin Watson <email address hidden> Sat, 04 Aug 2007 16:16:40 +0100

Changed in cdrtools:
status: New → Invalid
status: New → Invalid
Changed in cdrkit:
status: New → Invalid
status: New → Fix Released
description: updated
Revision history for this message
Colin Watson (cjwatson) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :
Changed in cdrkit:
importance: Undecided → High
Changed in cdrtools:
importance: Undecided → High
Changed in cdrkit:
importance: Undecided → High
description: updated
Revision history for this message
Colin Watson (cjwatson) wrote :

(I'm suggesting both Edgy and Feisty SRUs as, while the problem we have in production is currently on Edgy, we might in the future upgrade to Feisty and I'd rather have the security of knowing that we won't have to work around this problem there if we do.)

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks, Colin! The patch makes perfect sense. Edgy's patch is fine as it is. Can you please do the XSBC-Original-Maintainer: dance for feisty?

Please go ahead and upload.

Changed in cdrkit:
assignee: nobody → kamion
status: New → In Progress
Changed in cdrkit:
status: Unknown → New
Revision history for this message
Colin Watson (cjwatson) wrote :

Both uploaded, including the Maintainer change for feisty-proposed.

Changed in cdrtools:
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

cdrkit accepted into feisty-proposed, please go ahead with QA testing.

Changed in cdrkit:
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

cdrtools accepted into edgy-proposed, please go ahead with QA testing.

Changed in cdrtools:
status: In Progress → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

cdrkit (9:1.1.2-1ubuntu1) feisty-proposed; urgency=low

  * Always initialise next pointer of jigdo include and exclude list
    structures (LP: #130376).

 -- Colin Watson <email address hidden> Fri, 10 Aug 2007 10:56:23 +0100

Revision history for this message
Colin Watson (cjwatson) wrote :

cdrtools (4:2.01+01a03-5ubuntu3) edgy-proposed; urgency=low

  * debian/patches/34_JTE.dpatch:
    - Always initialise next pointer of jigdo include and exclude list
      structures (LP: #130376).

 -- Colin Watson <email address hidden> Sat, 04 Aug 2007 16:18:54 +0100

Changed in cdrkit:
status: Fix Committed → Fix Released
Changed in cdrtools:
status: Fix Committed → Fix Released
Martin Pitt (pitti)
Changed in cdrkit:
status: Fix Released → Fix Committed
Changed in cdrtools:
status: Fix Released → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

I've asked the Canonical sysadmins to upgrade mkisofs on our build system to this version so that we can test it there.

Revision history for this message
Colin Watson (cjwatson) wrote :

ii mkisofs 2.01+01a03-5ubuntu4 Creates ISO-9660 CD-ROM filesystem images

We used this for the 7.10 release builds on antimony ... I'd say that's verified!

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to -updates.

Changed in cdrtools:
status: Fix Committed → Fix Released
Changed in cdrkit:
status: Fix Committed → Fix Released
Changed in cdrkit:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.