20 Nov, 2017

1 commit

  • Some fixes when reading EXT files and directory entries were identified
    after using e2fuzz to corrupt an EXT3 filesystem:

    - Stop reading directory entries if the offset becomes badly aligned.

    - Avoid overwriting memory by clamping the length used to zero the buffer
    in ext4fs_read_file. Also sanity check blocksize.

    Signed-off-by: Ian Ray
    Signed-off-by: Martyn Welch
    Reviewed-by: Stefano Babic

    Ian Ray
     

06 Oct, 2017

2 commits

  • As reported by Coverity, we did not free dirnode in the case of failure.
    Do so now.

    Reported-by: Coverity (CID: 131221)
    Cc: Stefan Brüns
    Signed-off-by: Tom Rini

    Tom Rini
     
  • The current code doesn't compute the group descriptor checksum correctly
    for the filesystems that e2fsprogs 1.43.4 creates (they have
    'Group descriptor size: 64' as reported by tune2fs). Extend the checksum
    calculation to be done as ext4_group_desc_csum() does in Linux.

    This fixes these errors in dmesg from running fs-test.sh and makes it
    succeed again:

    [1671902.620699] EXT4-fs (loop1): ext4_check_descriptors: Checksum for group 0 failed (35782!=10965)
    [1671902.620706] EXT4-fs (loop1): group descriptors corrupted!

    Signed-off-by: Tuomas Tynkkynen

    Tuomas Tynkkynen
     

03 Oct, 2017

1 commit

  • The ext4, reiserfs and zfs filesystems all have their own implementation
    of the same function, *_devread. Generalize this function into fs_devread
    and put the code into fs/fs_internal.c.

    Signed-off-by: Marek Behun
    [trini: Move fs/fs_internal.o hunk to the end of fs/Makefile as all
    cases need it]
    Signed-off-by: Tom Rini

    Marek Behún
     

27 Aug, 2017

1 commit

  • While &p_jdb[fs->blksz] is a valid expression (it points *one* char
    sized element past the end of the array, e.g. &p_jdb[fs->blksz + 1] is
    invalid (according to the C standard (C99/C11)).

    Changing this to tag = (struct ext3_journal_block_tag *)(p_jdb + ofs);

    Cc: Stefan Brüns
    Suggested-by: Stefan Brüns
    Reported-by: Coverity (CID: 165117, 165110)
    Signed-off-by: Tom Rini
    Reviewed-by: Stefan Brüns

    Tom Rini
     

28 Apr, 2017

1 commit

  • In file ext4fs.c funtion ext4fs_read_file() compares an
    unsigned expression with < 0 like below

    lbaint_t blknr;
    blknr = read_allocated_block(&(node->inode), i);
    if (blknr < 0)
    return -1;

    blknr is of type ulong/uint64_t. read_allocated_block() returns
    long int. So comparing blknr with < 0 will always be false. Instead
    declare blknr as long int.

    Similarly ext4/dev.c does a similar comparison. Drop the redundant
    comparison.

    Signed-off-by: Lokesh Vutla
    Reviewed-by: Tom Rini

    Lokesh Vutla
     

28 Dec, 2016

1 commit


22 Nov, 2016

2 commits


24 Oct, 2016

3 commits


24 Sep, 2016

1 commit


23 Sep, 2016

26 commits


05 Aug, 2016

1 commit

  • With e2fsprogs after 1.43 the 64bit and metadata_csum features are
    enabled by default. The metadata_csum feature changes how
    ext4_group_desc->bg_checksum is calculated, which would break write
    support. The 64bit feature however introduces changes such that it
    cannot be read by implementations that do not support it. Since we do
    not support this, we must not mount it.

    Cc: Stephen Warren
    Cc: Simon Glass
    Cc: Lukasz Majewski
    Cc: Stefan Roese
    Reported-by: Andrew Bradford
    Signed-off-by: Tom Rini

    Tom Rini