Package: genext2fs
Version: 1.4.1-2.2
Severity: serious
Tags: patch
Justification: FTBFS

Hello,

genext2fs currently FTBFS because it segfaults in the testsuite. This is
apparently due to a bug in the swapping code. The comment

This is benign as 0 means block 0 which has been zeroed out and
therefore points back to itself from any offset

apparently is wrong: in at least some of the tests, block 0 is actually
the superblock, which is not zero, but contains precious data!! The
attached patch fixes this by checkout for block number 0 (which means
that i_blocks indeed included the indirection blocks).

Samuel

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.4 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages genext2fs depends on:
ii  libc6  2.13-18

genext2fs recommends no packages.

genext2fs suggests no packages.

-- no debconf information

-- 
Samuel Thibault <samuel.thiba...@fnac.net>
 SL> Au fait elle est mieux ma signature maintenant ?
 Oui. T'enlève encore les conneries que t'as écrit dedans et c'est bon.
 -+- JB in <http://neuneu.mine.nu> : Le neueuttoyage par le vide -+-
--- genext2fs.c.orig    2011-10-08 22:51:58.000000000 +0000
+++ genext2fs.c 2011-10-08 23:37:19.000000000 +0000
@@ -1779,7 +1779,8 @@
        assert(nod->i_block[EXT2_DIND_BLOCK] != 0);
        for(i = 0; i < BLOCKSIZE/4; i++)
                if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i )
-                       swap_block(get_blk(fs, ((uint32*)get_blk(fs, 
nod->i_block[EXT2_DIND_BLOCK]))[i]));
+                       if (((uint32*)get_blk(fs, 
nod->i_block[EXT2_DIND_BLOCK]))[i])
+                               swap_block(get_blk(fs, ((uint32*)get_blk(fs, 
nod->i_block[EXT2_DIND_BLOCK]))[i]));
        swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]));
        if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
                return;
@@ -1792,7 +1793,8 @@
                                     (BLOCKSIZE/4)*(BLOCKSIZE/4) + 
                                     i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + 
                                     j*(BLOCKSIZE/4)) ) 
-                         swap_block(get_blk(fs,b2[j]));
+                         if (b2[j])
+                               swap_block(get_blk(fs,b2[j]));
                        else {
                          done = 1;
                          break;
@@ -1825,7 +1827,8 @@
        swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]));
        for(i = 0; i < BLOCKSIZE/4; i++)
                if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i )
-                       swap_block(get_blk(fs, ((uint32*)get_blk(fs, 
nod->i_block[EXT2_DIND_BLOCK]))[i]));
+                       if (((uint32*)get_blk(fs, 
nod->i_block[EXT2_DIND_BLOCK]))[i])
+                               swap_block(get_blk(fs, ((uint32*)get_blk(fs, 
nod->i_block[EXT2_DIND_BLOCK]))[i]));
        if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4)
                return;
        /* Adding support for triple indirection */
@@ -1839,7 +1842,8 @@
                                     (BLOCKSIZE/4)*(BLOCKSIZE/4) + 
                                     i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + 
                                     j*(BLOCKSIZE/4)) ) 
-                         swap_block(get_blk(fs,b2[j]));
+                         if (b2[j])
+                               swap_block(get_blk(fs,b2[j]));
                        else {
                          done = 1;
                          break;

Reply via email to