From 9e6e183124aa7fb581be2261c707815b4fe197c2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 8 Nov 2022 01:56:31 -0500 Subject: [PATCH] import e2fsprogs-1.45.6-5.el8 --- .e2fsprogs.metadata | 1 + .gitignore | 1 + ...-check-free-block-group-counts-when-.patch | 126 ++ ...s-specify-inode-size-in-r_corrupt_fs.patch | 43 + ...der-versions-of-timeout-in-r_corrupt.patch | 31 + ...s-blocksize-0-which-could-cause-some.patch | 100 ++ .../e2fsprogs-1.45.6-Fix-clang-warnings.patch | 104 ++ ...s-1.45.6-Makefile.in-Disable-e2scrub.patch | 38 + ...nstall-fuse2fs-in-usr-bin-instead-of.patch | 45 + ...-hide-struct-ext2fs_hashmap-as-an-in.patch | 86 + ...-revamp-bitmap-types-to-fix-LTO-warn.patch | 1421 +++++++++++++++++ ...-check-the-value-returned-by-realloc.patch | 48 + ...-return-value-of-malloc-in-argv_pars.patch | 34 + ...-xattrs-to-the-root-directory-as-wel.patch | 47 + ...le-free-in-realloc-error-path-in-rea.patch | 35 + ...ry-allocation-failures-when-parsing-.patch | 92 ++ ...fix-memory-leak-problem-in-read_list.patch | 46 + ...gfs-fix-parse_uint-for-64-bit-fields.patch | 54 + ...um-string-length-specifiers-to-fscan.patch | 42 + ...ed-dir-rehash-failure-with-metadata_.patch | 43 + ...mount-write-time-when-e2fsck-is-forc.patch | 64 + ...y-one-check-when-validating-depth-of.patch | 31 + ...size_t-instead-of-int-in-string_copy.patch | 47 + ...-fix-overflow-in-l2-table-processing.patch | 38 + ...tial-NULL-pointer-dereference-in-dup.patch | 34 + ...hange-in-the-struct_ext2_filsys-stru.patch | 51 + ...dle-invalid-st_dev-and-blksize-cases.patch | 54 + ...check-return-value-malloc-in-ss_name.patch | 33 + ...-sanity-check-to-extent-manipulation.patch | 56 + ...needlessly-byte-swap-the-group-descr.patch | 58 + ...ash-in-ext2fs_image_super_write-on-B.patch | 69 + ...ash-in-ext2fs_open2-on-Big-Endian-sy.patch | 59 + ...ash-when-ext2fs_mmp_stop-is-called-b.patch | 36 + ...correct-negative-error-return-in-uni.patch | 52 + ...tential-buffer-overrun-in-__get_dire.patch | 40 + ...gault-when-setting-an-xattr-with-an-.patch | 212 +++ ...bext2fs-fix-unexpected-NULL-variable.patch | 39 + ...emove-augmented-rbtree-functionality.patch | 118 ++ ...ext2fs_flush-to-check-if-group-descr.patch | 35 + ...dd-missing-error-handling-for-fdopen.patch | 42 + ...le-NULL-pointer-dereferece-on-alloca.patch | 36 + ...-memory-allcation-failure-in-ss_help.patch | 33 + ...otental-NULL-pointer-dereferences-in.patch | 66 + ...ther-path-is-NULL-in-lsattr_dir_proc.patch | 36 + ...ut-RHEL8-supported-features-and-moun.patch | 133 ++ ...al-segmentation-fault-problem-in-sca.patch | 35 + ...uble-quotes-when-parsing-mke2fs.conf.patch | 52 + ...eck-for-hardlinks-always-false-if-in.patch | 84 + ...discarding-a-single-block-to-test-if.patch | 57 + ...nf-Introduce-rhel6-and-rhel7-fs_type.patch | 34 + ..._DIRECT-when-working-with-regular-fi.patch | 68 + ...ount-space-used-by-project-quota-fil.patch | 39 + ...-avoid-allocating-over-the-MMP-block.patch | 41 + ...t-block-group-descriptors-from-overf.patch | 59 + ...fix-error-handling-when-memory-alloc.patch | 48 + ...tion-fix-error-handling-when-memory-.patch | 112 ++ ...tion-fix-potential-unititalized-refe.patch | 30 + ..._transaction_recover-fix-memory-leak.patch | 33 + ...-to-print-diff-output-of-failed-test.patch | 33 + ...ir-checksums-when-clearing-dir_index.patch | 284 ++++ ...gs-1.45.6-zap_sector-fix-memory-leak.patch | 37 + SPECS/e2fsprogs.spec | 1134 +++++++++++++ 62 files changed, 6089 insertions(+) create mode 100644 .e2fsprogs.metadata create mode 100644 .gitignore create mode 100644 SOURCES/0001-reisze2fs-sanity-check-free-block-group-counts-when-.patch create mode 100644 SOURCES/0001-tests-specify-inode-size-in-r_corrupt_fs.patch create mode 100644 SOURCES/0001-tests-support-older-versions-of-timeout-in-r_corrupt.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Add-checks-for-fs-blocksize-0-which-could-cause-some.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Fix-clang-warnings.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-append_pathname-check-the-value-returned-by-realloc.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-argv_parse-check-return-value-of-malloc-in-argv_pars.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-create_inode-set-xattrs-to-the-root-directory-as-wel.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-debugfs-fix-double-free-in-realloc-error-path-in-rea.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-allocation-failures-when-parsing-.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-leak-problem-in-read_list.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-debugfs-fix-parse_uint-for-64-bit-fields.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-e2fsck-add-maximum-string-length-specifiers-to-fscan.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-e2fsck-fix-indexed-dir-rehash-failure-with-metadata_.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-e2fsck-fix-off-by-one-check-when-validating-depth-of.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-e2fsck-use-size_t-instead-of-int-in-string_copy.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-e2image-fix-overflow-in-l2-table-processing.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-ext2ed-fix-potential-NULL-pointer-dereference-in-dup.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-filefrag-handle-invalid-st_dev-and-blksize-cases.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-lib-ss-error.c-check-return-value-malloc-in-ss_name.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-add-sanity-check-to-extent-manipulation.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-don-t-needlessly-byte-swap-the-group-descr.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_image_super_write-on-B.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_open2-on-Big-Endian-sy.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-when-ext2fs_mmp_stop-is-called-b.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-fix-incorrect-negative-error-return-in-uni.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-fix-potential-buffer-overrun-in-__get_dire.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-fix-segault-when-setting-an-xattr-with-an-.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-fix-unexpected-NULL-variable.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-remove-augmented-rbtree-functionality.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libext2fs-teach-ext2fs_flush-to-check-if-group-descr.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libss-Add-missing-error-handling-for-fdopen.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libss-fix-possible-NULL-pointer-dereferece-on-alloca.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libss-handle-memory-allcation-failure-in-ss_help.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-libsupport-fix-potental-NULL-pointer-dereferences-in.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-lsattr-check-whether-path-is-NULL-in-lsattr_dir_proc.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-misc-fix-potential-segmentation-fault-problem-in-sca.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-mke2fs-Escape-double-quotes-when-parsing-mke2fs.conf.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-mke2fs-fix-up-check-for-hardlinks-always-false-if-in.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-mke2fs-only-try-discarding-a-single-block-to-test-if.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-mmp-do-not-use-O_DIRECT-when-working-with-regular-fi.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-quota-Do-not-account-space-used-by-project-quota-fil.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-resize2fs-avoid-allocating-over-the-MMP-block.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-resize2fs-prevent-block-group-descriptors-from-overf.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-ss_add_info_dir-fix-error-handling-when-memory-alloc.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-error-handling-when-memory-.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-potential-unititalized-refe.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-tdb_transaction_recover-fix-memory-leak.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-tests-Add-option-to-print-diff-output-of-failed-test.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-tune2fs-update-dir-checksums-when-clearing-dir_index.patch create mode 100644 SOURCES/e2fsprogs-1.45.6-zap_sector-fix-memory-leak.patch create mode 100644 SPECS/e2fsprogs.spec diff --git a/.e2fsprogs.metadata b/.e2fsprogs.metadata new file mode 100644 index 0000000..9ef2a76 --- /dev/null +++ b/.e2fsprogs.metadata @@ -0,0 +1 @@ +41dd6234aa5c148bd06571e6be013a807b3af7a0 SOURCES/e2fsprogs-1.45.6.tar.xz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a9f32e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/e2fsprogs-1.45.6.tar.xz diff --git a/SOURCES/0001-reisze2fs-sanity-check-free-block-group-counts-when-.patch b/SOURCES/0001-reisze2fs-sanity-check-free-block-group-counts-when-.patch new file mode 100644 index 0000000..02266f9 --- /dev/null +++ b/SOURCES/0001-reisze2fs-sanity-check-free-block-group-counts-when-.patch @@ -0,0 +1,126 @@ +From 2c98da4e6a3e106c340972adedc6f79c4c1969f2 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 28 Dec 2021 12:33:15 -0500 +Subject: [PATCH] reisze2fs: sanity check free block group counts when + calculating minimum size + +If one or more block group descriptor's free blocks count is insane, +it's possible this can lead to a infinite loop in the function +calculate_minimum_resize_size(), which is called by resize2fs -P or +resize2fs -M. + +Add some sanity checks to avoid this. In the case where the file +system is corrupt, this will result in resize2fs -P reporting an +incorrect value, but that's OK, since when we try to do an actual +resize operation, resize2fs requires that the file system be freshly +checked using e2fsck. + +https://github.com/tytso/e2fsprogs/issues/94 + +Fixes: ac94445fc01f ("resize2fs: make minimum size estimates more reliable for mounted fs") +Signed-off-by: Theodore Ts'o +--- + resize/resize2fs.c | 13 +++++++++-- + tests/r_corrupt_fs/expect | 4 ++++ + tests/r_corrupt_fs/name | 1 + + tests/r_corrupt_fs/script | 45 +++++++++++++++++++++++++++++++++++++++ + 4 files changed, 61 insertions(+), 2 deletions(-) + create mode 100644 tests/r_corrupt_fs/expect + create mode 100644 tests/r_corrupt_fs/name + create mode 100644 tests/r_corrupt_fs/script + +diff --git a/resize/resize2fs.c b/resize/resize2fs.c +index 8a3d08db..26050fec 100644 +--- a/resize/resize2fs.c ++++ b/resize/resize2fs.c +@@ -2928,8 +2928,17 @@ blk64_t calculate_minimum_resize_size(ext2_filsys fs, int flags) + /* calculate how many blocks are needed for data */ + data_needed = ext2fs_blocks_count(fs->super); + for (grp = 0; grp < fs->group_desc_count; grp++) { +- data_needed -= calc_group_overhead(fs, grp, old_desc_blocks); +- data_needed -= ext2fs_bg_free_blocks_count(fs, grp); ++ __u32 n = ext2fs_bg_free_blocks_count(fs, grp); ++ ++ if (n > EXT2_BLOCKS_PER_GROUP(fs->super)) ++ n = EXT2_BLOCKS_PER_GROUP(fs->super); ++ n += calc_group_overhead(fs, grp, old_desc_blocks); ++ if (data_needed < n) { ++ if (flags & RESIZE_DEBUG_MIN_CALC) ++ printf("file system appears inconsistent?!?\n"); ++ return ext2fs_blocks_count(fs->super); ++ } ++ data_needed -= n; + } + #ifdef RESIZE2FS_DEBUG + if (flags & RESIZE_DEBUG_MIN_CALC) +diff --git a/tests/r_corrupt_fs/expect b/tests/r_corrupt_fs/expect +new file mode 100644 +index 00000000..fe0f2bc4 +--- /dev/null ++++ b/tests/r_corrupt_fs/expect +@@ -0,0 +1,4 @@ ++mke2fs -q -F -t ext4 -o Linux -b 1024 test.img 32M ++debugfs -w -R "set_bg 1 free_blocks_count 65536" /tmp/foo.img ++resize2fs -P /tmp/foo.img ++Estimated minimum size of the filesystem: 6604 +diff --git a/tests/r_corrupt_fs/name b/tests/r_corrupt_fs/name +new file mode 100644 +index 00000000..ed627419 +--- /dev/null ++++ b/tests/r_corrupt_fs/name +@@ -0,0 +1 @@ ++resize2fs -P of a corrupted file system +diff --git a/tests/r_corrupt_fs/script b/tests/r_corrupt_fs/script +new file mode 100644 +index 00000000..08af91ed +--- /dev/null ++++ b/tests/r_corrupt_fs/script +@@ -0,0 +1,45 @@ ++if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then ++ echo "$test_name: $test_description: skipped (no debugfs/resize2fs)" ++ return 0 ++fi ++ ++OUT=$test_name.log ++if [ -f $test_dir/expect.gz ]; then ++ EXP=$test_name.tmp ++ gunzip < $test_dir/expect.gz > $EXP1 ++else ++ EXP=$test_dir/expect ++fi ++ ++echo mke2fs -q -F -t ext4 -o Linux -b 1024 test.img 32M > $OUT.new ++$MKE2FS -q -F -t ext4 -o Linux -b 1024 $TMPFILE 32M >> $OUT.new 2>&1 ++ ++echo debugfs -w -R \"set_bg 1 free_blocks_count 65536\" /tmp/foo.img >> $OUT.new ++$DEBUGFS -w -R "set_bg 1 free_blocks_count 65536" $TMPFILE > /dev/null 2>&1 ++ ++if type timeout > /dev/null 2>&1 ; then ++ TIMEOUT="timeout -v 30s" ++else ++ TIMEOUT= ++fi ++ ++echo resize2fs -P /tmp/foo.img >> $OUT.new ++$TIMEOUT $RESIZE2FS -P $TMPFILE >> $OUT.new 2>&1 ++ ++sed -f $cmd_dir/filter.sed < $OUT.new > $OUT ++ ++rm -f $TMPFILE $OUT.new ++ ++cmp -s $OUT $EXP ++status=$? ++ ++if [ "$status" = 0 ] ; then ++ echo "$test_name: $test_description: ok" ++ touch $test_name.ok ++else ++ echo "$test_name: $test_description: failed" ++ diff $DIFF_OPTS $EXP $OUT > $test_name.failed ++ rm -f $test_name.tmp ++fi ++ ++unset IMAGE OUT EXP TIMEOUT +-- +2.34.1 + diff --git a/SOURCES/0001-tests-specify-inode-size-in-r_corrupt_fs.patch b/SOURCES/0001-tests-specify-inode-size-in-r_corrupt_fs.patch new file mode 100644 index 0000000..477e45f --- /dev/null +++ b/SOURCES/0001-tests-specify-inode-size-in-r_corrupt_fs.patch @@ -0,0 +1,43 @@ +From 0ec67ba5063b1fdcad4142633338c2cc98b60b5b Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Wed, 16 Feb 2022 11:12:28 +0100 +Subject: [PATCH] tests: specify inode size in r_corrupt_fs + +Inode size will have an effect on the minimum resize size and this will +have an effect on the test output. Stabilize the output by specifying +the inode size instead of relying on the system configuration. + +Signed-off-by: Lukas Czerner +--- + tests/r_corrupt_fs/expect | 2 +- + tests/r_corrupt_fs/script | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/r_corrupt_fs/expect b/tests/r_corrupt_fs/expect +index fe0f2bc4..fbc0c23e 100644 +--- a/tests/r_corrupt_fs/expect ++++ b/tests/r_corrupt_fs/expect +@@ -1,4 +1,4 @@ +-mke2fs -q -F -t ext4 -o Linux -b 1024 test.img 32M ++mke2fs -q -F -t ext4 -o Linux -b 1024 -I 256 test.img 32M + debugfs -w -R "set_bg 1 free_blocks_count 65536" /tmp/foo.img + resize2fs -P /tmp/foo.img + Estimated minimum size of the filesystem: 6604 +diff --git a/tests/r_corrupt_fs/script b/tests/r_corrupt_fs/script +index f6d3a89d..45bbe071 100644 +--- a/tests/r_corrupt_fs/script ++++ b/tests/r_corrupt_fs/script +@@ -11,8 +11,8 @@ else + EXP=$test_dir/expect + fi + +-echo mke2fs -q -F -t ext4 -o Linux -b 1024 test.img 32M > $OUT.new +-$MKE2FS -q -F -t ext4 -o Linux -b 1024 $TMPFILE 32M >> $OUT.new 2>&1 ++echo mke2fs -q -F -t ext4 -o Linux -b 1024 -I 256 test.img 32M > $OUT.new ++$MKE2FS -q -F -t ext4 -o Linux -b 1024 -I 256 $TMPFILE 32M >> $OUT.new 2>&1 + + echo debugfs -w -R \"set_bg 1 free_blocks_count 65536\" /tmp/foo.img >> $OUT.new + $DEBUGFS -w -R "set_bg 1 free_blocks_count 65536" $TMPFILE > /dev/null 2>&1 +-- +2.34.1 + diff --git a/SOURCES/0001-tests-support-older-versions-of-timeout-in-r_corrupt.patch b/SOURCES/0001-tests-support-older-versions-of-timeout-in-r_corrupt.patch new file mode 100644 index 0000000..884299e --- /dev/null +++ b/SOURCES/0001-tests-support-older-versions-of-timeout-in-r_corrupt.patch @@ -0,0 +1,31 @@ +From af09db229f74f447aec12e440252d8a94c049f26 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Mon, 3 Jan 2022 22:45:37 -0500 +Subject: [PATCH] tests: support older versions of timeout in r_corrupt_fs + +Older versions of the timeout program in coreutils don't support the +-v option. (This is apparently still in use in the GNU/FreeBSD Debain +port since coreutils hasn't built successfully since Coreutils version +8.28.) + +Signed-off-by: Theodore Ts'o +--- + tests/r_corrupt_fs/script | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/r_corrupt_fs/script b/tests/r_corrupt_fs/script +index 08af91ed..f6d3a89d 100644 +--- a/tests/r_corrupt_fs/script ++++ b/tests/r_corrupt_fs/script +@@ -17,7 +17,7 @@ $MKE2FS -q -F -t ext4 -o Linux -b 1024 $TMPFILE 32M >> $OUT.new 2>&1 + echo debugfs -w -R \"set_bg 1 free_blocks_count 65536\" /tmp/foo.img >> $OUT.new + $DEBUGFS -w -R "set_bg 1 free_blocks_count 65536" $TMPFILE > /dev/null 2>&1 + +-if type timeout > /dev/null 2>&1 ; then ++if timeout -v 1s true > /dev/null 2>&1 ; then + TIMEOUT="timeout -v 30s" + else + TIMEOUT= +-- +2.34.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-Add-checks-for-fs-blocksize-0-which-could-cause-some.patch b/SOURCES/e2fsprogs-1.45.6-Add-checks-for-fs-blocksize-0-which-could-cause-some.patch new file mode 100644 index 0000000..134b911 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Add-checks-for-fs-blocksize-0-which-could-cause-some.patch @@ -0,0 +1,100 @@ +From 0111635ea5798f98665714e161c3c7746184a04b Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 23 Feb 2021 16:02:42 -0500 +Subject: [PATCH 21/46] Add checks for fs->blocksize == 0 which could cause + some crashes +Content-Type: text/plain + +This should never happeb, but some checks is useful, and also fixes +some Coverity warnings. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + debugfs/do_journal.c | 2 -- + lib/ext2fs/csum.c | 3 +++ + lib/ext2fs/ext2_err.et.in | 3 +++ + lib/ext2fs/inode.c | 4 ++++ + misc/e2image.c | 5 +++-- + 5 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/debugfs/do_journal.c b/debugfs/do_journal.c +index 5091a530..8261fa95 100644 +--- a/debugfs/do_journal.c ++++ b/debugfs/do_journal.c +@@ -528,8 +528,6 @@ static errcode_t journal_write(journal_t *journal, + } + + err = journal_close_trans(&trans); +- if (err) +- goto error; + error: + return err; + } +diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c +index 2151003b..28b3bb05 100644 +--- a/lib/ext2fs/csum.c ++++ b/lib/ext2fs/csum.c +@@ -263,6 +263,9 @@ static errcode_t __get_dirent_tail(ext2_filsys fs, + errcode_t retval = 0; + __u16 (*translate)(__u16) = (need_swab ? disk_to_host16 : do_nothing16); + ++ if (fs->blocksize < 1024) ++ return EXT2_FILSYS_CORRUPTED; /* Should never happen */ ++ + d = dirent; + top = EXT2_DIRENT_TAIL(dirent, fs->blocksize); + +diff --git a/lib/ext2fs/ext2_err.et.in b/lib/ext2fs/ext2_err.et.in +index 0c76fee6..cf0e00ea 100644 +--- a/lib/ext2fs/ext2_err.et.in ++++ b/lib/ext2fs/ext2_err.et.in +@@ -548,4 +548,7 @@ ec EXT2_ET_EA_INODE_CORRUPTED, + ec EXT2_ET_NO_GDESC, + "Group descriptors not loaded" + ++ec EXT2_FILSYS_CORRUPTED, ++ "The internal ext2_filsys data structure appears to be corrupted" ++ + end +diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c +index c4377eeb..6f42882e 100644 +--- a/lib/ext2fs/inode.c ++++ b/lib/ext2fs/inode.c +@@ -144,6 +144,8 @@ errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks, + errcode_t (*save_get_blocks)(ext2_filsys f, ext2_ino_t ino, blk_t *blocks); + + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); ++ if (fs->blocksize < 1024) ++ return EXT2_FILSYS_CORRUPTED; /* Should never happen */ + + /* + * If fs->badblocks isn't set, then set it --- since the inode +@@ -764,6 +766,8 @@ errcode_t ext2fs_read_inode2(ext2_filsys fs, ext2_ino_t ino, + int cache_slot, fail_csum; + + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); ++ if (fs->blocksize < 1024) ++ return EXT2_FILSYS_CORRUPTED; /* Should never happen */ + + /* Check to see if user has an override function */ + if (fs->read_inode && +diff --git a/misc/e2image.c b/misc/e2image.c +index 892c5371..195fabb2 100644 +--- a/misc/e2image.c ++++ b/misc/e2image.c +@@ -892,8 +892,9 @@ static errcode_t initialize_qcow2_image(int fd, ext2_filsys fs, + int cluster_bits = get_bits_from_size(fs->blocksize); + struct ext2_super_block *sb = fs->super; + +- if (fs->blocksize < 1024) +- return EINVAL; /* Can never happen, but just in case... */ ++ /* Sbould never happen, but just in case... */ ++ if (cluster_bits < 0) ++ return EXT2_FILSYS_CORRUPTED; + + /* Allocate header */ + ret = ext2fs_get_memzero(sizeof(struct ext2_qcow2_hdr), &header); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-Fix-clang-warnings.patch b/SOURCES/e2fsprogs-1.45.6-Fix-clang-warnings.patch new file mode 100644 index 0000000..f4f696a --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Fix-clang-warnings.patch @@ -0,0 +1,104 @@ +From 1466a142efe5b20ddda2ce96c0d409dc294fd1b2 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 23 Jan 2021 00:57:18 -0500 +Subject: [PATCH 17/46] Fix clang warnings +Content-Type: text/plain + +Clang gets unhappy when passing an unsigned char to string functions. +For better or for worse we use __u8[] in the definition of the +superblock. So cast them these to "char *" to prevent clang +build-time warnings. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + e2fsck/unix.c | 2 +- + lib/ext2fs/mmp.c | 8 ++++---- + misc/e2fuzz.c | 3 ++- + misc/mke2fs.c | 4 ++-- + 4 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/e2fsck/unix.c b/e2fsck/unix.c +index e71d7833..15a73e7c 100644 +--- a/e2fsck/unix.c ++++ b/e2fsck/unix.c +@@ -1693,7 +1693,7 @@ failure: + * or informational messages to the user. + */ + if (ctx->device_name == 0 && sb->s_volume_name[0]) +- ctx->device_name = string_copy(ctx, sb->s_volume_name, ++ ctx->device_name = string_copy(ctx, (char *) sb->s_volume_name, + sizeof(sb->s_volume_name)); + + if (ctx->device_name == 0) +diff --git a/lib/ext2fs/mmp.c b/lib/ext2fs/mmp.c +index e96a2273..973b9ecd 100644 +--- a/lib/ext2fs/mmp.c ++++ b/lib/ext2fs/mmp.c +@@ -210,11 +210,11 @@ static errcode_t ext2fs_mmp_reset(ext2_filsys fs) + mmp_s->mmp_seq = EXT4_MMP_SEQ_CLEAN; + mmp_s->mmp_time = 0; + #ifdef HAVE_GETHOSTNAME +- gethostname(mmp_s->mmp_nodename, sizeof(mmp_s->mmp_nodename)); ++ gethostname((char *) mmp_s->mmp_nodename, sizeof(mmp_s->mmp_nodename)); + #else + mmp_s->mmp_nodename[0] = '\0'; + #endif +- strncpy(mmp_s->mmp_bdevname, fs->device_name, ++ strncpy((char *) mmp_s->mmp_bdevname, fs->device_name, + sizeof(mmp_s->mmp_bdevname)); + + mmp_s->mmp_check_interval = fs->super->s_mmp_update_interval; +@@ -352,11 +352,11 @@ clean_seq: + + mmp_s->mmp_seq = seq = ext2fs_mmp_new_seq(); + #ifdef HAVE_GETHOSTNAME +- gethostname(mmp_s->mmp_nodename, sizeof(mmp_s->mmp_nodename)); ++ gethostname((char *) mmp_s->mmp_nodename, sizeof(mmp_s->mmp_nodename)); + #else + strcpy(mmp_s->mmp_nodename, "unknown host"); + #endif +- strncpy(mmp_s->mmp_bdevname, fs->device_name, ++ strncpy((char *) mmp_s->mmp_bdevname, fs->device_name, + sizeof(mmp_s->mmp_bdevname)); + + retval = ext2fs_mmp_write(fs, fs->super->s_mmp_block, fs->mmp_buf); +diff --git a/misc/e2fuzz.c b/misc/e2fuzz.c +index 7c0f776f..65b6ae73 100644 +--- a/misc/e2fuzz.c ++++ b/misc/e2fuzz.c +@@ -172,7 +172,8 @@ static uint64_t rand_num(uint64_t min, uint64_t max) + for (i = 0; i < sizeof(x); i++) + px[i] = random(); + +- return min + (uint64_t)((double)(max - min) * (x / (UINT64_MAX + 1.0))); ++ return min + (uint64_t)((double)(max - min) * ++ (x / ((double) UINT64_MAX + 1.0))); + } + + static int process_fs(const char *fsname) +diff --git a/misc/mke2fs.c b/misc/mke2fs.c +index 27e7d174..0184a3a8 100644 +--- a/misc/mke2fs.c ++++ b/misc/mke2fs.c +@@ -3151,7 +3151,7 @@ int main (int argc, char *argv[]) + if (volume_label) { + memset(fs->super->s_volume_name, 0, + sizeof(fs->super->s_volume_name)); +- strncpy(fs->super->s_volume_name, volume_label, ++ strncpy((char *) fs->super->s_volume_name, volume_label, + sizeof(fs->super->s_volume_name)); + } + +@@ -3161,7 +3161,7 @@ int main (int argc, char *argv[]) + if (mount_dir) { + memset(fs->super->s_last_mounted, 0, + sizeof(fs->super->s_last_mounted)); +- strncpy(fs->super->s_last_mounted, mount_dir, ++ strncpy((char *) fs->super->s_last_mounted, mount_dir, + sizeof(fs->super->s_last_mounted)); + } + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch b/SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch new file mode 100644 index 0000000..0d31242 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch @@ -0,0 +1,38 @@ +From 06116f6d053e398d13634df911bcb105d0fb2416 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Sun, 15 Dec 2019 12:42:28 +0100 +Subject: [PATCH 1/7] Makefile.in: Disable e2scrub + +e2scrub system is still new and we're not ready to support it yet, so +just disbale it and not even build it. + +Signed-off-by: Lukas Czerner +--- + Makefile.in | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index b951c017..34e2048d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -13,7 +13,6 @@ INSTALL = @INSTALL@ + @DEBUGFS_CMT@DEBUGFS_DIR= debugfs + @UUID_CMT@UUID_LIB_SUBDIR= lib/uuid + @BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid +-@E2SCRUB_CMT@E2SCRUB_DIR= scrub + @ALL_CMT@SUPPORT_LIB_SUBDIR= lib/support + @ALL_CMT@E2P_LIB_SUBDIR= lib/e2p + @ALL_CMT@EXT2FS_LIB_SUBDIR= lib/ext2fs +@@ -21,8 +20,7 @@ INSTALL = @INSTALL@ + LIB_SUBDIRS=lib/et lib/ss $(E2P_LIB_SUBDIR) $(UUID_LIB_SUBDIR) \ + $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR) intl + +-PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po \ +- $(E2SCRUB_DIR) ++PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po + + SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests + +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch b/SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch new file mode 100644 index 0000000..8da372e --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch @@ -0,0 +1,45 @@ +From f2bb71bdbedf33f4fae4e1402ec23fe58eece1a7 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Sun, 15 Dec 2019 14:39:46 +0100 +Subject: [PATCH 2/7] Revert "fuse2fs: install fuse2fs in /usr/bin instead of + /usr/sbin" + +This reverts commit b71150355dca5409cf8e82a7e715e459a795bbf8. +--- + debian/fuse2fs.install | 2 +- + misc/Makefile.in | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/debian/fuse2fs.install b/debian/fuse2fs.install +index 2ed4c3c0..cd37a70e 100644 +--- a/debian/fuse2fs.install ++++ b/debian/fuse2fs.install +@@ -1,2 +1,2 @@ +-/usr/bin/fuse2fs ++/usr/sbin/fuse2fs + /usr/share/man/man1/fuse2fs.1 +diff --git a/misc/Makefile.in b/misc/Makefile.in +index 9f2a8939..216fc771 100644 +--- a/misc/Makefile.in ++++ b/misc/Makefile.in +@@ -35,7 +35,7 @@ INSTALL = @INSTALL@ + SPROGS= mke2fs badblocks tune2fs dumpe2fs $(BLKID_PROG) logsave \ + $(E2IMAGE_PROG) @FSCK_PROG@ e2undo + USPROGS= mklost+found filefrag e2freefrag $(UUIDD_PROG) \ +- $(E4DEFRAG_PROG) $(E4CRYPT_PROG) ++ $(E4DEFRAG_PROG) $(E4CRYPT_PROG) $(FUSE_PROG) + SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \ + e2label.8 $(FINDFS_MAN) $(BLKID_MAN) $(E2IMAGE_MAN) \ + logsave.8 filefrag.8 e2freefrag.8 e2undo.8 \ +@@ -43,7 +43,7 @@ SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \ + e2mmpstatus.8 + FMANPAGES= mke2fs.conf.5 ext4.5 + +-UPROGS= chattr lsattr $(FUSE_PROG) @UUID_CMT@ uuidgen ++UPROGS= chattr lsattr @UUID_CMT@ uuidgen + UMANPAGES= chattr.1 lsattr.1 @UUID_CMT@ uuidgen.1 + UMANPAGES+= @FUSE_CMT@ fuse2fs.1 + +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch new file mode 100644 index 0000000..17c210d --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch @@ -0,0 +1,86 @@ +From cdbe6f07c929b0c9a80b7fbeb61b3a9f66015085 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 09:49:31 +0100 +Subject: [PATCH 6/7] Revert "libext2fs: hide struct ext2fs_hashmap as an + internal implementation detail" + +This reverts commit ef54444e6d1da4b464c11e749c9643ed945a770b +because it breaks ABI. + +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/hashmap.c | 16 ---------------- + lib/ext2fs/hashmap.h | 30 +++++++++++++++++++++--------- + 2 files changed, 21 insertions(+), 25 deletions(-) + +diff --git a/lib/ext2fs/hashmap.c b/lib/ext2fs/hashmap.c +index ffe61ce9..3d8ee814 100644 +--- a/lib/ext2fs/hashmap.c ++++ b/lib/ext2fs/hashmap.c +@@ -1,22 +1,6 @@ + #include "hashmap.h" + #include + +-struct ext2fs_hashmap { +- uint32_t size; +- uint32_t(*hash)(const void *key, size_t len); +- void(*free)(void*); +- struct ext2fs_hashmap_entry *first; +- struct ext2fs_hashmap_entry *last; +-#if __GNUC_PREREQ (4, 8) +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wpedantic" +-#endif +- struct ext2fs_hashmap_entry *entries[0]; +-#if __GNUC_PREREQ (4, 8) +-#pragma GCC diagnostic pop +-#endif +-}; +- + uint32_t ext2fs_djb2_hash(const void *str, size_t size) + { + int c; +diff --git a/lib/ext2fs/hashmap.h b/lib/ext2fs/hashmap.h +index dcfa7455..656d3d90 100644 +--- a/lib/ext2fs/hashmap.h ++++ b/lib/ext2fs/hashmap.h +@@ -13,15 +13,27 @@ + #endif + #endif + +-struct ext2fs_hashmap; +- +-struct ext2fs_hashmap_entry { +- void *data; +- const void *key; +- size_t key_len; +- struct ext2fs_hashmap_entry *next; +- struct ext2fs_hashmap_entry *list_next; +- struct ext2fs_hashmap_entry *list_prev; ++struct ext2fs_hashmap { ++ uint32_t size; ++ uint32_t(*hash)(const void *key, size_t len); ++ void(*free)(void*); ++ struct ext2fs_hashmap_entry *first; ++ struct ext2fs_hashmap_entry *last; ++ struct ext2fs_hashmap_entry { ++ void *data; ++ const void *key; ++ size_t key_len; ++ struct ext2fs_hashmap_entry *next; ++ struct ext2fs_hashmap_entry *list_next; ++ struct ext2fs_hashmap_entry *list_prev; ++#if __GNUC_PREREQ (4, 8) ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wpedantic" ++#endif ++ } *entries[0]; ++#if __GNUC_PREREQ (4, 8) ++#pragma GCC diagnostic pop ++#endif + }; + + struct ext2fs_hashmap *ext2fs_hashmap_create( +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch new file mode 100644 index 0000000..b473248 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch @@ -0,0 +1,1421 @@ +From 1c25e64066e861f273b785b06ef3bc7636552eab Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 09:49:19 +0100 +Subject: [PATCH 5/7] Revert "libext2fs: revamp bitmap types to fix LTO + warnings" + +This reverts commit 83d9ffccf3ee6ad4e165eeb6912acf1f6149be28 because it +breaks ABI. + +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/bitmaps.c | 6 +- + lib/ext2fs/blkmap64_ba.c | 38 ++++---- + lib/ext2fs/blkmap64_rb.c | 38 ++++---- + lib/ext2fs/bmap64.h | 38 ++++---- + lib/ext2fs/ext2fs.h | 11 +-- + lib/ext2fs/gen_bitmap.c | 113 ++++++++--------------- + lib/ext2fs/gen_bitmap64.c | 185 ++++++++++++++++---------------------- + 7 files changed, 173 insertions(+), 256 deletions(-) + +diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c +index 834a3962..e0b1f7cd 100644 +--- a/lib/ext2fs/bitmaps.c ++++ b/lib/ext2fs/bitmaps.c +@@ -126,7 +126,6 @@ errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs, + { + __u64 start, end, real_end; + ext2fs_generic_bitmap bmap; +- ext2fs_generic_bitmap_64 bmap64; + errcode_t retval; + + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); +@@ -149,15 +148,14 @@ errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs, + end, real_end, descr, &bmap); + if (retval) + return retval; +- bmap64 = (ext2fs_generic_bitmap_64) bmap; +- bmap64->cluster_bits = 0; ++ bmap->cluster_bits = 0; + *ret = bmap; + return 0; + } + + int ext2fs_get_bitmap_granularity(ext2fs_block_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) bitmap; ++ ext2fs_generic_bitmap bmap = bitmap; + + if (!EXT2FS_IS_64_BITMAP(bmap)) + return 0; +diff --git a/lib/ext2fs/blkmap64_ba.c b/lib/ext2fs/blkmap64_ba.c +index 85cb38d2..3707a61e 100644 +--- a/lib/ext2fs/blkmap64_ba.c ++++ b/lib/ext2fs/blkmap64_ba.c +@@ -40,7 +40,7 @@ struct ext2fs_ba_private_struct { + + typedef struct ext2fs_ba_private_struct *ext2fs_ba_private; + +-static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) ++static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp; + errcode_t retval; +@@ -69,7 +69,7 @@ static errcode_t ba_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) + } + + static errcode_t ba_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)), +- ext2fs_generic_bitmap_64 bitmap) ++ ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp; + errcode_t retval; +@@ -86,7 +86,7 @@ static errcode_t ba_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)), + return 0; + } + +-static void ba_free_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void ba_free_bmap(ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + +@@ -101,8 +101,8 @@ static void ba_free_bmap(ext2fs_generic_bitmap_64 bitmap) + bp = 0; + } + +-static errcode_t ba_copy_bmap(ext2fs_generic_bitmap_64 src, +- ext2fs_generic_bitmap_64 dest) ++static errcode_t ba_copy_bmap(ext2fs_generic_bitmap src, ++ ext2fs_generic_bitmap dest) + { + ext2fs_ba_private src_bp = (ext2fs_ba_private) src->private; + ext2fs_ba_private dest_bp; +@@ -121,7 +121,7 @@ static errcode_t ba_copy_bmap(ext2fs_generic_bitmap_64 src, + return 0; + } + +-static errcode_t ba_resize_bmap(ext2fs_generic_bitmap_64 bmap, ++static errcode_t ba_resize_bmap(ext2fs_generic_bitmap bmap, + __u64 new_end, __u64 new_real_end) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bmap->private; +@@ -162,7 +162,7 @@ static errcode_t ba_resize_bmap(ext2fs_generic_bitmap_64 bmap, + + } + +-static int ba_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int ba_mark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + blk64_t bitno = (blk64_t) arg; +@@ -170,7 +170,7 @@ static int ba_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return ext2fs_set_bit64(bitno - bitmap->start, bp->bitarray); + } + +-static int ba_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int ba_unmark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + blk64_t bitno = (blk64_t) arg; +@@ -178,7 +178,7 @@ static int ba_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return ext2fs_clear_bit64(bitno - bitmap->start, bp->bitarray); + } + +-static int ba_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int ba_test_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + blk64_t bitno = (blk64_t) arg; +@@ -186,7 +186,7 @@ static int ba_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return ext2fs_test_bit64(bitno - bitmap->start, bp->bitarray); + } + +-static void ba_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void ba_mark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -197,7 +197,7 @@ static void ba_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + ext2fs_fast_set_bit64(bitno + i - bitmap->start, bp->bitarray); + } + +-static void ba_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void ba_unmark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -208,7 +208,7 @@ static void ba_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + ext2fs_fast_clear_bit64(bitno + i - bitmap->start, bp->bitarray); + } + +-static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, ++static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap bitmap, + __u64 start, unsigned int len) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -282,7 +282,7 @@ static int ba_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, + } + + +-static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *in) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -292,7 +292,7 @@ static errcode_t ba_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *out) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; +@@ -302,7 +302,7 @@ static errcode_t ba_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static void ba_clear_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void ba_clear_bmap(ext2fs_generic_bitmap bitmap) + { + ext2fs_ba_private bp = (ext2fs_ba_private) bitmap->private; + +@@ -311,20 +311,20 @@ static void ba_clear_bmap(ext2fs_generic_bitmap_64 bitmap) + } + + #ifdef ENABLE_BMAP_STATS +-static void ba_print_stats(ext2fs_generic_bitmap_64 bitmap) ++static void ba_print_stats(ext2fs_generic_bitmap bitmap) + { + fprintf(stderr, "%16llu Bytes used by bitarray\n", + ((bitmap->real_end - bitmap->start) >> 3) + 1 + + sizeof(struct ext2fs_ba_private_struct)); + } + #else +-static void ba_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused))) ++static void ba_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused))) + { + } + #endif + + /* Find the first zero bit between start and end, inclusive. */ +-static errcode_t ba_find_first_zero(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_find_first_zero(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + ext2fs_ba_private bp = (ext2fs_ba_private)bitmap->private; +@@ -398,7 +398,7 @@ static errcode_t ba_find_first_zero(ext2fs_generic_bitmap_64 bitmap, + } + + /* Find the first one bit between start and end, inclusive. */ +-static errcode_t ba_find_first_set(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t ba_find_first_set(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + ext2fs_ba_private bp = (ext2fs_ba_private)bitmap->private; +diff --git a/lib/ext2fs/blkmap64_rb.c b/lib/ext2fs/blkmap64_rb.c +index 1fd55274..4cbfb1ed 100644 +--- a/lib/ext2fs/blkmap64_rb.c ++++ b/lib/ext2fs/blkmap64_rb.c +@@ -177,7 +177,7 @@ static void rb_free_extent(struct ext2fs_rb_private *bp, + ext2fs_free_mem(&ext); + } + +-static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) ++static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + errcode_t retval; +@@ -201,7 +201,7 @@ static errcode_t rb_alloc_private_data (ext2fs_generic_bitmap_64 bitmap) + } + + static errcode_t rb_new_bmap(ext2_filsys fs EXT2FS_ATTR((unused)), +- ext2fs_generic_bitmap_64 bitmap) ++ ext2fs_generic_bitmap bitmap) + { + errcode_t retval; + +@@ -225,7 +225,7 @@ static void rb_free_tree(struct rb_root *root) + } + } + +-static void rb_free_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void rb_free_bmap(ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + +@@ -236,8 +236,8 @@ static void rb_free_bmap(ext2fs_generic_bitmap_64 bitmap) + bp = 0; + } + +-static errcode_t rb_copy_bmap(ext2fs_generic_bitmap_64 src, +- ext2fs_generic_bitmap_64 dest) ++static errcode_t rb_copy_bmap(ext2fs_generic_bitmap src, ++ ext2fs_generic_bitmap dest) + { + struct ext2fs_rb_private *src_bp, *dest_bp; + struct bmap_rb_extent *src_ext, *dest_ext; +@@ -302,7 +302,7 @@ static void rb_truncate(__u64 new_max, struct rb_root *root) + } + } + +-static errcode_t rb_resize_bmap(ext2fs_generic_bitmap_64 bmap, ++static errcode_t rb_resize_bmap(ext2fs_generic_bitmap bmap, + __u64 new_end, __u64 new_real_end) + { + struct ext2fs_rb_private *bp; +@@ -575,7 +575,7 @@ static int rb_remove_extent(__u64 start, __u64 count, + return retval; + } + +-static int rb_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int rb_mark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + struct ext2fs_rb_private *bp; + int retval; +@@ -588,7 +588,7 @@ static int rb_mark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return retval; + } + +-static int rb_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int rb_unmark_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + struct ext2fs_rb_private *bp; + int retval; +@@ -603,7 +603,7 @@ static int rb_unmark_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + } + + inline +-static int rb_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) ++static int rb_test_bmap(ext2fs_generic_bitmap bitmap, __u64 arg) + { + struct ext2fs_rb_private *bp; + +@@ -613,7 +613,7 @@ static int rb_test_bmap(ext2fs_generic_bitmap_64 bitmap, __u64 arg) + return rb_test_bit(bp, arg); + } + +-static void rb_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void rb_mark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + struct ext2fs_rb_private *bp; +@@ -625,7 +625,7 @@ static void rb_mark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + check_tree(&bp->root, __func__); + } + +-static void rb_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++static void rb_unmark_bmap_extent(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num) + { + struct ext2fs_rb_private *bp; +@@ -637,7 +637,7 @@ static void rb_unmark_bmap_extent(ext2fs_generic_bitmap_64 bitmap, __u64 arg, + check_tree(&bp->root, __func__); + } + +-static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, ++static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap bitmap, + __u64 start, unsigned int len) + { + struct rb_node *parent = NULL, **n; +@@ -693,7 +693,7 @@ static int rb_test_clear_bmap_extent(ext2fs_generic_bitmap_64 bitmap, + return retval; + } + +-static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *in) + { + struct ext2fs_rb_private *bp; +@@ -739,7 +739,7 @@ static errcode_t rb_set_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *out) + { + +@@ -804,7 +804,7 @@ static errcode_t rb_get_bmap_range(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static void rb_clear_bmap(ext2fs_generic_bitmap_64 bitmap) ++static void rb_clear_bmap(ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + +@@ -817,7 +817,7 @@ static void rb_clear_bmap(ext2fs_generic_bitmap_64 bitmap) + check_tree(&bp->root, __func__); + } + +-static errcode_t rb_find_first_zero(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_find_first_zero(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + struct rb_node *parent = NULL, **n; +@@ -853,7 +853,7 @@ static errcode_t rb_find_first_zero(ext2fs_generic_bitmap_64 bitmap, + return 0; + } + +-static errcode_t rb_find_first_set(ext2fs_generic_bitmap_64 bitmap, ++static errcode_t rb_find_first_set(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { + struct rb_node *parent = NULL, **n; +@@ -902,7 +902,7 @@ static errcode_t rb_find_first_set(ext2fs_generic_bitmap_64 bitmap, + } + + #ifdef ENABLE_BMAP_STATS +-static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap) ++static void rb_print_stats(ext2fs_generic_bitmap bitmap) + { + struct ext2fs_rb_private *bp; + struct rb_node *node = NULL; +@@ -963,7 +963,7 @@ static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap) + eff); + } + #else +-static void rb_print_stats(ext2fs_generic_bitmap_64 bitmap EXT2FS_ATTR((unused))) ++static void rb_print_stats(ext2fs_generic_bitmap bitmap EXT2FS_ATTR((unused))) + { + } + #endif +diff --git a/lib/ext2fs/bmap64.h b/lib/ext2fs/bmap64.h +index de334548..d8c7a3c3 100644 +--- a/lib/ext2fs/bmap64.h ++++ b/lib/ext2fs/bmap64.h +@@ -37,7 +37,7 @@ struct ext2_bmap_statistics { + }; + + +-struct ext2fs_struct_generic_bitmap_64 { ++struct ext2fs_struct_generic_bitmap { + errcode_t magic; + ext2_filsys fs; + struct ext2_bitmap_ops *bitmap_ops; +@@ -53,8 +53,6 @@ struct ext2fs_struct_generic_bitmap_64 { + #endif + }; + +-typedef struct ext2fs_struct_generic_bitmap_64 *ext2fs_generic_bitmap_64; +- + #define EXT2FS_IS_32_BITMAP(bmap) \ + (((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \ + ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \ +@@ -68,37 +66,37 @@ typedef struct ext2fs_struct_generic_bitmap_64 *ext2fs_generic_bitmap_64; + struct ext2_bitmap_ops { + int type; + /* Generic bmap operators */ +- errcode_t (*new_bmap)(ext2_filsys fs, ext2fs_generic_bitmap_64 bmap); +- void (*free_bmap)(ext2fs_generic_bitmap_64 bitmap); +- errcode_t (*copy_bmap)(ext2fs_generic_bitmap_64 src, +- ext2fs_generic_bitmap_64 dest); +- errcode_t (*resize_bmap)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*new_bmap)(ext2_filsys fs, ext2fs_generic_bitmap bmap); ++ void (*free_bmap)(ext2fs_generic_bitmap bitmap); ++ errcode_t (*copy_bmap)(ext2fs_generic_bitmap src, ++ ext2fs_generic_bitmap dest); ++ errcode_t (*resize_bmap)(ext2fs_generic_bitmap bitmap, + __u64 new_end, + __u64 new_real_end); + /* bit set/test operators */ +- int (*mark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg); +- int (*unmark_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg); +- int (*test_bmap)(ext2fs_generic_bitmap_64 bitmap, __u64 arg); +- void (*mark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++ int (*mark_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg); ++ int (*unmark_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg); ++ int (*test_bmap)(ext2fs_generic_bitmap bitmap, __u64 arg); ++ void (*mark_bmap_extent)(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num); +- void (*unmark_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, __u64 arg, ++ void (*unmark_bmap_extent)(ext2fs_generic_bitmap bitmap, __u64 arg, + unsigned int num); +- int (*test_clear_bmap_extent)(ext2fs_generic_bitmap_64 bitmap, ++ int (*test_clear_bmap_extent)(ext2fs_generic_bitmap bitmap, + __u64 arg, unsigned int num); +- errcode_t (*set_bmap_range)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*set_bmap_range)(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *in); +- errcode_t (*get_bmap_range)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*get_bmap_range)(ext2fs_generic_bitmap bitmap, + __u64 start, size_t num, void *out); +- void (*clear_bmap)(ext2fs_generic_bitmap_64 bitmap); +- void (*print_stats)(ext2fs_generic_bitmap_64); ++ void (*clear_bmap)(ext2fs_generic_bitmap bitmap); ++ void (*print_stats)(ext2fs_generic_bitmap); + + /* Find the first zero bit between start and end, inclusive. + * May be NULL, in which case a generic function is used. */ +- errcode_t (*find_first_zero)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*find_first_zero)(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out); + /* Find the first set bit between start and end, inclusive. + * May be NULL, in which case a generic function is used. */ +- errcode_t (*find_first_set)(ext2fs_generic_bitmap_64 bitmap, ++ errcode_t (*find_first_set)(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out); + }; + +diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h +index 4b7c836a..ba83534c 100644 +--- a/lib/ext2fs/ext2fs.h ++++ b/lib/ext2fs/ext2fs.h +@@ -111,14 +111,9 @@ typedef struct struct_ext2_filsys *ext2_filsys; + #define EXT2FS_UNMARK_ERROR 1 + #define EXT2FS_TEST_ERROR 2 + +-struct ext2fs_struct_generic_bitmap_base { +- errcode_t magic; +- ext2_filsys fs; +-}; +- +-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_generic_bitmap; +-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_inode_bitmap; +-typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_block_bitmap; ++typedef struct ext2fs_struct_generic_bitmap *ext2fs_generic_bitmap; ++typedef struct ext2fs_struct_generic_bitmap *ext2fs_inode_bitmap; ++typedef struct ext2fs_struct_generic_bitmap *ext2fs_block_bitmap; + + #define EXT2_FIRST_INODE(s) EXT2_FIRST_INO(s) + +diff --git a/lib/ext2fs/gen_bitmap.c b/lib/ext2fs/gen_bitmap.c +index 1536d4b3..b545ed7f 100644 +--- a/lib/ext2fs/gen_bitmap.c ++++ b/lib/ext2fs/gen_bitmap.c +@@ -28,7 +28,7 @@ + #include "ext2_fs.h" + #include "ext2fsP.h" + +-struct ext2fs_struct_generic_bitmap_32 { ++struct ext2fs_struct_generic_bitmap { + errcode_t magic; + ext2_filsys fs; + __u32 start, end; +@@ -39,8 +39,6 @@ struct ext2fs_struct_generic_bitmap_32 { + __u32 reserved[7]; + }; + +-typedef struct ext2fs_struct_generic_bitmap_32 *ext2fs_generic_bitmap_32; +- + #define EXT2FS_IS_32_BITMAP(bmap) \ + (((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \ + ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \ +@@ -55,11 +53,9 @@ typedef struct ext2fs_struct_generic_bitmap_32 *ext2fs_generic_bitmap_32; + * Used by previously inlined function, so we have to export this and + * not change the function signature + */ +-void ext2fs_warn_bitmap2(ext2fs_generic_bitmap gen_bitmap, ++void ext2fs_warn_bitmap2(ext2fs_generic_bitmap bitmap, + int code, unsigned long arg) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + #ifndef OMIT_COM_ERR + if (bitmap->description) + com_err(0, bitmap->base_error_code+code, +@@ -83,11 +79,11 @@ errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs, + const char *descr, char *init_map, + ext2fs_generic_bitmap *ret) + { +- ext2fs_generic_bitmap_32 bitmap; ++ ext2fs_generic_bitmap bitmap; + errcode_t retval; + size_t size; + +- retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap_32), ++ retval = ext2fs_get_mem(sizeof(struct ext2fs_struct_generic_bitmap), + &bitmap); + if (retval) + return retval; +@@ -131,7 +127,7 @@ errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs, + memcpy(bitmap->bitmap, init_map, size); + else + memset(bitmap->bitmap, 0, size); +- *ret = (ext2fs_generic_bitmap) bitmap; ++ *ret = bitmap; + return 0; + } + +@@ -145,11 +141,9 @@ errcode_t ext2fs_allocate_generic_bitmap(__u32 start, + start, end, real_end, descr, 0, ret); + } + +-errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap gen_src, ++errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap src, + ext2fs_generic_bitmap *dest) + { +- ext2fs_generic_bitmap_32 src = (ext2fs_generic_bitmap_32) gen_src; +- + return (ext2fs_make_generic_bitmap(src->magic, src->fs, + src->start, src->end, + src->real_end, +@@ -157,11 +151,9 @@ errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap gen_src, + dest)); + } + +-void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap gen_bitmap) ++void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- +- if (check_magic(gen_bitmap)) ++ if (check_magic(bitmap)) + return; + + bitmap->magic = 0; +@@ -179,8 +171,6 @@ void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap gen_bitmap) + int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, + blk_t bitno) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -193,18 +183,16 @@ int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap, + return 0; + } + +- if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) { ++ if ((bitno < bitmap->start) || (bitno > bitmap->end)) { + ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, bitno); + return 0; + } +- return ext2fs_test_bit(bitno - bitmap32->start, bitmap32->bitmap); ++ return ext2fs_test_bit(bitno - bitmap->start, bitmap->bitmap); + } + + int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, + __u32 bitno) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -217,18 +205,16 @@ int ext2fs_mark_generic_bitmap(ext2fs_generic_bitmap bitmap, + return 0; + } + +- if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) { ++ if ((bitno < bitmap->start) || (bitno > bitmap->end)) { + ext2fs_warn_bitmap2(bitmap, EXT2FS_MARK_ERROR, bitno); + return 0; + } +- return ext2fs_set_bit(bitno - bitmap32->start, bitmap32->bitmap); ++ return ext2fs_set_bit(bitno - bitmap->start, bitmap->bitmap); + } + + int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, + blk_t bitno) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -241,17 +227,15 @@ int ext2fs_unmark_generic_bitmap(ext2fs_generic_bitmap bitmap, + return 0; + } + +- if ((bitno < bitmap32->start) || (bitno > bitmap32->end)) { ++ if ((bitno < bitmap->start) || (bitno > bitmap->end)) { + ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, bitno); + return 0; + } +- return ext2fs_clear_bit(bitno - bitmap32->start, bitmap32->bitmap); ++ return ext2fs_clear_bit(bitno - bitmap->start, bitmap->bitmap); + } + + __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -264,13 +248,11 @@ __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap) + return 0; + } + +- return bitmap32->start; ++ return bitmap->start; + } + + __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -282,13 +264,11 @@ __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap) + #endif + return 0; + } +- return bitmap32->end; ++ return bitmap->end; + } + + void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_32 bitmap32 = (ext2fs_generic_bitmap_32) bitmap; +- + if (!EXT2FS_IS_32_BITMAP(bitmap)) { + if (EXT2FS_IS_64_BITMAP(bitmap)) { + ext2fs_warn_bitmap32(bitmap, __func__); +@@ -302,16 +282,14 @@ void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap) + return; + } + +- memset(bitmap32->bitmap, 0, +- (size_t) (((bitmap32->real_end - bitmap32->start) / 8) + 1)); ++ memset(bitmap->bitmap, 0, ++ (size_t) (((bitmap->real_end - bitmap->start) / 8) + 1)); + } + +-errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap gen_bitmap, ++errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap bitmap, + errcode_t magic, errcode_t neq, + ext2_ino_t end, ext2_ino_t *oend) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + EXT2_CHECK_MAGIC(bitmap, magic); + + if (end > bitmap->real_end) +@@ -324,9 +302,8 @@ errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap gen_bitmap, + + errcode_t ext2fs_resize_generic_bitmap(errcode_t magic, + __u32 new_end, __u32 new_real_end, +- ext2fs_generic_bitmap gen_bmap) ++ ext2fs_generic_bitmap bmap) + { +- ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap; + errcode_t retval; + size_t size, new_size; + __u32 bitno; +@@ -367,11 +344,9 @@ errcode_t ext2fs_resize_generic_bitmap(errcode_t magic, + } + + errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq, +- ext2fs_generic_bitmap gen_bm1, +- ext2fs_generic_bitmap gen_bm2) ++ ext2fs_generic_bitmap bm1, ++ ext2fs_generic_bitmap bm2) + { +- ext2fs_generic_bitmap_32 bm1 = (ext2fs_generic_bitmap_32) gen_bm1; +- ext2fs_generic_bitmap_32 bm2 = (ext2fs_generic_bitmap_32) gen_bm2; + blk_t i; + + if (!bm1 || bm1->magic != magic) +@@ -386,16 +361,15 @@ errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq, + return neq; + + for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++) +- if (ext2fs_fast_test_block_bitmap(gen_bm1, i) != +- ext2fs_fast_test_block_bitmap(gen_bm2, i)) ++ if (ext2fs_fast_test_block_bitmap(bm1, i) != ++ ext2fs_fast_test_block_bitmap(bm2, i)) + return neq; + + return 0; + } + +-void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap gen_map) ++void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap map) + { +- ext2fs_generic_bitmap_32 map = (ext2fs_generic_bitmap_32) gen_map; + __u32 i, j; + + /* Protect loop from wrap-around if map->real_end is maxed */ +@@ -405,13 +379,11 @@ void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap gen_map) + ext2fs_set_bit(j, map->bitmap); + } + +-errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap bmap, + errcode_t magic, + __u32 start, __u32 num, + void *out) + { +- ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap; +- + if (!bmap || (bmap->magic != magic)) + return magic; + +@@ -422,13 +394,11 @@ errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap, + return 0; + } + +-errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap bmap, + errcode_t magic, + __u32 start, __u32 num, + void *in) + { +- ext2fs_generic_bitmap_32 bmap = (ext2fs_generic_bitmap_32) gen_bmap; +- + if (!bmap || (bmap->magic != magic)) + return magic; + +@@ -462,11 +432,10 @@ int ext2fs_mem_is_zero(const char *mem, size_t len) + /* + * Return true if all of the bits in a specified range are clear + */ +-static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap gen_bitmap, ++static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap bitmap, + unsigned int start, + unsigned int len) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + size_t start_byte, len_byte = len >> 3; + unsigned int start_bit, len_bit = len % 8; + int first_bit = 0; +@@ -535,15 +504,14 @@ static int ext2fs_test_clear_generic_bitmap_range(ext2fs_generic_bitmap gen_bitm + return ext2fs_mem_is_zero(ADDR + start_byte, len_byte); + } + +-errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap gen_bitmap, ++errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap bitmap, + __u32 start, __u32 end, + __u32 *out) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + blk_t b; + + if (start < bitmap->start || end > bitmap->end || start > end) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start); ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +@@ -559,15 +527,14 @@ errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap gen_bitmap + return ENOENT; + } + +-errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap gen_bitmap, ++errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap bitmap, + __u32 start, __u32 end, + __u32 *out) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + blk_t b; + + if (start < bitmap->start || end > bitmap->end || start > end) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, start); ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +@@ -583,11 +550,9 @@ errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap gen_bitmap, + return ENOENT; + } + +-int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, ++int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap, + blk_t block, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_BLOCK_BITMAP); + if ((block < bitmap->start) || (block > bitmap->real_end) || + (block+num-1 > bitmap->real_end)) { +@@ -599,11 +564,9 @@ int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, + bitmap, block, num); + } + +-int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap gen_bitmap, ++int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap bitmap, + ext2_ino_t inode, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; +- + EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_INODE_BITMAP); + if ((inode < bitmap->start) || (inode > bitmap->real_end) || + (inode+num-1 > bitmap->real_end)) { +@@ -615,10 +578,9 @@ int ext2fs_test_inode_bitmap_range(ext2fs_inode_bitmap gen_bitmap, + bitmap, inode, num); + } + +-void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, ++void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap, + blk_t block, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + int i; + + if ((block < bitmap->start) || (block > bitmap->end) || +@@ -631,10 +593,9 @@ void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, + ext2fs_fast_set_bit(block + i - bitmap->start, bitmap->bitmap); + } + +-void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap gen_bitmap, +- blk_t block, int num) ++void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap, ++ blk_t block, int num) + { +- ext2fs_generic_bitmap_32 bitmap = (ext2fs_generic_bitmap_32) gen_bitmap; + int i; + + if ((block < bitmap->start) || (block > bitmap->end) || +diff --git a/lib/ext2fs/gen_bitmap64.c b/lib/ext2fs/gen_bitmap64.c +index 6e4d8b71..47ba2baf 100644 +--- a/lib/ext2fs/gen_bitmap64.c ++++ b/lib/ext2fs/gen_bitmap64.c +@@ -68,7 +68,7 @@ + * e2fsck can request an encoding which is optimized for that. + */ + +-static void warn_bitmap(ext2fs_generic_bitmap_64 bitmap, ++static void warn_bitmap(ext2fs_generic_bitmap bitmap, + int code, __u64 arg) + { + #ifndef OMIT_COM_ERR +@@ -93,7 +93,7 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, + const char *descr, + ext2fs_generic_bitmap *ret) + { +- ext2fs_generic_bitmap_64 bitmap; ++ ext2fs_generic_bitmap bitmap; + struct ext2_bitmap_ops *ops; + ext2_ino_t num_dirs; + errcode_t retval; +@@ -119,7 +119,7 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, + return EINVAL; + } + +- retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64), ++ retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap), + &bitmap); + if (retval) + return retval; +@@ -170,12 +170,12 @@ errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, + return retval; + } + +- *ret = (ext2fs_generic_bitmap) bitmap; ++ *ret = bitmap; + return 0; + } + + #ifdef ENABLE_BMAP_STATS +-static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap_64 bitmap) ++static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap bitmap) + { + struct ext2_bmap_statistics *stats = &bitmap->stats; + #ifdef ENABLE_BMAP_STATS_OPS +@@ -241,15 +241,13 @@ static void ext2fs_print_bmap_statistics(ext2fs_generic_bitmap_64 bitmap) + } + #endif + +-void ext2fs_free_generic_bmap(ext2fs_generic_bitmap gen_bmap) ++void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return; + + if (EXT2FS_IS_32_BITMAP(bmap)) { +- ext2fs_free_generic_bitmap(gen_bmap); ++ ext2fs_free_generic_bitmap(bmap); + return; + } + +@@ -273,25 +271,24 @@ void ext2fs_free_generic_bmap(ext2fs_generic_bitmap gen_bmap) + ext2fs_free_mem(&bmap); + } + +-errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap gen_src, ++errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src, + ext2fs_generic_bitmap *dest) + { +- ext2fs_generic_bitmap_64 src = (ext2fs_generic_bitmap_64) gen_src; + char *descr, *new_descr; +- ext2fs_generic_bitmap_64 new_bmap; ++ ext2fs_generic_bitmap new_bmap; + errcode_t retval; + + if (!src) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(src)) +- return ext2fs_copy_generic_bitmap(gen_src, dest); ++ return ext2fs_copy_generic_bitmap(src, dest); + + if (!EXT2FS_IS_64_BITMAP(src)) + return EINVAL; + + /* Allocate a new bitmap struct */ +- retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap_64), ++ retval = ext2fs_get_memzero(sizeof(struct ext2fs_struct_generic_bitmap), + &new_bmap); + if (retval) + return retval; +@@ -339,23 +336,21 @@ errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap gen_src, + return retval; + } + +- *dest = (ext2fs_generic_bitmap) new_bmap; ++ *dest = new_bmap; + + return 0; + } + +-errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap, + __u64 new_end, + __u64 new_real_end) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bmap)) +- return ext2fs_resize_generic_bitmap(gen_bmap->magic, new_end, +- new_real_end, gen_bmap); ++ return ext2fs_resize_generic_bitmap(bmap->magic, new_end, ++ new_real_end, bmap); + + if (!EXT2FS_IS_64_BITMAP(bmap)) + return EINVAL; +@@ -365,12 +360,10 @@ errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap gen_bmap, + return bmap->bitmap_ops->resize_bmap(bmap, new_end, new_real_end); + } + +-errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap, ++errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap bitmap, + errcode_t neq, + __u64 end, __u64 *oend) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return EINVAL; + +@@ -378,8 +371,7 @@ errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap, + ext2_ino_t tmp_oend; + int retval; + +- retval = ext2fs_fudge_generic_bitmap_end(gen_bitmap, +- bitmap->magic, ++ retval = ext2fs_fudge_generic_bitmap_end(bitmap, bitmap->magic, + neq, end, &tmp_oend); + if (oend) + *oend = tmp_oend; +@@ -397,15 +389,13 @@ errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap, + return 0; + } + +-__u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap gen_bitmap) ++__u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bitmap)) +- return ext2fs_get_generic_bitmap_start(gen_bitmap); ++ return ext2fs_get_generic_bitmap_start(bitmap); + + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; +@@ -413,15 +403,13 @@ __u64 ext2fs_get_generic_bmap_start(ext2fs_generic_bitmap gen_bitmap) + return bitmap->start; + } + +-__u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap) ++__u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bitmap)) +- return ext2fs_get_generic_bitmap_end(gen_bitmap); ++ return ext2fs_get_generic_bitmap_end(bitmap); + + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; +@@ -429,31 +417,27 @@ __u64 ext2fs_get_generic_bmap_end(ext2fs_generic_bitmap gen_bitmap) + return bitmap->end; + } + +-void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap gen_bitmap) ++void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (EXT2FS_IS_32_BITMAP(bitmap)) +- ext2fs_clear_generic_bitmap(gen_bitmap); ++ ext2fs_clear_generic_bitmap(bitmap); + else +- bitmap->bitmap_ops->clear_bmap(bitmap); ++ bitmap->bitmap_ops->clear_bmap (bitmap); + } + +-int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, ++int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 arg) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return 0; + + if (EXT2FS_IS_32_BITMAP(bitmap)) { + if (arg & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bitmap, ++ ext2fs_warn_bitmap2(bitmap, + EXT2FS_MARK_ERROR, 0xffffffff); + return 0; + } +- return ext2fs_mark_generic_bitmap(gen_bitmap, arg); ++ return ext2fs_mark_generic_bitmap(bitmap, arg); + } + + if (!EXT2FS_IS_64_BITMAP(bitmap)) +@@ -478,21 +462,19 @@ int ext2fs_mark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, + return bitmap->bitmap_ops->mark_bmap(bitmap, arg); + } + +-int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, ++int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 arg) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + if (!bitmap) + return 0; + + if (EXT2FS_IS_32_BITMAP(bitmap)) { + if (arg & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_UNMARK_ERROR, ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_UNMARK_ERROR, + 0xffffffff); + return 0; + } +- return ext2fs_unmark_generic_bitmap(gen_bitmap, arg); ++ return ext2fs_unmark_generic_bitmap(bitmap, arg); + } + + if (!EXT2FS_IS_64_BITMAP(bitmap)) +@@ -510,20 +492,19 @@ int ext2fs_unmark_generic_bmap(ext2fs_generic_bitmap gen_bitmap, + return bitmap->bitmap_ops->unmark_bmap(bitmap, arg); + } + +-int ext2fs_test_generic_bmap(ext2fs_generic_bitmap gen_bitmap, ++int ext2fs_test_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 arg) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; + if (!bitmap) + return 0; + + if (EXT2FS_IS_32_BITMAP(bitmap)) { + if (arg & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bitmap, EXT2FS_TEST_ERROR, ++ ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, + 0xffffffff); + return 0; + } +- return ext2fs_test_generic_bitmap(gen_bitmap, arg); ++ return ext2fs_test_generic_bitmap(bitmap, arg); + } + + if (!EXT2FS_IS_64_BITMAP(bitmap)) +@@ -548,22 +529,20 @@ int ext2fs_test_generic_bmap(ext2fs_generic_bitmap gen_bitmap, + return bitmap->bitmap_ops->test_bmap(bitmap, arg); + } + +-errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bmap, + __u64 start, unsigned int num, + void *in) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bmap)) { + if ((start+num-1) & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bmap, EXT2FS_UNMARK_ERROR, ++ ext2fs_warn_bitmap2(bmap, EXT2FS_UNMARK_ERROR, + 0xffffffff); + return EINVAL; + } +- return ext2fs_set_generic_bitmap_range(gen_bmap, bmap->magic, ++ return ext2fs_set_generic_bitmap_range(bmap, bmap->magic, + start, num, in); + } + +@@ -575,22 +554,20 @@ errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, + return bmap->bitmap_ops->set_bmap_range(bmap, start, num, in); + } + +-errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, ++errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bmap, + __u64 start, unsigned int num, + void *out) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- + if (!bmap) + return EINVAL; + + if (EXT2FS_IS_32_BITMAP(bmap)) { + if ((start+num-1) & ~0xffffffffULL) { +- ext2fs_warn_bitmap2(gen_bmap, ++ ext2fs_warn_bitmap2(bmap, + EXT2FS_UNMARK_ERROR, 0xffffffff); + return EINVAL; + } +- return ext2fs_get_generic_bitmap_range(gen_bmap, bmap->magic, ++ return ext2fs_get_generic_bitmap_range(bmap, bmap->magic, + start, num, out); + } + +@@ -603,11 +580,9 @@ errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap gen_bmap, + } + + errcode_t ext2fs_compare_generic_bmap(errcode_t neq, +- ext2fs_generic_bitmap gen_bm1, +- ext2fs_generic_bitmap gen_bm2) ++ ext2fs_generic_bitmap bm1, ++ ext2fs_generic_bitmap bm2) + { +- ext2fs_generic_bitmap_64 bm1 = (ext2fs_generic_bitmap_64) gen_bm1; +- ext2fs_generic_bitmap_64 bm2 = (ext2fs_generic_bitmap_64) gen_bm2; + blk64_t i; + + if (!bm1 || !bm2) +@@ -617,8 +592,7 @@ errcode_t ext2fs_compare_generic_bmap(errcode_t neq, + + /* Now we know both bitmaps have the same magic */ + if (EXT2FS_IS_32_BITMAP(bm1)) +- return ext2fs_compare_generic_bitmap(bm1->magic, neq, +- gen_bm1, gen_bm2); ++ return ext2fs_compare_generic_bitmap(bm1->magic, neq, bm1, bm2); + + if (!EXT2FS_IS_64_BITMAP(bm1)) + return EINVAL; +@@ -628,20 +602,19 @@ errcode_t ext2fs_compare_generic_bmap(errcode_t neq, + return neq; + + for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++) +- if (ext2fs_test_generic_bmap(gen_bm1, i) != +- ext2fs_test_generic_bmap(gen_bm2, i)) ++ if (ext2fs_test_generic_bmap(bm1, i) != ++ ext2fs_test_generic_bmap(bm2, i)) + return neq; + + return 0; + } + +-void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap gen_bmap) ++void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 start, num; + + if (EXT2FS_IS_32_BITMAP(bmap)) { +- ext2fs_set_generic_bitmap_padding(gen_bmap); ++ ext2fs_set_generic_bitmap_padding(bmap); + return; + } + +@@ -651,10 +624,9 @@ void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap gen_bmap) + /* XXX ought to warn on error */ + } + +-int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, ++int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap bmap, + blk64_t block, unsigned int num) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 end = block + num; + + if (!bmap) +@@ -696,10 +668,9 @@ int ext2fs_test_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, + return bmap->bitmap_ops->test_clear_bmap_extent(bmap, block, num); + } + +-void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, ++void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap bmap, + blk64_t block, unsigned int num) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 end = block + num; + + if (!bmap) +@@ -737,10 +708,9 @@ void ext2fs_mark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, + bmap->bitmap_ops->mark_bmap_extent(bmap, block, num); + } + +-void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, ++void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap bmap, + blk64_t block, unsigned int num) + { +- ext2fs_generic_bitmap_64 bmap = (ext2fs_generic_bitmap_64) gen_bmap; + __u64 end = block + num; + + if (!bmap) +@@ -778,10 +748,8 @@ void ext2fs_unmark_block_bitmap_range2(ext2fs_block_bitmap gen_bmap, + bmap->bitmap_ops->unmark_bmap_extent(bmap, block, num); + } + +-void ext2fs_warn_bitmap32(ext2fs_generic_bitmap gen_bitmap, const char *func) ++void ext2fs_warn_bitmap32(ext2fs_generic_bitmap bitmap, const char *func) + { +- ext2fs_generic_bitmap_64 bitmap = (ext2fs_generic_bitmap_64) gen_bitmap; +- + #ifndef OMIT_COM_ERR + if (bitmap && bitmap->description) + com_err(0, EXT2_ET_MAGIC_GENERIC_BITMAP, +@@ -796,22 +764,21 @@ void ext2fs_warn_bitmap32(ext2fs_generic_bitmap gen_bitmap, const char *func) + errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs, + ext2fs_block_bitmap *bitmap) + { +- ext2fs_generic_bitmap_64 bmap, cmap; +- ext2fs_block_bitmap gen_bmap = *bitmap, gen_cmap; ++ ext2fs_block_bitmap cmap, bmap; + errcode_t retval; + blk64_t i, b_end, c_end; + int n, ratio; + +- bmap = (ext2fs_generic_bitmap_64) gen_bmap; +- if (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(gen_bmap)) ++ bmap = *bitmap; ++ ++ if (fs->cluster_ratio_bits == ext2fs_get_bitmap_granularity(bmap)) + return 0; /* Nothing to do */ + + retval = ext2fs_allocate_block_bitmap(fs, "converted cluster bitmap", +- &gen_cmap); ++ &cmap); + if (retval) + return retval; + +- cmap = (ext2fs_generic_bitmap_64) gen_cmap; + i = bmap->start; + b_end = bmap->end; + bmap->end = bmap->real_end; +@@ -820,8 +787,8 @@ errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs, + n = 0; + ratio = 1 << fs->cluster_ratio_bits; + while (i < bmap->real_end) { +- if (ext2fs_test_block_bitmap2(gen_bmap, i)) { +- ext2fs_mark_block_bitmap2(gen_cmap, i); ++ if (ext2fs_test_block_bitmap2(bmap, i)) { ++ ext2fs_mark_block_bitmap2(cmap, i); + i += ratio - n; + n = 0; + continue; +@@ -832,15 +799,14 @@ errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs, + } + bmap->end = b_end; + cmap->end = c_end; +- ext2fs_free_block_bitmap(gen_bmap); +- *bitmap = (ext2fs_block_bitmap) cmap; ++ ext2fs_free_block_bitmap(bmap); ++ *bitmap = cmap; + return 0; + } + + errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { +- ext2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap; + __u64 cstart, cend, cout; + errcode_t retval; + +@@ -866,27 +832,27 @@ errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap, + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; + +- cstart = start >> bmap64->cluster_bits; +- cend = end >> bmap64->cluster_bits; ++ cstart = start >> bitmap->cluster_bits; ++ cend = end >> bitmap->cluster_bits; + +- if (cstart < bmap64->start || cend > bmap64->end || start > end) { +- warn_bitmap(bmap64, EXT2FS_TEST_ERROR, start); ++ if (cstart < bitmap->start || cend > bitmap->end || start > end) { ++ warn_bitmap(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +- if (bmap64->bitmap_ops->find_first_zero) { +- retval = bmap64->bitmap_ops->find_first_zero(bmap64, cstart, ++ if (bitmap->bitmap_ops->find_first_zero) { ++ retval = bitmap->bitmap_ops->find_first_zero(bitmap, cstart, + cend, &cout); + if (retval) + return retval; + found: +- cout <<= bmap64->cluster_bits; ++ cout <<= bitmap->cluster_bits; + *out = (cout >= start) ? cout : start; + return 0; + } + + for (cout = cstart; cout <= cend; cout++) +- if (!bmap64->bitmap_ops->test_bmap(bmap64, cout)) ++ if (!bitmap->bitmap_ops->test_bmap(bitmap, cout)) + goto found; + + return ENOENT; +@@ -895,7 +861,6 @@ errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitmap, + errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap, + __u64 start, __u64 end, __u64 *out) + { +- ext2fs_generic_bitmap_64 bmap64 = (ext2fs_generic_bitmap_64) bitmap; + __u64 cstart, cend, cout; + errcode_t retval; + +@@ -921,27 +886,27 @@ errcode_t ext2fs_find_first_set_generic_bmap(ext2fs_generic_bitmap bitmap, + if (!EXT2FS_IS_64_BITMAP(bitmap)) + return EINVAL; + +- cstart = start >> bmap64->cluster_bits; +- cend = end >> bmap64->cluster_bits; ++ cstart = start >> bitmap->cluster_bits; ++ cend = end >> bitmap->cluster_bits; + +- if (cstart < bmap64->start || cend > bmap64->end || start > end) { +- warn_bitmap(bmap64, EXT2FS_TEST_ERROR, start); ++ if (cstart < bitmap->start || cend > bitmap->end || start > end) { ++ warn_bitmap(bitmap, EXT2FS_TEST_ERROR, start); + return EINVAL; + } + +- if (bmap64->bitmap_ops->find_first_set) { +- retval = bmap64->bitmap_ops->find_first_set(bmap64, cstart, ++ if (bitmap->bitmap_ops->find_first_set) { ++ retval = bitmap->bitmap_ops->find_first_set(bitmap, cstart, + cend, &cout); + if (retval) + return retval; + found: +- cout <<= bmap64->cluster_bits; ++ cout <<= bitmap->cluster_bits; + *out = (cout >= start) ? cout : start; + return 0; + } + + for (cout = cstart; cout <= cend; cout++) +- if (bmap64->bitmap_ops->test_bmap(bmap64, cout)) ++ if (bitmap->bitmap_ops->test_bmap(bitmap, cout)) + goto found; + + return ENOENT; +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-append_pathname-check-the-value-returned-by-realloc.patch b/SOURCES/e2fsprogs-1.45.6-append_pathname-check-the-value-returned-by-realloc.patch new file mode 100644 index 0000000..cfcc1f1 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-append_pathname-check-the-value-returned-by-realloc.patch @@ -0,0 +1,48 @@ +From c74301ce5020c499445eb5c32bd70e4a1099a62d Mon Sep 17 00:00:00 2001 +From: wuguanghao +Date: Wed, 30 Jun 2021 16:27:18 +0800 +Subject: [PATCH 29/46] append_pathname: check the value returned by realloc +Content-Type: text/plain + +In append_pathname(), we need to add a new path to save the value +returned by realloc, otherwise the name->path may be NULL, causing +a segfault. + +Signed-off-by: Wu Guanghao +Signed-off-by: Zhiqiang Liu +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + contrib/fsstress.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/contrib/fsstress.c b/contrib/fsstress.c +index 2a983482..2136a903 100644 +--- a/contrib/fsstress.c ++++ b/contrib/fsstress.c +@@ -599,6 +599,7 @@ void add_to_flist(int ft, int id, int parent) + void append_pathname(pathname_t * name, char *str) + { + int len; ++ char *path; + + len = strlen(str); + #ifdef DEBUG +@@ -609,7 +610,13 @@ void append_pathname(pathname_t * name, char *str) + + } + #endif +- name->path = realloc(name->path, name->len + 1 + len); ++ path = realloc(name->path, name->len + 1 + len); ++ if (path == NULL) { ++ fprintf(stderr, "fsstress: append_pathname realloc failed\n"); ++ chdir(homedir); ++ abort(); ++ } ++ name->path = path; + strcpy(&name->path[name->len], str); + name->len += len; + } +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-argv_parse-check-return-value-of-malloc-in-argv_pars.patch b/SOURCES/e2fsprogs-1.45.6-argv_parse-check-return-value-of-malloc-in-argv_pars.patch new file mode 100644 index 0000000..11816ee --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-argv_parse-check-return-value-of-malloc-in-argv_pars.patch @@ -0,0 +1,34 @@ +From 9e298ba470a6abc7d94fe659cf65fcb0b993c0b8 Mon Sep 17 00:00:00 2001 +From: Zhiqiang Liu +Date: Wed, 30 Jun 2021 16:27:19 +0800 +Subject: [PATCH 30/46] argv_parse: check return value of malloc in + argv_parse() +Content-Type: text/plain + +In argv_parse(), return value of malloc should be checked +whether it is NULL, otherwise, it may cause a segfault error. + +Signed-off-by: Zhiqiang Liu +Signed-off-by: Wu Guanghao +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/support/argv_parse.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/support/argv_parse.c b/lib/support/argv_parse.c +index d22f6344..1f50f9e5 100644 +--- a/lib/support/argv_parse.c ++++ b/lib/support/argv_parse.c +@@ -116,6 +116,8 @@ int argv_parse(char *in_buf, int *ret_argc, char ***ret_argv) + if (argv == 0) { + argv = malloc(sizeof(char *)); + free(buf); ++ if (!argv) ++ return -1; + } + argv[argc] = 0; + if (ret_argc) +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-create_inode-set-xattrs-to-the-root-directory-as-wel.patch b/SOURCES/e2fsprogs-1.45.6-create_inode-set-xattrs-to-the-root-directory-as-wel.patch new file mode 100644 index 0000000..00eab72 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-create_inode-set-xattrs-to-the-root-directory-as-wel.patch @@ -0,0 +1,47 @@ +From ade5263a516e4081abc14f63a73a5e0a96bb3f71 Mon Sep 17 00:00:00 2001 +From: Antoine Tenart +Date: Fri, 17 Jul 2020 12:08:46 +0200 +Subject: [PATCH 13/46] create_inode: set xattrs to the root directory as well +Content-Type: text/plain + +populate_fs do copy the xattrs for all files and directories, but the +root directory is skipped and as a result its extended attributes aren't +set. This is an issue when using mkfs to build a full system image that +can be used with SElinux in enforcing mode without making any runtime +fix at first boot. + +This patch adds logic to set the root directory's extended attributes. + +Signed-off-by: Antoine Tenart +Reviewed-by: Andreas Dilger +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/create_inode.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/misc/create_inode.c b/misc/create_inode.c +index 837f3875..6f8487b9 100644 +--- a/misc/create_inode.c ++++ b/misc/create_inode.c +@@ -1050,9 +1050,17 @@ errcode_t populate_fs2(ext2_filsys fs, ext2_ino_t parent_ino, + file_info.path_max_len = 255; + file_info.path = calloc(file_info.path_max_len, 1); + ++ retval = set_inode_xattr(fs, root, source_dir); ++ if (retval) { ++ com_err(__func__, retval, ++ _("while copying xattrs on root directory")); ++ goto out; ++ } ++ + retval = __populate_fs(fs, parent_ino, source_dir, root, &hdlinks, + &file_info, fs_callbacks); + ++out: + free(file_info.path); + free(hdlinks.hdl); + return retval; +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-debugfs-fix-double-free-in-realloc-error-path-in-rea.patch b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-double-free-in-realloc-error-path-in-rea.patch new file mode 100644 index 0000000..1ca7351 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-double-free-in-realloc-error-path-in-rea.patch @@ -0,0 +1,35 @@ +From 4126c63885388e568ade780e9fed6ede37faf978 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 21 Jan 2021 16:01:14 -0500 +Subject: [PATCH 16/46] debugfs: fix double free in realloc() error path in + read_list() +Content-Type: text/plain + +Fixes-Coverity-Bug: 1464575 +Fixes-Coverity-Bug: 1464571 +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + debugfs/util.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/debugfs/util.c b/debugfs/util.c +index 759bb392..091f6f65 100644 +--- a/debugfs/util.c ++++ b/debugfs/util.c +@@ -545,10 +545,8 @@ errcode_t read_list(char *str, blk64_t **list, size_t *len) + goto err; + } + l = realloc(lst, sizeof(blk64_t) * (ln + y - x + 1)); +- if (l == NULL) { +- retval = ENOMEM; +- goto err; +- } ++ if (l == NULL) ++ return ENOMEM; + lst = l; + for (; x <= y; x++) + lst[ln++] = x; +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-allocation-failures-when-parsing-.patch b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-allocation-failures-when-parsing-.patch new file mode 100644 index 0000000..624db65 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-allocation-failures-when-parsing-.patch @@ -0,0 +1,92 @@ +From b31f493cadc92023056a096d0281957c49fca22c Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Fri, 12 Feb 2021 21:43:00 -0500 +Subject: [PATCH 19/46] debugfs: fix memory allocation failures when parsing + journal_write arguments +Content-Type: text/plain + +Fix double-free issues when parsing an invalid journal_write command, +such as: "journal_write -b 12 -b BAD -b 42". + +Addresses-Coverity-Bug: 1464571 +Addresses-Coverity-Bug: 1464575 +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + debugfs/do_journal.c | 8 ++++++-- + debugfs/util.c | 15 +++++++-------- + 2 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/debugfs/do_journal.c b/debugfs/do_journal.c +index 15ef6829..5091a530 100644 +--- a/debugfs/do_journal.c ++++ b/debugfs/do_journal.c +@@ -554,15 +554,19 @@ void do_journal_write(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)), + switch (opt) { + case 'b': + err = read_list(optarg, &blist, &bn); +- if (err) ++ if (err) { + com_err(argv[0], err, + "while reading block list"); ++ goto out; ++ } + break; + case 'r': + err = read_list(optarg, &rlist, &rn); +- if (err) ++ if (err) { + com_err(argv[0], err, + "while reading revoke list"); ++ goto out; ++ } + break; + case 'c': + flags |= JOURNAL_WRITE_NO_COMMIT; +diff --git a/debugfs/util.c b/debugfs/util.c +index 091f6f65..bbb20ff6 100644 +--- a/debugfs/util.c ++++ b/debugfs/util.c +@@ -521,7 +521,7 @@ errcode_t read_list(char *str, blk64_t **list, size_t *len) + blk64_t *lst = *list; + size_t ln = *len; + char *tok, *p = str; +- errcode_t retval; ++ errcode_t retval = 0; + + while ((tok = strtok(p, ","))) { + blk64_t *l; +@@ -538,15 +538,17 @@ errcode_t read_list(char *str, blk64_t **list, size_t *len) + return errno; + } else if (*e != 0) { + retval = EINVAL; +- goto err; ++ break; + } + if (y < x) { + retval = EINVAL; +- goto err; ++ break; + } + l = realloc(lst, sizeof(blk64_t) * (ln + y - x + 1)); +- if (l == NULL) +- return ENOMEM; ++ if (l == NULL) { ++ retval = ENOMEM; ++ break; ++ } + lst = l; + for (; x <= y; x++) + lst[ln++] = x; +@@ -555,8 +557,5 @@ errcode_t read_list(char *str, blk64_t **list, size_t *len) + + *list = lst; + *len = ln; +- return 0; +-err: +- free(lst); + return retval; + } +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-leak-problem-in-read_list.patch b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-leak-problem-in-read_list.patch new file mode 100644 index 0000000..5847307 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-memory-leak-problem-in-read_list.patch @@ -0,0 +1,46 @@ +From 9221fb77a7187957ed84e45bf6ad6f5e37755e5c Mon Sep 17 00:00:00 2001 +From: Zhiqiang Liu +Date: Sat, 20 Feb 2021 16:41:29 +0800 +Subject: [PATCH 22/46] debugfs: fix memory leak problem in read_list() +Content-Type: text/plain + +In read_list func, if strtoull() fails in while loop, +we will return the error code directly. Then, memory of +variable lst will be leaked without setting to *list. + +Signed-off-by: Zhiqiang Liu +Signed-off-by: linfeilong +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + debugfs/util.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/debugfs/util.c b/debugfs/util.c +index bbb20ff6..37620295 100644 +--- a/debugfs/util.c ++++ b/debugfs/util.c +@@ -530,12 +530,16 @@ errcode_t read_list(char *str, blk64_t **list, size_t *len) + + errno = 0; + y = x = strtoull(tok, &e, 0); +- if (errno) +- return errno; ++ if (errno) { ++ retval = errno; ++ break; ++ } + if (*e == '-') { + y = strtoull(e + 1, NULL, 0); +- if (errno) +- return errno; ++ if (errno) { ++ retval = errno; ++ break; ++ } + } else if (*e != 0) { + retval = EINVAL; + break; +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-debugfs-fix-parse_uint-for-64-bit-fields.patch b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-parse_uint-for-64-bit-fields.patch new file mode 100644 index 0000000..f84eec3 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-debugfs-fix-parse_uint-for-64-bit-fields.patch @@ -0,0 +1,54 @@ +From c78e3e170a63bb1804b47d4f5a6652aad0e4d3b2 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 6 Oct 2020 08:29:09 -0400 +Subject: [PATCH 12/46] debugfs: fix parse_uint for 64-bit fields +Content-Type: text/plain + +The logic for handling 64-bit structure elements was reversed, which +caused attempts to set fields like kbytes_written to fail: + + % debugfs -w /tmp/foo.img + debugfs 1.45.6 (20-Mar-2020) + debugfs: set_super_value kbytes_written 1024 + 64-bit field kbytes_written has a second 64-bit field + defined; BUG?!? + +https://github.com/tytso/e2fsprogs/issues/36 + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + debugfs/set_fields.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c +index 5142554d..281f2c5d 100644 +--- a/debugfs/set_fields.c ++++ b/debugfs/set_fields.c +@@ -487,10 +487,7 @@ static errcode_t parse_uint(struct field_set_info *info, char *field, + n = num & mask; + switch (size) { + case 8: +- /* Should never get here */ +- fprintf(stderr, "64-bit field %s has a second 64-bit field\n" +- "defined; BUG?!?\n", info->name); +- *u.ptr64 = 0; ++ *u.ptr64 = n; + break; + case 4: + *u.ptr32 = n; +@@ -510,7 +507,10 @@ static errcode_t parse_uint(struct field_set_info *info, char *field, + size = 2; + switch (size) { + case 8: +- *u.ptr64 = n; ++ /* Should never get here */ ++ fprintf(stderr, "64-bit field %s has a second 64-bit field\n" ++ "defined; BUG?!?\n", info->name); ++ *u.ptr64 = 0; + break; + case 4: + *u.ptr32 = n; +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-e2fsck-add-maximum-string-length-specifiers-to-fscan.patch b/SOURCES/e2fsprogs-1.45.6-e2fsck-add-maximum-string-length-specifiers-to-fscan.patch new file mode 100644 index 0000000..6a77f19 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-e2fsck-add-maximum-string-length-specifiers-to-fscan.patch @@ -0,0 +1,42 @@ +From c9d064c7a4e4ffbfaf95098c57381ee5394a1346 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 10 Aug 2021 15:36:46 -0400 +Subject: [PATCH 45/46] e2fsck: add maximum string length specifiers to fscanf + format strings +Content-Type: text/plain + +When parsing strings from /proc/apm and /proc/acpi/ac_adapter, add +string length limits to prevent possible buffer overruns. + +Addresses-Coverty-Bug: 1297496 +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + e2fsck/unix.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/e2fsck/unix.c b/e2fsck/unix.c +index 15a73e7c..ddd384b1 100644 +--- a/e2fsck/unix.c ++++ b/e2fsck/unix.c +@@ -302,7 +302,7 @@ static int is_on_batt(void) + } + f = fopen("/proc/apm", "r"); + if (f) { +- if (fscanf(f, "%s %s %s %x", tmp, tmp, tmp, &acflag) != 4) ++ if (fscanf(f, "%79s %79s %79s %x", tmp, tmp, tmp, &acflag) != 4) + acflag = 1; + fclose(f); + return (acflag != 1); +@@ -318,7 +318,7 @@ static int is_on_batt(void) + f = fopen(fname, "r"); + if (!f) + continue; +- if (fscanf(f, "%s %s", tmp2, tmp) != 2) ++ if (fscanf(f, "%79s %79s", tmp2, tmp) != 2) + tmp[0] = 0; + fclose(f); + if (strncmp(tmp, "off-line", 8) == 0) { +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-indexed-dir-rehash-failure-with-metadata_.patch b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-indexed-dir-rehash-failure-with-metadata_.patch new file mode 100644 index 0000000..31af3a6 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-indexed-dir-rehash-failure-with-metadata_.patch @@ -0,0 +1,43 @@ +From 5ddac7d248ad346b80702a397c886df4d1ec4f08 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 13 Feb 2020 11:15:57 +0100 +Subject: [PATCH 05/46] e2fsck: fix indexed dir rehash failure with + metadata_csum enabled +Content-Type: text/plain + +E2fsck directory rehashing code can fail with ENOSPC due to a bug in +ext2fs_htree_intnode_maxrecs() which fails to take metadata checksum +into account and thus e.g. e2fsck can decide to create 1 indirect level +of index tree when two are actually needed. Fix the logic to account for +metadata checksum. + +Reviewed-by: Andreas Dilger +Signed-off-by: Jan Kara +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/ext2fs.h | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h +index 32c75171..d9aec525 100644 +--- a/lib/ext2fs/ext2fs.h ++++ b/lib/ext2fs/ext2fs.h +@@ -2040,7 +2040,13 @@ _INLINE_ blk_t ext2fs_inode_data_blocks(ext2_filsys fs, + + _INLINE_ int ext2fs_htree_intnode_maxrecs(ext2_filsys fs, int blocks) + { +- return blocks * ((fs->blocksize - 8) / sizeof(struct ext2_dx_entry)); ++ int csum_size = 0; ++ ++ if ((EXT2_SB(fs->super)->s_feature_ro_compat & ++ EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) != 0) ++ csum_size = sizeof(struct ext2_dx_tail); ++ return blocks * ((fs->blocksize - (8 + csum_size)) / ++ sizeof(struct ext2_dx_entry)); + } + + /* +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch new file mode 100644 index 0000000..8babe73 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch @@ -0,0 +1,64 @@ +From b93c62c3d46ed363a88668d41a87500eb5d29f98 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Mon, 14 Jun 2021 15:27:25 +0200 +Subject: [PATCH 26/46] e2fsck: fix last mount/write time when e2fsck is forced +Content-Type: text/plain + +With commit c52d930f e2fsck is no longer able to fix bad last +mount/write time by default because it is conditioned on s_checkinterval +not being zero, which it is by default. + +One place where it matters is when other e2fsprogs tools require to run +full file system check before a certain operation. If the last mount +time is for any reason in future, it will not allow it to run even if +full e2fsck is ran. + +Fix it by checking the last mount/write time when the e2fsck is forced, +except for the case where we know the system clock is broken. + +[ Reworked the conditionals so error messages claiming that the last + write/mount time were corrupted wouldn't be always printed when the + e2fsck was run with the -f option, thus causing 299 out of 372 + regression tests to fail. -- TYT ] + +Fixes: c52d930f ("e2fsck: don't check for future superblock times if checkinterval == 0") +Reported-by: Dusty Mabe +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + e2fsck/super.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/e2fsck/super.c b/e2fsck/super.c +index e1c3f935..31e2ffb2 100644 +--- a/e2fsck/super.c ++++ b/e2fsck/super.c +@@ -1038,9 +1038,9 @@ void check_super_block(e2fsck_t ctx) + * Check to see if the superblock last mount time or last + * write time is in the future. + */ +- if (!broken_system_clock && fs->super->s_checkinterval && +- !(ctx->flags & E2F_FLAG_TIME_INSANE) && +- fs->super->s_mtime > (__u32) ctx->now) { ++ if (((ctx->options & E2F_OPT_FORCE) || fs->super->s_checkinterval) && ++ !broken_system_clock && !(ctx->flags & E2F_FLAG_TIME_INSANE) && ++ (fs->super->s_mtime > (__u32) ctx->now)) { + pctx.num = fs->super->s_mtime; + problem = PR_0_FUTURE_SB_LAST_MOUNT; + if (fs->super->s_mtime <= (__u32) ctx->now + ctx->time_fudge) +@@ -1050,9 +1050,9 @@ void check_super_block(e2fsck_t ctx) + fs->flags |= EXT2_FLAG_DIRTY; + } + } +- if (!broken_system_clock && fs->super->s_checkinterval && +- !(ctx->flags & E2F_FLAG_TIME_INSANE) && +- fs->super->s_wtime > (__u32) ctx->now) { ++ if (((ctx->options & E2F_OPT_FORCE) || fs->super->s_checkinterval) && ++ !broken_system_clock && !(ctx->flags & E2F_FLAG_TIME_INSANE) && ++ (fs->super->s_wtime > (__u32) ctx->now)) { + pctx.num = fs->super->s_wtime; + problem = PR_0_FUTURE_SB_LAST_WRITE; + if (fs->super->s_wtime <= (__u32) ctx->now + ctx->time_fudge) +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-off-by-one-check-when-validating-depth-of.patch b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-off-by-one-check-when-validating-depth-of.patch new file mode 100644 index 0000000..d674ef2 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-off-by-one-check-when-validating-depth-of.patch @@ -0,0 +1,31 @@ +From 669a17d35cdfd9cf5b76e97016fae2df2d72e768 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Fri, 10 Apr 2020 00:30:52 -0400 +Subject: [PATCH 07/46] e2fsck: fix off-by-one check when validating depth of + an htree +Content-Type: text/plain + +Fixes: 3f0cf6475399 ("e2fsprogs: add support for 3-level htree") + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + e2fsck/pass1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c +index c9e8bf82..38afda48 100644 +--- a/e2fsck/pass1.c ++++ b/e2fsck/pass1.c +@@ -2685,7 +2685,7 @@ static int handle_htree(e2fsck_t ctx, struct problem_context *pctx, + return 1; + + pctx->num = root->indirect_levels; +- if ((root->indirect_levels > ext2_dir_htree_level(fs)) && ++ if ((root->indirect_levels >= ext2_dir_htree_level(fs)) && + fix_problem(ctx, PR_1_HTREE_DEPTH, pctx)) + return 1; + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-e2fsck-use-size_t-instead-of-int-in-string_copy.patch b/SOURCES/e2fsprogs-1.45.6-e2fsck-use-size_t-instead-of-int-in-string_copy.patch new file mode 100644 index 0000000..4f1f2e2 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-e2fsck-use-size_t-instead-of-int-in-string_copy.patch @@ -0,0 +1,47 @@ +From 8a97e4f67f75a4584f7562b7e5d866431c88152e Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Fri, 5 Jun 2020 10:14:40 +0200 +Subject: [PATCH 09/46] e2fsck: use size_t instead of int in string_copy() +Content-Type: text/plain + +len argument in string_copy() is int, but it is used with malloc(), +strlen(), strncpy() and some callers use sizeof() to pass value in. So +it really ought to be size_t rather than int. Fix it. + +Signed-off-by: Lukas Czerner +Reviewed-by: Andreas Dilger +Signed-off-by: Theodore Ts'o +--- + e2fsck/e2fsck.h | 2 +- + e2fsck/util.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h +index feb605c7..7e0895c2 100644 +--- a/e2fsck/e2fsck.h ++++ b/e2fsck/e2fsck.h +@@ -608,7 +608,7 @@ extern void log_err(e2fsck_t ctx, const char *fmt, ...) + extern void e2fsck_read_bitmaps(e2fsck_t ctx); + extern void e2fsck_write_bitmaps(e2fsck_t ctx); + extern void preenhalt(e2fsck_t ctx); +-extern char *string_copy(e2fsck_t ctx, const char *str, int len); ++extern char *string_copy(e2fsck_t ctx, const char *str, size_t len); + extern int fs_proc_check(const char *fs_name); + extern int check_for_modules(const char *fs_name); + #ifdef RESOURCE_TRACK +diff --git a/e2fsck/util.c b/e2fsck/util.c +index d98b8e47..88e0ea8a 100644 +--- a/e2fsck/util.c ++++ b/e2fsck/util.c +@@ -135,7 +135,7 @@ void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned long size, + } + + char *string_copy(e2fsck_t ctx EXT2FS_ATTR((unused)), +- const char *str, int len) ++ const char *str, size_t len) + { + char *ret; + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-e2image-fix-overflow-in-l2-table-processing.patch b/SOURCES/e2fsprogs-1.45.6-e2image-fix-overflow-in-l2-table-processing.patch new file mode 100644 index 0000000..3862507 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-e2image-fix-overflow-in-l2-table-processing.patch @@ -0,0 +1,38 @@ +From 1a97380b1cc4d167697e31e5fb663e805629c1ab Mon Sep 17 00:00:00 2001 +From: Artem Blagodarenko +Date: Thu, 22 Apr 2021 01:24:48 -0400 +Subject: [PATCH 25/46] e2image: fix overflow in l2 table processing +Content-Type: text/plain + +For a large partition during e2image capture process +it is possible to overflow offset at multiply operation. +This leads to the situation when data is written to the +position at the start of the image instead of the image end. + +Let's use the right cast to avoid integer overflow. + +Signed-off-by: Alexey Lyashkov +Signed-off-by: Artem Blagodarenko +HPE-bug-id: LUS-9368 +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/qcow2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/ext2fs/qcow2.c b/lib/ext2fs/qcow2.c +index ee701f7a..20824170 100644 +--- a/lib/ext2fs/qcow2.c ++++ b/lib/ext2fs/qcow2.c +@@ -238,7 +238,7 @@ int qcow2_write_raw_image(int qcow2_fd, int raw_fd, + if (offset == 0) + continue; + +- off_out = (l1_index * img.l2_size) + ++ off_out = ((__u64)l1_index * img.l2_size) + + l2_index; + off_out <<= img.cluster_bits; + ret = qcow2_copy_data(qcow2_fd, raw_fd, offset, +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-ext2ed-fix-potential-NULL-pointer-dereference-in-dup.patch b/SOURCES/e2fsprogs-1.45.6-ext2ed-fix-potential-NULL-pointer-dereference-in-dup.patch new file mode 100644 index 0000000..bb6b713 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-ext2ed-fix-potential-NULL-pointer-dereference-in-dup.patch @@ -0,0 +1,34 @@ +From c0a66f76f9c5b2ed0c2f20d1b59b4715f10a60f7 Mon Sep 17 00:00:00 2001 +From: Zhiqiang Liu +Date: Wed, 30 Jun 2021 16:27:24 +0800 +Subject: [PATCH 33/46] ext2ed: fix potential NULL pointer dereference in + dupstr() +Content-Type: text/plain + +In dupstr(), we should check return value of malloc(). + +Signed-off-by: Zhiqiang Liu +Signed-off-by: Wu Guanghao +Reviewed-by: Wu Bo +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + ext2ed/main.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ext2ed/main.c b/ext2ed/main.c +index f7e7d7df..9d33a8e1 100644 +--- a/ext2ed/main.c ++++ b/ext2ed/main.c +@@ -524,6 +524,8 @@ char *dupstr (char *src) + char *ptr; + + ptr=(char *) malloc (strlen (src)+1); ++ if (!ptr) ++ return NULL; + strcpy (ptr,src); + return (ptr); + } +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch b/SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch new file mode 100644 index 0000000..82363c5 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch @@ -0,0 +1,51 @@ +From 9039cf5c5da439f6c65435c0a2b9ae16989940e1 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 14 Jan 2020 20:56:41 +0100 +Subject: [PATCH 7/7] ext2fs: fix ABI change in the struct_ext2_filsys + structure + +Upstream increased size of the struct_ext2_filsys structure by adding +new encoding member. However this represents ABI breakage within a major +RHEL release. To avoid it use some of the reserved space in the +struct_ext2_filsys structure. + +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/ext2fs.h | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h +index ba83534c..32c75171 100644 +--- a/lib/ext2fs/ext2fs.h ++++ b/lib/ext2fs/ext2fs.h +@@ -250,10 +250,17 @@ struct struct_ext2_filsys { + int cluster_ratio_bits; + __u16 default_bitmap_type; + __u16 pad; ++ ++ /* ++ * RedHat specific change to prevent ABI change by using 8 ++ * reserved bytes ++ */ ++ const struct ext2fs_nls_table *encoding; ++ + /* + * Reserved for future expansion + */ +- __u32 reserved[5]; ++ __u32 reserved[5 - (sizeof(long int)/4)]; + + /* + * Reserved for the use of the calling application. +@@ -304,8 +311,6 @@ struct struct_ext2_filsys { + + /* hashmap for SHA of data blocks */ + struct ext2fs_hashmap* block_sha_map; +- +- const struct ext2fs_nls_table *encoding; + }; + + #if EXT2_FLAT_INCLUDES +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-filefrag-handle-invalid-st_dev-and-blksize-cases.patch b/SOURCES/e2fsprogs-1.45.6-filefrag-handle-invalid-st_dev-and-blksize-cases.patch new file mode 100644 index 0000000..a05c390 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-filefrag-handle-invalid-st_dev-and-blksize-cases.patch @@ -0,0 +1,54 @@ +From 381bc5d98b2a8a65b1f559e31e67361a761aefee Mon Sep 17 00:00:00 2001 +From: Luis Henriques +Date: Wed, 28 Oct 2020 15:55:50 +0000 +Subject: [PATCH 14/46] filefrag: handle invalid st_dev and blksize cases +Content-Type: text/plain + +It is possible to crash filefrag with a "Floating point exception" in +two different scenarios: + +1. When fstat() returns a device ID set to 0 +2. When FIGETBSZ ioctl returns a blocksize of 0 + +In both scenarios a divide-by-zero will occur in frag_report() because +variable blksize will be set to zero. + +I've managed to trigger this crash with an old CephFS kernel client, +using xfstest generic/519. The first scenario has been fixed by kernel +commit 75c9627efb72 ("ceph: map snapid to anonymous bdev ID"). The +second scenario is also fixed with commit 8f97d1e99149 ("vfs: fix +FIGETBSZ ioctl on an overlayfs file"). + +However, it is desirable to handle these two scenarios gracefully by +checking these conditions explicitly. + +Signed-off-by: Luis Henriques +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/filefrag.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/misc/filefrag.c b/misc/filefrag.c +index 032535f3..a5b9bfe9 100644 +--- a/misc/filefrag.c ++++ b/misc/filefrag.c +@@ -418,13 +418,13 @@ static int frag_report(const char *filename) + goto out_close; + } + +- if (last_device != st.st_dev) { ++ if ((last_device != st.st_dev) || !st.st_dev) { + if (fstatfs(fd, &fsinfo) < 0) { + rc = -errno; + perror("fstatfs"); + goto out_close; + } +- if (ioctl(fd, FIGETBSZ, &blksize) < 0) ++ if ((ioctl(fd, FIGETBSZ, &blksize) < 0) || !blksize) + blksize = fsinfo.f_bsize; + if (verbose) + printf("Filesystem type is: %lx\n", +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-lib-ss-error.c-check-return-value-malloc-in-ss_name.patch b/SOURCES/e2fsprogs-1.45.6-lib-ss-error.c-check-return-value-malloc-in-ss_name.patch new file mode 100644 index 0000000..b476690 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-lib-ss-error.c-check-return-value-malloc-in-ss_name.patch @@ -0,0 +1,33 @@ +From 693c06539f0c168c6edf32d25b4c64835a1e3f31 Mon Sep 17 00:00:00 2001 +From: Zhiqiang Liu +Date: Wed, 30 Jun 2021 16:27:21 +0800 +Subject: [PATCH 32/46] lib/ss/error.c: check return value malloc in ss_name() +Content-Type: text/plain + +In ss_name(), we should check return value of malloc(), +otherwise, it may cause a segmentation fault problem. + +Signed-off-by: Zhiqiang Liu +Signed-off-by: Wu Guanghao +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ss/error.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/ss/error.c b/lib/ss/error.c +index 8d345a9f..656b71be 100644 +--- a/lib/ss/error.c ++++ b/lib/ss/error.c +@@ -42,6 +42,8 @@ char *ss_name(int sci_idx) + (strlen(infop->subsystem_name)+ + strlen(infop->current_request)+ + 4)); ++ if (ret_val == (char *)NULL) ++ return ((char *)NULL); + cp = ret_val; + cp1 = infop->subsystem_name; + while (*cp1) +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-add-sanity-check-to-extent-manipulation.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-add-sanity-check-to-extent-manipulation.patch new file mode 100644 index 0000000..fa47b22 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-add-sanity-check-to-extent-manipulation.patch @@ -0,0 +1,56 @@ +From 265fcf9204fd06f574578ebe780f24e62bac2e86 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Thu, 21 Apr 2022 19:31:48 +0200 +Subject: [PATCH 1/2] libext2fs: add sanity check to extent manipulation +Content-Type: text/plain + +It is possible to have a corrupted extent tree in such a way that a leaf +node contains zero extents in it. Currently if that happens and we try +to traverse the tree we can end up accessing wrong data, or possibly +even uninitialized memory. Make sure we don't do that. + +Additionally make sure that we have a sane number of bytes passed to +memmove() in ext2fs_extent_delete(). + +Note that e2fsck is currently unable to spot and fix such corruption in +pass1. + +Signed-off-by: Lukas Czerner +Reported-by: Nils Bars +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113 +Addresses: CVE-2022-1304 +Addresses-Debian-Bug: #1010263 +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/extent.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c +index ac3dbfec..a1b1905c 100644 +--- a/lib/ext2fs/extent.c ++++ b/lib/ext2fs/extent.c +@@ -495,6 +495,10 @@ retry: + ext2fs_le16_to_cpu(eh->eh_entries); + newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max); + ++ /* Make sure there is at least one extent present */ ++ if (newpath->left <= 0) ++ return EXT2_ET_EXTENT_NO_DOWN; ++ + if (path->left > 0) { + ix++; + newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block); +@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags) + + cp = path->curr; + ++ /* Sanity check before memmove() */ ++ if (path->left < 0) ++ return EXT2_ET_EXTENT_LEAF_BAD; ++ + if (path->left) { + memmove(cp, cp + sizeof(struct ext3_extent_idx), + path->left * sizeof(struct ext3_extent_idx)); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-don-t-needlessly-byte-swap-the-group-descr.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-don-t-needlessly-byte-swap-the-group-descr.patch new file mode 100644 index 0000000..c88f9a3 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-don-t-needlessly-byte-swap-the-group-descr.patch @@ -0,0 +1,58 @@ +From 1aecdcc5c805e5e2114dd14877e9e1771fb519bf Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 16 Jan 2020 19:17:26 -0500 +Subject: [PATCH 04/46] libext2fs: don't needlessly byte swap the group + descriptors in ext2fs_flush +Content-Type: text/plain + +If the EXT2_FLAG_SUPER_ONLY is set, there's no reason to allocate the +shadow block group descriptors and byte swap the group descriptors. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/closefs.c | 24 ++++++++++++++---------- + 1 file changed, 14 insertions(+), 10 deletions(-) + +diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c +index 6814cdc3..69cbdd8c 100644 +--- a/lib/ext2fs/closefs.c ++++ b/lib/ext2fs/closefs.c +@@ -331,20 +331,24 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags) + #ifdef WORDS_BIGENDIAN + retval = EXT2_ET_NO_MEMORY; + retval = ext2fs_get_mem(SUPERBLOCK_SIZE, &super_shadow); +- if (retval) +- goto errout; +- retval = ext2fs_get_array(fs->desc_blocks, fs->blocksize, +- &group_shadow); + if (retval) + goto errout; + memcpy(super_shadow, fs->super, sizeof(struct ext2_super_block)); +- memcpy(group_shadow, fs->group_desc, (size_t) fs->blocksize * +- fs->desc_blocks); +- + ext2fs_swap_super(super_shadow); +- for (j = 0; j < fs->group_desc_count; j++) { +- gdp = ext2fs_group_desc(fs, group_shadow, j); +- ext2fs_swap_group_desc2(fs, gdp); ++ ++ if (((fs->flags & EXT2_FLAG_SUPER_ONLY) == 0) && ++ !ext2fs_has_feature_journal_dev(fs->super)) { ++ retval = ext2fs_get_array(fs->desc_blocks, fs->blocksize, ++ &group_shadow); ++ if (retval) ++ goto errout; ++ memcpy(group_shadow, fs->group_desc, (size_t) fs->blocksize * ++ fs->desc_blocks); ++ ++ for (j = 0; j < fs->group_desc_count; j++) { ++ gdp = ext2fs_group_desc(fs, group_shadow, j); ++ ext2fs_swap_group_desc2(fs, gdp); ++ } + } + #else + super_shadow = fs->super; +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_image_super_write-on-B.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_image_super_write-on-B.patch new file mode 100644 index 0000000..c4f4dab --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_image_super_write-on-B.patch @@ -0,0 +1,69 @@ +From 20a8dbefbc0510430aa7744692221b843b657f62 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 14 Jan 2020 10:58:10 -0500 +Subject: [PATCH 02/46] libext2fs: fix crash in ext2fs_image_super_write() on + Big Endian systems +Content-Type: text/plain + +This is a similar fix as c9a8c53b17cc ("libext2fs: fix crash in +ext2fs_open2() on Big Endian systems"). + +Commit e6069a05: ("Teach ext2fs_open2() to honor the +EXT2_FLAG_SUPER_ONLY flag") changed how the function +ext2fs_group_desc() handled a request for a gdp pointer for a group +larger than the number of groups in the file system; it now returns +NULL, instead of returning a pointer beyond the end of the array. + +Previously, the ext2fs_imager_super_write() function would swap all of +the block group descriptors in a block, even if they are beyond the +end of the file system. This was OK, since we were not overrunning +the allocated memory, since it was rounded to a block boundary. But +now that ext2fs_group_desc() would return NULL for those gdp, it would +cause ext2fs_open2(), when it was byte swapping the block group +descriptors on Big Endian systems, to dereference a null pointer and +crash. + +This commit adds a NULL pointer check to avoid byte swapping those +block group descriptors in a bg descriptor block, but which are beyond +the end of the file system, to address this crash. + +Signed-off-by: Theodore Ts'o +Reported-by: Anatoly Pugachev +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/imager.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c +index b3ede9a8..f8d67d86 100644 +--- a/lib/ext2fs/imager.c ++++ b/lib/ext2fs/imager.c +@@ -249,10 +249,10 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, + * if needed + */ + groups_per_block = EXT2_DESC_PER_BLOCK(fs->super); +- gdp = (struct ext2_group_desc *) cp; + for (j=0; j < groups_per_block*fs->desc_blocks; j++) { + gdp = ext2fs_group_desc(fs, fs->group_desc, j); +- ext2fs_swap_group_desc2(fs, gdp); ++ if (gdp) ++ ext2fs_swap_group_desc2(fs, gdp); + } + #endif + +@@ -261,10 +261,10 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, + + #ifdef WORDS_BIGENDIAN + groups_per_block = EXT2_DESC_PER_BLOCK(fs->super); +- gdp = (struct ext2_group_desc *) cp; + for (j=0; j < groups_per_block*fs->desc_blocks; j++) { + gdp = ext2fs_group_desc(fs, fs->group_desc, j); +- ext2fs_swap_group_desc2(fs, gdp); ++ if (gdp) ++ ext2fs_swap_group_desc2(fs, gdp); + } + #endif + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_open2-on-Big-Endian-sy.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_open2-on-Big-Endian-sy.patch new file mode 100644 index 0000000..2f1d2cc --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_open2-on-Big-Endian-sy.patch @@ -0,0 +1,59 @@ +From db2efc9e0a8cdb70afc8dd7c9621da9376da7afb Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 26 Dec 2019 23:19:54 -0500 +Subject: [PATCH 01/46] libext2fs: fix crash in ext2fs_open2() on Big Endian + systems +Content-Type: text/plain + +Commit e6069a05: ("Teach ext2fs_open2() to honor the +EXT2_FLAG_SUPER_ONLY flag") changed how the function +ext2fs_group_desc() handled a request for a gdp pointer for a group +larger than the number of groups in the file system; it now returns +NULL, instead of returning a pointer beyond the end of the array. + +Previously, the ext2fs_open2() function would swap all of the block +group descriptors in a block, even if they are beyond the end of the +file system. This was OK, since we were not overrunning the allocated +memory, since it was rounded to a block boundary. But now that +ext2fs_group_desc() would return NULL for those gdp, it would cause +ext2fs_open2(), when it was byte swapping the block group descriptors +on Big Endian systems, to dereference a null pointer and crash. + +This commit adds a NULL pointer check to avoid byte swapping those +block group descriptors in a bg descriptor block, but which are beyond +the end of the file system, to address this crash. + +Signed-off-by: Theodore Ts'o +Reported-by: Anatoly Pugachev +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/openfs.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c +index 51b54a44..e457ce1a 100644 +--- a/lib/ext2fs/openfs.c ++++ b/lib/ext2fs/openfs.c +@@ -433,7 +433,8 @@ errcode_t ext2fs_open2(const char *name, const char *io_options, + gdp = (struct ext2_group_desc *) dest; + for (j=0; j < groups_per_block*first_meta_bg; j++) { + gdp = ext2fs_group_desc(fs, fs->group_desc, j); +- ext2fs_swap_group_desc2(fs, gdp); ++ if (gdp) ++ ext2fs_swap_group_desc2(fs, gdp); + } + #endif + dest += fs->blocksize*first_meta_bg; +@@ -453,7 +454,8 @@ errcode_t ext2fs_open2(const char *name, const char *io_options, + for (j=0; j < groups_per_block; j++) { + gdp = ext2fs_group_desc(fs, fs->group_desc, + i * groups_per_block + j); +- ext2fs_swap_group_desc2(fs, gdp); ++ if (gdp) ++ ext2fs_swap_group_desc2(fs, gdp); + } + #endif + dest += fs->blocksize; +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-when-ext2fs_mmp_stop-is-called-b.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-when-ext2fs_mmp_stop-is-called-b.patch new file mode 100644 index 0000000..350d3ef --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-crash-when-ext2fs_mmp_stop-is-called-b.patch @@ -0,0 +1,36 @@ +From df34e45c71cff889927a412c6296d02866cdc5cc Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sun, 14 Feb 2021 23:51:45 -0500 +Subject: [PATCH 20/46] libext2fs: fix crash when ext2fs_mmp_stop() is called + before MMP is initialized +Content-Type: text/plain + +The fatal_error() function in e2fsck can call ext2fs_mmp_stop() on a +file system where MMP hasn't yet been initialized. When that happens, +instead of crashing, have ext2fs_mmp_stop() return success, since mmp +doesn't need to be stopped if it hasn't even been initialized yet. + +Addresses-Debian-Bug: #696609 +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/mmp.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/ext2fs/mmp.c b/lib/ext2fs/mmp.c +index 973b9ecd..eddc66a7 100644 +--- a/lib/ext2fs/mmp.c ++++ b/lib/ext2fs/mmp.c +@@ -401,7 +401,8 @@ errcode_t ext2fs_mmp_stop(ext2_filsys fs) + errcode_t retval = 0; + + if (!ext2fs_has_feature_mmp(fs->super) || +- !(fs->flags & EXT2_FLAG_RW) || (fs->flags & EXT2_FLAG_SKIP_MMP)) ++ !(fs->flags & EXT2_FLAG_RW) || (fs->flags & EXT2_FLAG_SKIP_MMP) || ++ (fs->mmp_buf == NULL) || (fs->mmp_cmp == NULL)) + goto mmp_error; + + retval = ext2fs_mmp_read(fs, fs->super->s_mmp_block, fs->mmp_buf); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-incorrect-negative-error-return-in-uni.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-incorrect-negative-error-return-in-uni.patch new file mode 100644 index 0000000..02d8e3c --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-incorrect-negative-error-return-in-uni.patch @@ -0,0 +1,52 @@ +From c951a12b1594158bb87fbc4d8a89b326c34e711f Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 21 Jan 2021 16:00:01 -0500 +Subject: [PATCH 15/46] libext2fs: fix incorrect negative error return in unix + and sparse io managers +Content-Type: text/plain + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/sparse_io.c | 4 ++-- + lib/ext2fs/unix_io.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/ext2fs/sparse_io.c b/lib/ext2fs/sparse_io.c +index 5e0e2cd9..f287e76d 100644 +--- a/lib/ext2fs/sparse_io.c ++++ b/lib/ext2fs/sparse_io.c +@@ -138,7 +138,7 @@ static errcode_t io_manager_configure(struct sparse_io_params *params, + retval = io_manager_import_sparse(params, sm, io); + if (retval) { + if (!params->block_size || !params->blocks_count) { +- retval = -EINVAL; ++ retval = EINVAL; + goto err_params; + } + sm->block_size = params->block_size; +@@ -229,7 +229,7 @@ static errcode_t read_sparse_argv(const char *name, bool is_fd, + + if (ret < 1) { + free(sparse_params->file); +- return -EINVAL; ++ return EINVAL; + } + return 0; + } +diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c +index 628e60c3..2bcd435c 100644 +--- a/lib/ext2fs/unix_io.c ++++ b/lib/ext2fs/unix_io.c +@@ -733,7 +733,7 @@ static errcode_t unixfd_open(const char *str_fd, int flags, + #if defined(HAVE_FCNTL) + fd_flags = fcntl(fd, F_GETFD); + if (fd_flags == -1) +- return -EBADF; ++ return EBADF; + + flags = 0; + if (fd_flags & O_RDWR) +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-potential-buffer-overrun-in-__get_dire.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-potential-buffer-overrun-in-__get_dire.patch new file mode 100644 index 0000000..c193075 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-potential-buffer-overrun-in-__get_dire.patch @@ -0,0 +1,40 @@ +From b7466a55e89aa6d6a649734f2b1b24a03390bcef Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Wed, 26 Aug 2020 16:29:29 -0400 +Subject: [PATCH 08/46] libext2fs: fix potential buffer overrun in + __get_dirent_tail() +Content-Type: text/plain + +If the file system is corrupted, there is a potential of a read-only +buffer overrun. Fortunately, we don't actually use the result of that +pointer dereference, and the overrun is at most 64k. + +Google-Bug-Id: #158564737 +Fixes: eb88b751745b ("libext2fs: make ext2fs_dirent_has_tail() more strict") +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/csum.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c +index a7172580..2151003b 100644 +--- a/lib/ext2fs/csum.c ++++ b/lib/ext2fs/csum.c +@@ -266,12 +266,11 @@ static errcode_t __get_dirent_tail(ext2_filsys fs, + d = dirent; + top = EXT2_DIRENT_TAIL(dirent, fs->blocksize); + +- rec_len = translate(d->rec_len); + while ((void *) d < top) { ++ rec_len = translate(d->rec_len); + if ((rec_len < 8) || (rec_len & 0x03)) + return EXT2_ET_DIR_CORRUPTED; + d = (struct ext2_dir_entry *)(((char *)d) + rec_len); +- rec_len = translate(d->rec_len); + } + + if ((void *)d > ((void *)dirent + fs->blocksize)) +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-segault-when-setting-an-xattr-with-an-.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-segault-when-setting-an-xattr-with-an-.patch new file mode 100644 index 0000000..1369133 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-segault-when-setting-an-xattr-with-an-.patch @@ -0,0 +1,212 @@ +From 9beb50cd2c05f69f1231eb1f4579d6770ef48359 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sun, 7 Feb 2021 23:21:58 -0500 +Subject: [PATCH 18/46] libext2fs: fix segault when setting an xattr with an + unknown prefix +Content-Type: text/plain + +Also avoid unnecessary calls to find_ea_index() by caching the short +name and name index in the ext2_attr structure. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/ext_attr.c | 64 +++++++++++++++++++++---------------------- + 1 file changed, 32 insertions(+), 32 deletions(-) + +diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c +index 871319a5..8a7a17cf 100644 +--- a/lib/ext2fs/ext_attr.c ++++ b/lib/ext2fs/ext_attr.c +@@ -293,7 +293,9 @@ errcode_t ext2fs_adjust_ea_refcount(ext2_filsys fs, blk_t blk, + + /* Manipulate the contents of extended attribute regions */ + struct ext2_xattr { ++ int name_index; + char *name; ++ char *short_name; + void *value; + unsigned int value_len; + ext2_ino_t ea_ino; +@@ -643,29 +645,23 @@ write_xattrs_to_buffer(ext2_filsys fs, struct ext2_xattr *attrs, int count, + struct ext2_xattr *x; + struct ext2_ext_attr_entry *e = entries_start; + char *end = (char *) entries_start + storage_size; +- const char *shortname; + unsigned int value_size; +- int idx, ret; + errcode_t err; + + memset(entries_start, 0, storage_size); + for (x = attrs; x < attrs + count; x++) { +- /* Calculate index and shortname position */ +- shortname = x->name; +- ret = find_ea_index(x->name, &shortname, &idx); +- + value_size = ((x->value_len + EXT2_EXT_ATTR_PAD - 1) / + EXT2_EXT_ATTR_PAD) * EXT2_EXT_ATTR_PAD; + + /* Fill out e appropriately */ +- e->e_name_len = strlen(shortname); +- e->e_name_index = (ret ? idx : 0); ++ e->e_name_len = strlen(x->short_name); ++ e->e_name_index = x->name_index; + + e->e_value_size = x->value_len; + e->e_value_inum = x->ea_ino; + + /* Store name */ +- memcpy((char *)e + sizeof(*e), shortname, e->e_name_len); ++ memcpy((char *)e + sizeof(*e), x->short_name, e->e_name_len); + if (x->ea_ino) { + e->e_value_offs = 0; + } else { +@@ -875,6 +871,8 @@ static errcode_t read_xattrs_from_buffer(struct ext2_xattr_handle *handle, + memcpy(x->name + prefix_len, + (char *)entry + sizeof(*entry), + entry->e_name_len); ++ x->short_name = x->name + prefix_len; ++ x->name_index = entry->e_name_index; + + /* Check & copy value */ + if (!ext2fs_has_feature_ea_inode(handle->fs->super) && +@@ -1302,7 +1300,8 @@ out: + } + + static errcode_t xattr_update_entry(ext2_filsys fs, struct ext2_xattr *x, +- const char *name, const void *value, ++ const char *name, const char *short_name, ++ int index, const void *value, + size_t value_len, int in_inode) + { + ext2_ino_t ea_ino = 0; +@@ -1336,8 +1335,11 @@ static errcode_t xattr_update_entry(ext2_filsys fs, struct ext2_xattr *x, + goto fail; + } + +- if (!x->name) ++ if (!x->name) { + x->name = new_name; ++ x->short_name = new_name + (short_name - name); ++ } ++ x->name_index = index; + + if (x->value) + ext2fs_free_mem(&x->value); +@@ -1356,31 +1358,27 @@ fail: + } + + static int xattr_find_position(struct ext2_xattr *attrs, int count, +- const char *name) ++ const char *shortname, int name_idx) + { + struct ext2_xattr *x; + int i; +- const char *shortname, *x_shortname; +- int name_idx, x_name_idx; + int shortname_len, x_shortname_len; + +- find_ea_index(name, &shortname, &name_idx); + shortname_len = strlen(shortname); + + for (i = 0, x = attrs; i < count; i++, x++) { +- find_ea_index(x->name, &x_shortname, &x_name_idx); +- if (name_idx < x_name_idx) ++ if (name_idx < x->name_index) + break; +- if (name_idx > x_name_idx) ++ if (name_idx > x->name_index) + continue; + +- x_shortname_len = strlen(x_shortname); ++ x_shortname_len = strlen(x->short_name); + if (shortname_len < x_shortname_len) + break; + if (shortname_len > x_shortname_len) + continue; + +- if (memcmp(shortname, x_shortname, shortname_len) <= 0) ++ if (memcmp(shortname, x->short_name, shortname_len) <= 0) + break; + } + return i; +@@ -1395,8 +1393,8 @@ static errcode_t xattr_array_update(struct ext2_xattr_handle *h, + struct ext2_xattr tmp; + int add_to_ibody; + int needed; +- int name_len, name_idx; +- const char *shortname; ++ int name_len, name_idx = 0; ++ const char *shortname = name; + int new_idx; + int ret; + +@@ -1423,7 +1421,8 @@ static errcode_t xattr_array_update(struct ext2_xattr_handle *h, + + /* Update the existing entry. */ + ret = xattr_update_entry(h->fs, &h->attrs[old_idx], name, +- value, value_len, in_inode); ++ shortname, name_idx, value, ++ value_len, in_inode); + if (ret) + return ret; + if (h->ibody_count <= old_idx) { +@@ -1451,7 +1450,8 @@ static errcode_t xattr_array_update(struct ext2_xattr_handle *h, + if (old_idx >= 0) { + /* Update the existing entry. */ + ret = xattr_update_entry(h->fs, &h->attrs[old_idx], name, +- value, value_len, in_inode); ++ shortname, name_idx, value, ++ value_len, in_inode); + if (ret) + return ret; + if (old_idx < h->ibody_count) { +@@ -1460,7 +1460,8 @@ static errcode_t xattr_array_update(struct ext2_xattr_handle *h, + * entries in the block are sorted. + */ + new_idx = xattr_find_position(h->attrs + h->ibody_count, +- h->count - h->ibody_count, name); ++ h->count - h->ibody_count, ++ shortname, name_idx); + new_idx += h->ibody_count - 1; + tmp = h->attrs[old_idx]; + memmove(h->attrs + old_idx, h->attrs + old_idx + 1, +@@ -1472,7 +1473,8 @@ static errcode_t xattr_array_update(struct ext2_xattr_handle *h, + } + + new_idx = xattr_find_position(h->attrs + h->ibody_count, +- h->count - h->ibody_count, name); ++ h->count - h->ibody_count, ++ shortname, name_idx); + new_idx += h->ibody_count; + add_to_ibody = 0; + +@@ -1483,8 +1485,8 @@ add_new: + return ret; + } + +- ret = xattr_update_entry(h->fs, &h->attrs[h->count], name, value, +- value_len, in_inode); ++ ret = xattr_update_entry(h->fs, &h->attrs[h->count], name, shortname, ++ name_idx, value, value_len, in_inode); + if (ret) + return ret; + +@@ -1502,12 +1504,10 @@ static int space_used(struct ext2_xattr *attrs, int count) + { + int total = 0; + struct ext2_xattr *x; +- const char *shortname; +- int i, len, name_idx; ++ int i, len; + + for (i = 0, x = attrs; i < count; i++, x++) { +- find_ea_index(x->name, &shortname, &name_idx); +- len = strlen(shortname); ++ len = strlen(x->short_name); + total += EXT2_EXT_ATTR_LEN(len); + if (!x->ea_ino) + total += EXT2_EXT_ATTR_SIZE(x->value_len); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-unexpected-NULL-variable.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-unexpected-NULL-variable.patch new file mode 100644 index 0000000..8800559 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-fix-unexpected-NULL-variable.patch @@ -0,0 +1,39 @@ +From 92d055879d510a1a51315301ea788445cd11aacb Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Fri, 6 Aug 2021 11:58:16 +0200 +Subject: [PATCH 40/46] libext2fs: fix unexpected NULL variable +Content-Type: text/plain + +The ext2fs_check_mount_point() function can be called with mtpt being +NULL as for example from ext2fs_check_if_mounted(). However in the +is_swap_device condition we use the mtpt in strncpy without checking +whether it is non-null first. + +This should not be a problem on linux since the previous attempt to open +the device exclusively would have prevented us from ever reaching the +problematic strncpy. However it's still a bug and can cause problems on +other systems, fix it by conditioning strncpy on mtpt not being null. + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/ismounted.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c +index 46d330d9..c28475d4 100644 +--- a/lib/ext2fs/ismounted.c ++++ b/lib/ext2fs/ismounted.c +@@ -393,7 +393,8 @@ errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags, + + if (is_swap_device(device)) { + *mount_flags = EXT2_MF_MOUNTED | EXT2_MF_SWAP; +- strncpy(mtpt, "", mtlen); ++ if (mtpt) ++ strncpy(mtpt, "", mtlen); + } else { + #ifdef HAVE_SETMNTENT + retval = check_mntent(device, mount_flags, mtpt, mtlen); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-remove-augmented-rbtree-functionality.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-remove-augmented-rbtree-functionality.patch new file mode 100644 index 0000000..4f1670c --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-remove-augmented-rbtree-functionality.patch @@ -0,0 +1,118 @@ +From 1a95588e8090a2ac6cab364e5a24be219f50710b Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Fri, 6 Aug 2021 11:58:17 +0200 +Subject: [PATCH 41/46] libext2fs: remove augmented rbtree functionality +Content-Type: text/plain + +Rbtree code was originally taken from linux kernel. This includes the +augmented rbtree functionality, however this was never intended to be +used and is not used still. Just remove it. + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/rbtree.c | 68 --------------------------------------------- + lib/ext2fs/rbtree.h | 8 ------ + 2 files changed, 76 deletions(-) + +diff --git a/lib/ext2fs/rbtree.c b/lib/ext2fs/rbtree.c +index 5b92099d..74426fa6 100644 +--- a/lib/ext2fs/rbtree.c ++++ b/lib/ext2fs/rbtree.c +@@ -280,74 +280,6 @@ void ext2fs_rb_erase(struct rb_node *node, struct rb_root *root) + __rb_erase_color(child, parent, root); + } + +-static void ext2fs_rb_augment_path(struct rb_node *node, rb_augment_f func, void *data) +-{ +- struct rb_node *parent; +- +-up: +- func(node, data); +- parent = ext2fs_rb_parent(node); +- if (!parent) +- return; +- +- if (node == parent->rb_left && parent->rb_right) +- func(parent->rb_right, data); +- else if (parent->rb_left) +- func(parent->rb_left, data); +- +- node = parent; +- goto up; +-} +- +-/* +- * after inserting @node into the tree, update the tree to account for +- * both the new entry and any damage done by rebalance +- */ +-void ext2fs_rb_augment_insert(struct rb_node *node, rb_augment_f func, void *data) +-{ +- if (node->rb_left) +- node = node->rb_left; +- else if (node->rb_right) +- node = node->rb_right; +- +- ext2fs_rb_augment_path(node, func, data); +-} +- +-/* +- * before removing the node, find the deepest node on the rebalance path +- * that will still be there after @node gets removed +- */ +-struct rb_node *ext2fs_rb_augment_erase_begin(struct rb_node *node) +-{ +- struct rb_node *deepest; +- +- if (!node->rb_right && !node->rb_left) +- deepest = ext2fs_rb_parent(node); +- else if (!node->rb_right) +- deepest = node->rb_left; +- else if (!node->rb_left) +- deepest = node->rb_right; +- else { +- deepest = ext2fs_rb_next(node); +- if (deepest->rb_right) +- deepest = deepest->rb_right; +- else if (ext2fs_rb_parent(deepest) != node) +- deepest = ext2fs_rb_parent(deepest); +- } +- +- return deepest; +-} +- +-/* +- * after removal, update the tree to account for the removed entry +- * and any rebalance damage. +- */ +-void ext2fs_rb_augment_erase_end(struct rb_node *node, rb_augment_f func, void *data) +-{ +- if (node) +- ext2fs_rb_augment_path(node, func, data); +-} +- + /* + * This function returns the first node (in sort order) of the tree. + */ +diff --git a/lib/ext2fs/rbtree.h b/lib/ext2fs/rbtree.h +index 9e806779..a4eb35ae 100644 +--- a/lib/ext2fs/rbtree.h ++++ b/lib/ext2fs/rbtree.h +@@ -161,14 +161,6 @@ static inline void ext2fs_rb_clear_node(struct rb_node *node) + extern void ext2fs_rb_insert_color(struct rb_node *, struct rb_root *); + extern void ext2fs_rb_erase(struct rb_node *, struct rb_root *); + +-typedef void (*rb_augment_f)(struct rb_node *node, void *data); +- +-extern void ext2fs_rb_augment_insert(struct rb_node *node, +- rb_augment_f func, void *data); +-extern struct rb_node *ext2fs_rb_augment_erase_begin(struct rb_node *node); +-extern void ext2fs_rb_augment_erase_end(struct rb_node *node, +- rb_augment_f func, void *data); +- + /* Find logical next and previous nodes in a tree */ + extern struct rb_node *ext2fs_rb_next(struct rb_node *); + extern struct rb_node *ext2fs_rb_prev(struct rb_node *); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libext2fs-teach-ext2fs_flush-to-check-if-group-descr.patch b/SOURCES/e2fsprogs-1.45.6-libext2fs-teach-ext2fs_flush-to-check-if-group-descr.patch new file mode 100644 index 0000000..1b2961f --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libext2fs-teach-ext2fs_flush-to-check-if-group-descr.patch @@ -0,0 +1,35 @@ +From 4b74f91ad7480d71853ae1170d065917afc426a2 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 16 Jan 2020 18:56:49 -0500 +Subject: [PATCH 03/46] libext2fs: teach ext2fs_flush() to check if group + descriptors are loaded +Content-Type: text/plain + +If the EXT2_FLAG_SUPER_ONLY is not set, and the group descriptors are +not loaded, ext2fs_flush[2]() will return EXT2_ET_NO_GDESC. + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/closefs.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c +index 1d4d5b7f..6814cdc3 100644 +--- a/lib/ext2fs/closefs.c ++++ b/lib/ext2fs/closefs.c +@@ -293,6 +293,11 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags) + + EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); + ++ if ((fs->flags & EXT2_FLAG_SUPER_ONLY) == 0 && ++ !ext2fs_has_feature_journal_dev(fs->super) && ++ fs->group_desc == NULL) ++ return EXT2_ET_NO_GDESC; ++ + fs_state = fs->super->s_state; + feature_incompat = fs->super->s_feature_incompat; + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libss-Add-missing-error-handling-for-fdopen.patch b/SOURCES/e2fsprogs-1.45.6-libss-Add-missing-error-handling-for-fdopen.patch new file mode 100644 index 0000000..e19ea78 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libss-Add-missing-error-handling-for-fdopen.patch @@ -0,0 +1,42 @@ +From 91a846631015734d322d11e3b8ff82d650ab7a8e Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Fri, 6 Aug 2021 11:58:19 +0200 +Subject: [PATCH 43/46] libss: Add missing error handling for fdopen() +Content-Type: text/plain + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + lib/ss/list_rqs.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c +index 021a3835..89e37bb2 100644 +--- a/lib/ss/list_rqs.c ++++ b/lib/ss/list_rqs.c +@@ -12,6 +12,9 @@ + */ + #include "config.h" + #include "ss_internal.h" ++#ifdef HAVE_UNISTD_H ++#include ++#endif + #include + #include + #include +@@ -46,6 +49,12 @@ void ss_list_requests(int argc __SS_ATTR((unused)), + return; + } + output = fdopen(fd, "w"); ++ if (!output) { ++ perror("fdopen"); ++ close(fd); ++ (void) signal(SIGINT, func); ++ return; ++ } + sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0); + + fprintf (output, "Available %s requests:\n\n", +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libss-fix-possible-NULL-pointer-dereferece-on-alloca.patch b/SOURCES/e2fsprogs-1.45.6-libss-fix-possible-NULL-pointer-dereferece-on-alloca.patch new file mode 100644 index 0000000..db5ad3d --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libss-fix-possible-NULL-pointer-dereferece-on-alloca.patch @@ -0,0 +1,36 @@ +From 422643f4758b0a0345d84b2d19312269472e2a00 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Thu, 17 Feb 2022 10:24:59 +0100 +Subject: [PATCH 2/2] libss: fix possible NULL pointer dereferece on allocation + failure +Content-Type: text/plain + +Currently in ss_execute_command() we're missng a check to see if the +memory allocation was succesful. Fix it by checking the return from +malloc and returning ENOMEM if it had failed. + +[ Removed addition of the SS_ET_ENOMEM entry to the the libss error + table. -TYT ] + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + lib/ss/execute_cmd.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c +index d443a468..2e2c8cfa 100644 +--- a/lib/ss/execute_cmd.c ++++ b/lib/ss/execute_cmd.c +@@ -171,6 +171,8 @@ int ss_execute_command(int sci_idx, register char *argv[]) + for (argp = argv; *argp; argp++) + argc++; + argp = (char **)malloc((argc+1)*sizeof(char *)); ++ if (!argp) ++ return(ENOMEM); + for (i = 0; i <= argc; i++) + argp[i] = argv[i]; + i = really_execute_command(sci_idx, argc, &argp); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libss-handle-memory-allcation-failure-in-ss_help.patch b/SOURCES/e2fsprogs-1.45.6-libss-handle-memory-allcation-failure-in-ss_help.patch new file mode 100644 index 0000000..8199e89 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libss-handle-memory-allcation-failure-in-ss_help.patch @@ -0,0 +1,33 @@ +From 22c751c1ab47277e90f63ac774288f67d2e42c51 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Fri, 6 Aug 2021 11:58:18 +0200 +Subject: [PATCH 42/46] libss: handle memory allcation failure in ss_help() +Content-Type: text/plain + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + lib/ss/help.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/lib/ss/help.c b/lib/ss/help.c +index 96eb1092..a22b4017 100644 +--- a/lib/ss/help.c ++++ b/lib/ss/help.c +@@ -96,7 +96,12 @@ void ss_help(int argc, char const * const *argv, int sci_idx, pointer info_ptr) + } + if (fd < 0) { + #define MSG "No info found for " +- char *buf = malloc(strlen (MSG) + strlen (argv[1]) + 1); ++ char *buf = malloc(strlen (MSG) + strlen (argv[1]) + 1); ++ if (!buf) { ++ ss_perror(sci_idx, 0, ++ "couldn't allocate memory to print error message"); ++ return; ++ } + strcpy(buf, MSG); + strcat(buf, argv[1]); + ss_perror(sci_idx, 0, buf); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-libsupport-fix-potental-NULL-pointer-dereferences-in.patch b/SOURCES/e2fsprogs-1.45.6-libsupport-fix-potental-NULL-pointer-dereferences-in.patch new file mode 100644 index 0000000..216d288 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-libsupport-fix-potental-NULL-pointer-dereferences-in.patch @@ -0,0 +1,66 @@ +From c976fd2e72678a171693d2b6333c2c499ef4d588 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Fri, 6 Aug 2021 11:58:20 +0200 +Subject: [PATCH 44/46] libsupport: fix potental NULL pointer dereferences in + quota functions +Content-Type: text/plain + +get_dq() function can fail when the memory allocation fails and so we +could end up dereferencing NULL pointer. Fix it. + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + lib/support/mkquota.c | 8 ++++++-- + lib/support/quotaio_tree.c | 2 +- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c +index ef50c9ab..280b1046 100644 +--- a/lib/support/mkquota.c ++++ b/lib/support/mkquota.c +@@ -432,7 +432,8 @@ void quota_data_sub(quota_ctx_t qctx, struct ext2_inode_large *inode, + dict = qctx->quota_dict[qtype]; + if (dict) { + dq = get_dq(dict, get_qid(inode, qtype)); +- dq->dq_dqb.dqb_curspace -= space; ++ if (dq) ++ dq->dq_dqb.dqb_curspace -= space; + } + } + } +@@ -459,7 +460,8 @@ void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode_large *inode, + dict = qctx->quota_dict[qtype]; + if (dict) { + dq = get_dq(dict, get_qid(inode, qtype)); +- dq->dq_dqb.dqb_curinodes += adjust; ++ if (dq) ++ dq->dq_dqb.dqb_curinodes += adjust; + } + } + } +@@ -532,6 +534,8 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data) + struct dquot *dq; + + dq = get_dq(quota_dict, dquot->dq_id); ++ if (!dq) ++ return -1; + dq->dq_id = dquot->dq_id; + dq->dq_flags |= DQF_SEEN; + +diff --git a/lib/support/quotaio_tree.c b/lib/support/quotaio_tree.c +index 6cc4fb5b..5910e637 100644 +--- a/lib/support/quotaio_tree.c ++++ b/lib/support/quotaio_tree.c +@@ -601,7 +601,7 @@ static int report_tree(struct dquot *dquot, unsigned int blk, int depth, + __le32 *ref = (__le32 *) buf; + + if (!buf) +- return 0; ++ return -1; + + read_blk(dquot->dq_h, blk, buf); + if (depth == QT_TREEDEPTH - 1) { +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-lsattr-check-whether-path-is-NULL-in-lsattr_dir_proc.patch b/SOURCES/e2fsprogs-1.45.6-lsattr-check-whether-path-is-NULL-in-lsattr_dir_proc.patch new file mode 100644 index 0000000..fd58064 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-lsattr-check-whether-path-is-NULL-in-lsattr_dir_proc.patch @@ -0,0 +1,36 @@ +From 18850fa92c398f4a60827dd5da020f9af0822424 Mon Sep 17 00:00:00 2001 +From: Zhiqiang Liu +Date: Wed, 28 Jul 2021 09:56:48 +0800 +Subject: [PATCH 37/46] lsattr: check whether path is NULL in lsattr_dir_proc() +Content-Type: text/plain + +In lsattr_dir_proc(), if malloc() return NULL, it will cause +a segmentation fault problem. + +Signed-off-by: Zhiqiang Liu +Signed-off-by: Wu Guanghao +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/lsattr.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/misc/lsattr.c b/misc/lsattr.c +index 0d954376..55080e92 100644 +--- a/misc/lsattr.c ++++ b/misc/lsattr.c +@@ -144,6 +144,11 @@ static int lsattr_dir_proc (const char * dir_name, struct dirent * de, + int dir_len = strlen(dir_name); + + path = malloc(dir_len + strlen (de->d_name) + 2); ++ if (!path) { ++ fputs(_("Couldn't allocate path variable in lsattr_dir_proc\n"), ++ stderr); ++ return -1; ++ } + + if (dir_len && dir_name[dir_len-1] == '/') + sprintf (path, "%s%s", dir_name, de->d_name); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch b/SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch new file mode 100644 index 0000000..f08d1fa --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch @@ -0,0 +1,133 @@ +From b46e1de31f31b9564445a094e1c9cb592062868c Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Wed, 18 Dec 2019 11:03:37 +0100 +Subject: [PATCH 4/7] man: Add note about RHEL8 supported features and mount + options + +Signed-off-by: Lukas Czerner +--- + misc/ext4.5.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + misc/mke2fs.8.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 96 insertions(+) + +diff --git a/misc/ext4.5.in b/misc/ext4.5.in +index 1db61a5f..39b1412e 100644 +--- a/misc/ext4.5.in ++++ b/misc/ext4.5.in +@@ -19,6 +19,54 @@ previously intended for use with the ext2 and ext3 file systems can be + mounted using the ext4 file system driver, and indeed in many modern + Linux distributions, the ext4 file system driver has been configured + to handle mount requests for ext2 and ext3 file systems. ++.SH RED HAT ENTERPRISE LINUX 8 ++The Ext4 file system is fully supported by Red Hat when using default ++mke2fs and mount options. In addition, the following non-default mke2fs ++features and mount options are also fully supported. ++.SH "Non-default features:" ++project ++.br ++quota ++.br ++mmp ++.br ++.SH "Non-default mount options:" ++bsddf|minixdf ++.br ++grpid|bsdgroups and nogrpid|sysvgroups ++.br ++resgid=n and resuid=n ++.br ++errors={continue|remount-ro|panic} ++.br ++commit=nrsec ++.br ++max_batch_time=usec ++.br ++min_batch_time=usec ++.br ++grpquota|noquota|quota|usrquota ++.br ++prjquota ++.br ++dax ++.br ++lazytime|nolazytime ++.br ++discard|nodiscard ++.br ++init_itable|noinit_itable ++.br ++jqfmt={vfsold|vfsv0|vfsv1} ++.br ++usrjquota=aquota.user|grpjquota=aquota.group ++.PP ++For more information on features and mount options, see the ++.BR ext4 ++man page. Ext4 features and mount options not listed above may not be ++fully supported by Red Hat. If your workload requires a feature or mount ++option that is not fully in this Red Hat release, contact Red Hat support ++to evaluate it for inclusion in our supported list. + .SH FILE SYSTEM FEATURES + A file system formatted for ext2, ext3, or ext4 can have some + collection of the following file system feature flags enabled. Some of +diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in +index e6bfc6d6..6106342b 100644 +--- a/misc/mke2fs.8.in ++++ b/misc/mke2fs.8.in +@@ -204,6 +204,54 @@ overridden by the options listed below, are controlled by the + configuration file. See the + .BR mke2fs.conf (5) + manual page for more details. ++.SH RED HAT ENTERPRISE LINUX 8 ++The Ext4 file system is fully supported by Red Hat when using default ++mke2fs and mount options. In addition, the following non-default mke2fs ++features and mount options are also fully supported. ++.SH "Non-default features:" ++project ++.br ++quota ++.br ++mmp ++.br ++.SH "Non-default mount options:" ++bsddf|minixdf ++.br ++grpid|bsdgroups and nogrpid|sysvgroups ++.br ++resgid=n and resuid=n ++.br ++errors={continue|remount-ro|panic} ++.br ++commit=nrsec ++.br ++max_batch_time=usec ++.br ++min_batch_time=usec ++.br ++grpquota|noquota|quota|usrquota ++.br ++prjquota ++.br ++dax ++.br ++lazytime|nolazytime ++.br ++discard|nodiscard ++.br ++init_itable|noinit_itable ++.br ++jqfmt={vfsold|vfsv0|vfsv1} ++.br ++usrjquota=aquota.user|grpjquota=aquota.group ++.PP ++For more information on features and mount options, see the ++.BR ext4 ++man page. Ext4 features and mount options not listed above may not be ++fully supported by Red Hat. If your workload requires a feature or mount ++option that is not fully in this Red Hat release, contact Red Hat support ++to evaluate it for inclusion in our supported list. + .SH OPTIONS + .TP + .BI \-b " block-size" +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-misc-fix-potential-segmentation-fault-problem-in-sca.patch b/SOURCES/e2fsprogs-1.45.6-misc-fix-potential-segmentation-fault-problem-in-sca.patch new file mode 100644 index 0000000..854d287 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-misc-fix-potential-segmentation-fault-problem-in-sca.patch @@ -0,0 +1,35 @@ +From 4a92545b8711df405dc804236d66386780696ce1 Mon Sep 17 00:00:00 2001 +From: Zhiqiang Liu +Date: Wed, 30 Jun 2021 16:27:20 +0800 +Subject: [PATCH 31/46] misc: fix potential segmentation fault problem in + scandir() +Content-Type: text/plain + +In scandir(), temp_list[num_dent] is allocated by calling +malloc(), we should check whether malloc() returns NULL before +accessing temp_list[num_dent]. + +Signed-off-by: Zhiqiang Liu +Signed-off-by: Wu Guanghao +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/create_inode.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/misc/create_inode.c b/misc/create_inode.c +index 6f8487b9..38f37beb 100644 +--- a/misc/create_inode.c ++++ b/misc/create_inode.c +@@ -752,6 +752,8 @@ static int scandir(const char *dir_name, struct dirent ***name_list, + } + // add the copy of dirent to the list + temp_list[num_dent] = (struct dirent*)malloc((dent->d_reclen + 3) & ~3); ++ if (!temp_list[num_dent]) ++ goto out; + memcpy(temp_list[num_dent], dent, dent->d_reclen); + num_dent++; + } +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-mke2fs-Escape-double-quotes-when-parsing-mke2fs.conf.patch b/SOURCES/e2fsprogs-1.45.6-mke2fs-Escape-double-quotes-when-parsing-mke2fs.conf.patch new file mode 100644 index 0000000..471b4d5 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-mke2fs-Escape-double-quotes-when-parsing-mke2fs.conf.patch @@ -0,0 +1,52 @@ +From 6fa8edd0fde7a540b41d78e45743208c8edab0b1 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Mon, 2 Nov 2020 15:26:31 +0100 +Subject: [PATCH] mke2fs: Escape double quotes when parsing mke2fs.conf + +Currently, when constructing the configuration pseudo-file using +the profile-to-c.awk script we will just pass the double quotes as they +appear in the mke2fs.conf. + +This is problematic, because the resulting default_profile.c will either +fail to compile because of syntax error, or leave the resulting +configuration invalid. + +It can be reproduced by adding the following line somewhere into +mke2fs.conf configuration and forcing mke2fs to use the +configuration by specifying nonexistent mke2fs.conf + +MKE2FS_CONFIG="nonexistent" ./misc/mke2fs -T ext4 /dev/device + +default_mntopts = "acl,user_xattr" +^ this will fail to compile + +default_mntopts = "" +^ this will result in invalid config file + +Syntax error in mke2fs config file (, line #4) + Unknown code prof 17 + +Fix it by escaping the double quotes with a backslash in +profile-to-c.awk script. + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + misc/profile-to-c.awk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/misc/profile-to-c.awk b/misc/profile-to-c.awk +index f964efd6..814f7236 100644 +--- a/misc/profile-to-c.awk ++++ b/misc/profile-to-c.awk +@@ -4,6 +4,7 @@ BEGIN { + } + + { ++ gsub("\"","\\\"",$0); + printf(" \"%s\\n\"\n", $0); + } + +-- +2.26.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-mke2fs-fix-up-check-for-hardlinks-always-false-if-in.patch b/SOURCES/e2fsprogs-1.45.6-mke2fs-fix-up-check-for-hardlinks-always-false-if-in.patch new file mode 100644 index 0000000..d0e12b6 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-mke2fs-fix-up-check-for-hardlinks-always-false-if-in.patch @@ -0,0 +1,84 @@ +From d74f2e031418fb877c97c86a9c6b58eb30a4592c Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Tue, 21 Jul 2020 18:25:03 -0700 +Subject: [PATCH 10/46] mke2fs: fix up check for hardlinks always false if + inode > 0xFFFFFFFF +Content-Type: text/plain + +While file has a large inode number (> 0xFFFFFFFF), mkfs.ext4 could +not parse hardlink correctly. + +Prepare three hardlink files for mkfs.ext4 + +$ ls -il rootfs_ota/a rootfs_ota/boot/b rootfs_ota/boot/c +11026675846 -rw-r--r-- 3 hjia users 0 Jul 20 17:44 rootfs_ota/a +11026675846 -rw-r--r-- 3 hjia users 0 Jul 20 17:44 rootfs_ota/boot/b +11026675846 -rw-r--r-- 3 hjia users 0 Jul 20 17:44 rootfs_ota/boot/c + +$ truncate -s 1M rootfs_ota.ext4 + +$ mkfs.ext4 -F -i 8192 rootfs_ota.ext4 -L otaroot -U fd5f8768-c779-4dc9-adde-165a3d863349 -d rootfs_ota + +$ mkdir mnt && sudo mount rootfs_ota.ext4 mnt + +$ ls -il mnt/a mnt/boot/b mnt/boot/c +12 -rw-r--r-- 1 hjia users 0 Jul 20 17:44 mnt/a +14 -rw-r--r-- 1 hjia users 0 Jul 20 17:44 mnt/boot/b +15 -rw-r--r-- 1 hjia users 0 Jul 20 17:44 mnt/boot/c + +After applying this fix +$ ls -il mnt/a mnt/boot/b mnt/boot/c +12 -rw-r--r-- 3 hjia users 0 Jul 20 17:44 mnt/a +12 -rw-r--r-- 3 hjia users 0 Jul 20 17:44 mnt/boot/b +12 -rw-r--r-- 3 hjia users 0 Jul 20 17:44 mnt/boot/c + +Since commit [382ed4a1 e2fsck: use proper types for variables][1] +applied, it used ext2_ino_t instead of ino_t for referencing inode +numbers, but the type of is_hardlink's `ino' should not be instead, +The ext2_ino_t is 32bit, if inode > 0xFFFFFFFF, its value will be +truncated. + +Add a debug printf to show the value of inode, when it check for hardlink +files, it will always return false if inode > 0xFFFFFFFF +|--- a/misc/create_inode.c +|+++ b/misc/create_inode.c +|@@ -605,6 +605,7 @@ static int is_hardlink(struct hdlinks_s *hdlinks, dev_t dev, ext2_ino_t ino) +| { +| int i; +| +|+ printf("%s %d, %lX, %lX\n", __FUNCTION__, __LINE__, hdlinks->hdl[i].src_ino, ino); +| for (i = 0; i < hdlinks->count; i++) { +| if (hdlinks->hdl[i].src_dev == dev && +| hdlinks->hdl[i].src_ino == ino) + +Here is debug message: +is_hardlink 608, 2913DB886, 913DB886 + +The length of ext2_ino_t is 32bit (typedef __u32 __bitwise ext2_ino_t;), +and ino_t is 64bit on 64bit system (such as x86-64), recover `ino' to ino_t. + +[1] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=382ed4a1c2b60acb9db7631e86dda207bde6076e + +Signed-off-by: Hongxu Jia +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/create_inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/misc/create_inode.c b/misc/create_inode.c +index e8d1df6b..837f3875 100644 +--- a/misc/create_inode.c ++++ b/misc/create_inode.c +@@ -601,7 +601,7 @@ out: + return err; + } + +-static int is_hardlink(struct hdlinks_s *hdlinks, dev_t dev, ext2_ino_t ino) ++static int is_hardlink(struct hdlinks_s *hdlinks, dev_t dev, ino_t ino) + { + int i; + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-mke2fs-only-try-discarding-a-single-block-to-test-if.patch b/SOURCES/e2fsprogs-1.45.6-mke2fs-only-try-discarding-a-single-block-to-test-if.patch new file mode 100644 index 0000000..414a180 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-mke2fs-only-try-discarding-a-single-block-to-test-if.patch @@ -0,0 +1,57 @@ +From 2831f4202dd1bec289a9a3459d553fcffda0f280 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sun, 18 Jul 2021 09:15:28 -0400 +Subject: [PATCH 34/46] mke2fs: only try discarding a single block to test if + discard works +Content-Type: text/plain + +Commit d2bfdc7ff15c ("Use punch hole as "discard" on regular files") +added a test to see if the storage device actually supports discard. +The intent was to try discarding the first block but since +io_channel_discard() interprets the offset and count arguments in +blocks, and not bytes, mke2fs was actually discarding the first 16 +megabytes (when the block size is 4k). This is normally not a +problem, since most file systems are larger than that, and requests to +discard beyond the end of the block device are ignored. + +However, when creating a small file system as part of a image +containing multiple partitions, the initial test discard can end up +discarding data beyond the file system being created. + +Addresses-Debian-Bug: #989630 +Reported-by: Josh Triplett +Fixes: d2bfdc7ff15c ("Use punch hole as "discard" on regular files") +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/mke2fs.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/misc/mke2fs.c b/misc/mke2fs.c +index 389d0981..b2bb2847 100644 +--- a/misc/mke2fs.c ++++ b/misc/mke2fs.c +@@ -2768,7 +2768,7 @@ static int mke2fs_discard_device(ext2_filsys fs) + struct ext2fs_numeric_progress_struct progress; + blk64_t blocks = ext2fs_blocks_count(fs->super); + blk64_t count = DISCARD_STEP_MB; +- blk64_t cur; ++ blk64_t cur = 0; + int retval = 0; + + /* +@@ -2776,10 +2776,9 @@ static int mke2fs_discard_device(ext2_filsys fs) + * we do not print numeric progress resulting in failure + * afterwards. + */ +- retval = io_channel_discard(fs->io, 0, fs->blocksize); ++ retval = io_channel_discard(fs->io, 0, 1); + if (retval) + return retval; +- cur = fs->blocksize; + + count *= (1024 * 1024); + count /= fs->blocksize; +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch b/SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch new file mode 100644 index 0000000..a4fe78a --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch @@ -0,0 +1,34 @@ +From 42e4b2148a42ce35d5bc86586341a887928ec4dc Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Tue, 17 Dec 2019 11:24:31 +0100 +Subject: [PATCH 3/7] mke2fs.conf: Introduce rhel6 and rhel7 fs_type + +Signed-off-by: Lukas Czerner +--- + misc/mke2fs.conf.in | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in +index 01e35cf8..a533b210 100644 +--- a/misc/mke2fs.conf.in ++++ b/misc/mke2fs.conf.in +@@ -14,6 +14,16 @@ + features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize + inode_size = 256 + } ++ rhel6_ext4 = { ++ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize ++ inode_size = 256 ++ enable_periodic_fsck = 1 ++ default_mntopts = "" ++ } ++ rhel7_ext4 = { ++ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit ++ inode_size = 256 ++ } + small = { + blocksize = 1024 + inode_size = 128 +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-mmp-do-not-use-O_DIRECT-when-working-with-regular-fi.patch b/SOURCES/e2fsprogs-1.45.6-mmp-do-not-use-O_DIRECT-when-working-with-regular-fi.patch new file mode 100644 index 0000000..5f24e6b --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-mmp-do-not-use-O_DIRECT-when-working-with-regular-fi.patch @@ -0,0 +1,68 @@ +From d80424f5ceaa3a7a8ce7dbf6bacca32f2f05fdeb Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Thu, 18 Feb 2021 10:51:46 +0100 +Subject: [PATCH 23/46] mmp: do not use O_DIRECT when working with regular file +Content-Type: text/plain + +Currently the mmp block is read using O_DIRECT to avoid any caching that +may be done by the VM. However when working with regular files this +creates alignment issues when the device of the host file system has +sector size larger than the blocksize of the file system in the file +we're working with. + +This can be reproduced with t_mmp_fail test when run on the device with +4k sector size because the mke2fs fails when trying to read the mmp +block. + +Fix it by disabling O_DIRECT when working with regular files. I don't +think there is any risk of doing so since the file system layer, unlike +shared block device, should guarantee cache consistency. + +Signed-off-by: Lukas Czerner +Reviewed-by: Eric Sandeen +Reviewed-by: Andreas Dilger +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/mmp.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/lib/ext2fs/mmp.c b/lib/ext2fs/mmp.c +index eddc66a7..626fe395 100644 +--- a/lib/ext2fs/mmp.c ++++ b/lib/ext2fs/mmp.c +@@ -57,21 +57,21 @@ errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf) + * regardless of how the io_manager is doing reads, to avoid caching of + * the MMP block by the io_manager or the VM. It needs to be fresh. */ + if (fs->mmp_fd <= 0) { ++ struct stat st; + int flags = O_RDWR | O_DIRECT; + +-retry: ++ /* ++ * There is no reason for using O_DIRECT if we're working with ++ * regular file. Disabling it also avoids problems with ++ * alignment when the device of the host file system has sector ++ * size larger than blocksize of the fs we're working with. ++ */ ++ if (stat(fs->device_name, &st) == 0 && ++ S_ISREG(st.st_mode)) ++ flags &= ~O_DIRECT; ++ + fs->mmp_fd = open(fs->device_name, flags); + if (fs->mmp_fd < 0) { +- struct stat st; +- +- /* Avoid O_DIRECT for filesystem image files if open +- * fails, since it breaks when running on tmpfs. */ +- if (errno == EINVAL && (flags & O_DIRECT) && +- stat(fs->device_name, &st) == 0 && +- S_ISREG(st.st_mode)) { +- flags &= ~O_DIRECT; +- goto retry; +- } + retval = EXT2_ET_MMP_OPEN_DIRECT; + goto out; + } +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-quota-Do-not-account-space-used-by-project-quota-fil.patch b/SOURCES/e2fsprogs-1.45.6-quota-Do-not-account-space-used-by-project-quota-fil.patch new file mode 100644 index 0000000..bb13dd1 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-quota-Do-not-account-space-used-by-project-quota-fil.patch @@ -0,0 +1,39 @@ +From 7c9b477d25a81ef736a832d66793a75860394d6f Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 12 Jul 2021 17:43:08 +0200 +Subject: [PATCH 39/46] quota: Do not account space used by project quota file + to quota +Content-Type: text/plain + +Project quota files have high inode numbers but are not accounted in +quota usage. Do not track them when computing quota usage. + +Signed-off-by: Jan Kara +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/support/mkquota.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c +index 6f7ae6d6..ef50c9ab 100644 +--- a/lib/support/mkquota.c ++++ b/lib/support/mkquota.c +@@ -500,9 +500,11 @@ errcode_t quota_compute_usage(quota_ctx_t qctx) + } + if (ino == 0) + break; +- if (inode->i_links_count && +- (ino == EXT2_ROOT_INO || +- ino >= EXT2_FIRST_INODE(fs->super))) { ++ if (!inode->i_links_count) ++ continue; ++ if (ino == EXT2_ROOT_INO || ++ (ino >= EXT2_FIRST_INODE(fs->super) && ++ ino != quota_type2inum(PRJQUOTA, fs->super))) { + space = ext2fs_get_stat_i_blocks(fs, + EXT2_INODE(inode)) << 9; + quota_data_add(qctx, inode, ino, space); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-resize2fs-avoid-allocating-over-the-MMP-block.patch b/SOURCES/e2fsprogs-1.45.6-resize2fs-avoid-allocating-over-the-MMP-block.patch new file mode 100644 index 0000000..b571571 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-resize2fs-avoid-allocating-over-the-MMP-block.patch @@ -0,0 +1,41 @@ +From a7a6126b94b9b6b0f88b5a5cc90d069974c89901 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 6 Mar 2021 23:08:12 -0500 +Subject: [PATCH 24/46] resize2fs: avoid allocating over the MMP block +Content-Type: text/plain + +When resizing past the point where the reserve inode has reserved +space for the block group descriptors to expand, and resize2fs (in an +offline resize) needs to move the allocation bitmaps and/or inode +table around, it's possible for resize2fs to allocate over the MMP +block, which would be bad. + +Prevent this from happening by reserving the MMP block as a file +system metadata block (which it is) in resize2fs's accounting. + +Addresses-Debian-Bug: #984472 +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + resize/resize2fs.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/resize/resize2fs.c b/resize/resize2fs.c +index 26050fec..e8401e79 100644 +--- a/resize/resize2fs.c ++++ b/resize/resize2fs.c +@@ -1176,6 +1176,11 @@ static errcode_t mark_table_blocks(ext2_filsys fs, + if (blk) + ext2fs_mark_block_bitmap2(bmap, blk); + } ++ /* Reserve the MMP block */ ++ if (ext2fs_has_feature_mmp(fs->super) && ++ fs->super->s_mmp_block > fs->super->s_first_data_block && ++ fs->super->s_mmp_block < ext2fs_blocks_count(fs->super)) ++ ext2fs_mark_block_bitmap2(bmap, fs->super->s_mmp_block); + return 0; + } + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-resize2fs-prevent-block-group-descriptors-from-overf.patch b/SOURCES/e2fsprogs-1.45.6-resize2fs-prevent-block-group-descriptors-from-overf.patch new file mode 100644 index 0000000..0593576 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-resize2fs-prevent-block-group-descriptors-from-overf.patch @@ -0,0 +1,59 @@ +From 742255d914bf06fa8e8a3f048aae2c738657af52 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Fri, 2 Oct 2020 14:47:25 -0400 +Subject: [PATCH 11/46] resize2fs: prevent block group descriptors from + overflowing the first bg +Content-Type: text/plain + +For 1k block file systems, resizing a file system larger than +1073610752 blocks will result in the size of the block group +descriptors to be so large that it will overlap with the backup +superblock in block group #1. This problem can be reproduced via: + + mke2fs -t ext4 /tmp/foo.img 200M + resize2fs /tmp/foo.img 1T + e2fsck -f /tmp/foo.img + +https://github.com/tytso/e2fsprogs/issues/50 + +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + resize/main.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/resize/main.c b/resize/main.c +index a0c31c06..5e771d2a 100644 +--- a/resize/main.c ++++ b/resize/main.c +@@ -269,6 +269,8 @@ int main (int argc, char ** argv) + long sysval; + int len, mount_flags; + char *mtpt, *undo_file = NULL; ++ dgrp_t new_group_desc_count; ++ unsigned long new_desc_blocks; + + #ifdef ENABLE_NLS + setlocale(LC_MESSAGES, ""); +@@ -528,6 +530,18 @@ int main (int argc, char ** argv) + exit(1); + } + } ++ new_group_desc_count = ext2fs_div64_ceil(new_size - ++ fs->super->s_first_data_block, ++ EXT2_BLOCKS_PER_GROUP(fs->super)); ++ new_desc_blocks = ext2fs_div_ceil(new_group_desc_count, ++ EXT2_DESC_PER_BLOCK(fs->super)); ++ if ((new_desc_blocks + fs->super->s_first_data_block) > ++ EXT2_BLOCKS_PER_GROUP(fs->super)) { ++ com_err(program_name, 0, ++ _("New size results in too many block group " ++ "descriptors.\n")); ++ exit(1); ++ } + + if (!force && new_size < min_size) { + com_err(program_name, 0, +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-ss_add_info_dir-fix-error-handling-when-memory-alloc.patch b/SOURCES/e2fsprogs-1.45.6-ss_add_info_dir-fix-error-handling-when-memory-alloc.patch new file mode 100644 index 0000000..f2f0e08 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-ss_add_info_dir-fix-error-handling-when-memory-alloc.patch @@ -0,0 +1,48 @@ +From 7fa914a178bbda39e3ed75326e18b183784fd57e Mon Sep 17 00:00:00 2001 +From: Wu Guanghao +Date: Wed, 28 Jul 2021 09:56:45 +0800 +Subject: [PATCH 35/46] ss_add_info_dir: fix error handling when memory + allocation fails +Content-Type: text/plain + +If the realloc() and malloc() calls fail, avoid a memory leak as well +as a potential seg fault. + +[ Fix error code setting to avoid depending on malloc() and realloc() + setting errno. -- TYT ] + +Signed-off-by: Wu Guanghao +Signed-off-by: Zhiqiang Liu +Reviewed-by: Wu Bo +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ss/help.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/lib/ss/help.c b/lib/ss/help.c +index 5204401b..96eb1092 100644 +--- a/lib/ss/help.c ++++ b/lib/ss/help.c +@@ -148,13 +148,16 @@ void ss_add_info_dir(int sci_idx, char *info_dir, int *code_ptr) + dirs = (char **)realloc((char *)dirs, + (unsigned)(n_dirs + 2)*sizeof(char *)); + if (dirs == (char **)NULL) { +- info->info_dirs = (char **)NULL; +- *code_ptr = errno; ++ *code_ptr = ENOMEM; + return; + } + info->info_dirs = dirs; + dirs[n_dirs + 1] = (char *)NULL; + dirs[n_dirs] = malloc((unsigned)strlen(info_dir)+1); ++ if (dirs[n_dirs] == (char *)NULL) { ++ *code_ptr = ENOMEM; ++ return; ++ } + strcpy(dirs[n_dirs], info_dir); + *code_ptr = 0; + } +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-error-handling-when-memory-.patch b/SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-error-handling-when-memory-.patch new file mode 100644 index 0000000..2c950de --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-error-handling-when-memory-.patch @@ -0,0 +1,112 @@ +From e46e4a8c3c298ec05092008966072d73437c9728 Mon Sep 17 00:00:00 2001 +From: Wu Guanghao +Date: Wed, 28 Jul 2021 09:56:46 +0800 +Subject: [PATCH 36/46] ss_create_invocation: fix error handling when memory + allocation fails +Content-Type: text/plain + +In ss_create_invocation(), it is necessary to check whether +returned by malloc is a null pointer. + +Signed-off-by: Wu Guanghao +Signed-off-by: Zhiqiang Liu +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ss/invocation.c | 42 +++++++++++++++++++++++++++++++++--------- + 1 file changed, 33 insertions(+), 9 deletions(-) + +diff --git a/lib/ss/invocation.c b/lib/ss/invocation.c +index 457e7a2c..bf5ea0ce 100644 +--- a/lib/ss/invocation.c ++++ b/lib/ss/invocation.c +@@ -26,29 +26,33 @@ int ss_create_invocation(const char *subsystem_name, const char *version_string, + void *info_ptr, ss_request_table *request_table_ptr, + int *code_ptr) + { +- register int sci_idx; +- register ss_data *new_table; +- register ss_data **table; ++ int sci_idx; ++ ss_data *new_table = NULL; ++ ss_data **table = NULL; ++ ss_data **realloc_table = NULL; + + *code_ptr = 0; + table = _ss_table; + new_table = (ss_data *) malloc(sizeof(ss_data)); ++ if (!new_table) ++ goto out; + + if (table == (ss_data **) NULL) { + table = (ss_data **) malloc(2 * size); ++ if (!table) ++ goto out; + table[0] = table[1] = (ss_data *)NULL; + } + initialize_ss_error_table (); + + for (sci_idx = 1; table[sci_idx] != (ss_data *)NULL; sci_idx++) + ; +- table = (ss_data **) realloc((char *)table, ++ realloc_table = (ss_data **) realloc((char *)table, + ((unsigned)sci_idx+2)*size); +- if (table == NULL) { +- *code_ptr = ENOMEM; +- free(new_table); +- return 0; +- } ++ if (realloc_table == NULL) ++ goto out; ++ ++ table = realloc_table; + table[sci_idx+1] = (ss_data *) NULL; + table[sci_idx] = new_table; + +@@ -57,9 +61,15 @@ int ss_create_invocation(const char *subsystem_name, const char *version_string, + new_table->argv = (char **)NULL; + new_table->current_request = (char *)NULL; + new_table->info_dirs = (char **)malloc(sizeof(char *)); ++ if (!new_table->info_dirs) ++ goto out; ++ + *new_table->info_dirs = (char *)NULL; + new_table->info_ptr = info_ptr; + new_table->prompt = malloc((unsigned)strlen(subsystem_name)+4); ++ if (!new_table->prompt) ++ goto out; ++ + strcpy(new_table->prompt, subsystem_name); + strcat(new_table->prompt, ": "); + #ifdef silly +@@ -71,6 +81,9 @@ int ss_create_invocation(const char *subsystem_name, const char *version_string, + new_table->flags.abbrevs_disabled = 0; + new_table->rqt_tables = + (ss_request_table **) calloc(2, sizeof(ss_request_table *)); ++ if (!new_table->rqt_tables) ++ goto out; ++ + *(new_table->rqt_tables) = request_table_ptr; + *(new_table->rqt_tables+1) = (ss_request_table *) NULL; + +@@ -85,6 +98,17 @@ int ss_create_invocation(const char *subsystem_name, const char *version_string, + ss_get_readline(sci_idx); + #endif + return(sci_idx); ++ ++out: ++ if (new_table) { ++ free(new_table->prompt); ++ free(new_table->info_dirs); ++ } ++ free(new_table); ++ free(table); ++ *code_ptr = ENOMEM; ++ return 0; ++ + } + + void +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-potential-unititalized-refe.patch b/SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-potential-unititalized-refe.patch new file mode 100644 index 0000000..4b7f809 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-ss_create_invocation-fix-potential-unititalized-refe.patch @@ -0,0 +1,30 @@ +From 1f70da1ff20ed99f2a3ac26a61a6492279bd44de Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 3 Aug 2021 11:03:34 -0400 +Subject: [PATCH 38/46] ss_create_invocation: fix potential unititalized + reference in error path +Content-Type: text/plain + +Fixes: eccdde1ff381 ("ss_create_invocation: fix error handling when ...") +Addresses-Coverity-Bug: 1489771 +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ss/invocation.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/ss/invocation.c b/lib/ss/invocation.c +index bf5ea0ce..7d7458a7 100644 +--- a/lib/ss/invocation.c ++++ b/lib/ss/invocation.c +@@ -36,6 +36,7 @@ int ss_create_invocation(const char *subsystem_name, const char *version_string, + new_table = (ss_data *) malloc(sizeof(ss_data)); + if (!new_table) + goto out; ++ memset(new_table, 0, sizeof(ss_data)); + + if (table == (ss_data **) NULL) { + table = (ss_data **) malloc(2 * size); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-tdb_transaction_recover-fix-memory-leak.patch b/SOURCES/e2fsprogs-1.45.6-tdb_transaction_recover-fix-memory-leak.patch new file mode 100644 index 0000000..43ae5a4 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-tdb_transaction_recover-fix-memory-leak.patch @@ -0,0 +1,33 @@ +From a6f7be73206a27f6b5eb95ed66095d38110560cc Mon Sep 17 00:00:00 2001 +From: wuguanghao +Date: Wed, 30 Jun 2021 16:27:14 +0800 +Subject: [PATCH 27/46] tdb_transaction_recover: fix memory leak +Content-Type: text/plain + +In tdb_transaction_recover(), need free data before return, +otherwise it will cause memory leak. + +Signed-off-by: Wu Guanghao +Signed-off-by: Zhiqiang Liu +Reviewed-by: Wu Bo +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + lib/ext2fs/tdb.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/ext2fs/tdb.c b/lib/ext2fs/tdb.c +index 5091b128..0fb94815 100644 +--- a/lib/ext2fs/tdb.c ++++ b/lib/ext2fs/tdb.c +@@ -2186,6 +2186,7 @@ int tdb_transaction_recover(struct tdb_context *tdb) + rec.data_len, 0) == -1) { + TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to read recovery data\n")); + tdb->ecode = TDB_ERR_IO; ++ free(data); + return -1; + } + +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-tests-Add-option-to-print-diff-output-of-failed-test.patch b/SOURCES/e2fsprogs-1.45.6-tests-Add-option-to-print-diff-output-of-failed-test.patch new file mode 100644 index 0000000..cb5f7a3 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-tests-Add-option-to-print-diff-output-of-failed-test.patch @@ -0,0 +1,33 @@ +From 4b2fa25a97e53636dfe216198a1e97266cf0709a Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Thu, 2 Sep 2021 12:58:52 +0200 +Subject: [PATCH 46/46] tests: Add option to print diff output of failed tests +Content-Type: text/plain + +Add variable $PRINT_FAILED which when set will print the diff output of +a failed test. + +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + tests/test_one.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/test_one.in b/tests/test_one.in +index 5d7607ad..78499ad0 100644 +--- a/tests/test_one.in ++++ b/tests/test_one.in +@@ -82,6 +82,10 @@ if [ $elapsed -gt 60 -a ! -f $test_dir/is_slow_test ]; then + echo "$test_name: consider adding $test_dir/is_slow_test" + fi + ++if [ -n "$PRINT_FAILED" -a -f $test_name.failed ] ; then ++ cat $test_name.failed ++fi ++ + if [ "$SKIP_UNLINK" != "true" ] ; then + rm -f $TMPFILE + fi +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-tune2fs-update-dir-checksums-when-clearing-dir_index.patch b/SOURCES/e2fsprogs-1.45.6-tune2fs-update-dir-checksums-when-clearing-dir_index.patch new file mode 100644 index 0000000..f8dae8d --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-tune2fs-update-dir-checksums-when-clearing-dir_index.patch @@ -0,0 +1,284 @@ +From fb4a6ed596f6a9f6b1c6d3d9307ef8259d988c04 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 13 Feb 2020 11:16:02 +0100 +Subject: [PATCH 06/46] tune2fs: update dir checksums when clearing dir_index + feature +Content-Type: text/plain + +When clearing dir_index feature while metadata_csum is enabled, we have +to rewrite checksums of all indexed directories to update checksums of +internal tree nodes. + +Signed-off-by: Jan Kara +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/tune2fs.c | 143 ++++++++++++++++++++++++++++++++----------------- + 1 file changed, 95 insertions(+), 48 deletions(-) + +diff --git a/misc/tune2fs.c b/misc/tune2fs.c +index 39cf8587..a7a779b8 100644 +--- a/misc/tune2fs.c ++++ b/misc/tune2fs.c +@@ -504,7 +504,8 @@ struct rewrite_dir_context { + char *buf; + errcode_t errcode; + ext2_ino_t dir; +- int is_htree; ++ int is_htree:1; ++ int clear_htree:1; + }; + + static int rewrite_dir_block(ext2_filsys fs, +@@ -523,8 +524,13 @@ static int rewrite_dir_block(ext2_filsys fs, + if (ctx->errcode) + return BLOCK_ABORT; + +- /* if htree node... */ +- if (ctx->is_htree) ++ /* ++ * if htree node... Note that if we are clearing htree structures from ++ * the directory, we treat the htree internal block as an ordinary leaf. ++ * The code below will do the right thing and make space for checksum ++ * there. ++ */ ++ if (ctx->is_htree && !ctx->clear_htree) + ext2fs_get_dx_countlimit(fs, (struct ext2_dir_entry *)ctx->buf, + &dcl, &dcl_offset); + if (dcl) { +@@ -653,7 +659,8 @@ static errcode_t rewrite_directory(ext2_filsys fs, ext2_ino_t dir, + if (retval) + return retval; + +- ctx.is_htree = (inode->i_flags & EXT2_INDEX_FL); ++ ctx.is_htree = !!(inode->i_flags & EXT2_INDEX_FL); ++ ctx.clear_htree = !ext2fs_has_feature_dir_index(fs->super); + ctx.dir = dir; + ctx.errcode = 0; + retval = ext2fs_block_iterate3(fs, dir, BLOCK_FLAG_READ_ONLY | +@@ -664,6 +671,13 @@ static errcode_t rewrite_directory(ext2_filsys fs, ext2_ino_t dir, + if (retval) + return retval; + ++ if (ctx.is_htree && ctx.clear_htree) { ++ inode->i_flags &= ~EXT2_INDEX_FL; ++ retval = ext2fs_write_inode(fs, dir, inode); ++ if (retval) ++ return retval; ++ } ++ + return ctx.errcode; + } + +@@ -818,28 +832,67 @@ static void rewrite_one_inode(struct rewrite_context *ctx, ext2_ino_t ino, + fatal_err(retval, "while rewriting extended attribute"); + } + +-/* +- * Forcibly set checksums in all inodes. +- */ +-static void rewrite_inodes(ext2_filsys fs) ++#define REWRITE_EA_FL 0x01 /* Rewrite EA inodes */ ++#define REWRITE_DIR_FL 0x02 /* Rewrite directories */ ++#define REWRITE_NONDIR_FL 0x04 /* Rewrite other inodes */ ++#define REWRITE_ALL (REWRITE_EA_FL | REWRITE_DIR_FL | REWRITE_NONDIR_FL) ++ ++static void rewrite_inodes_pass(struct rewrite_context *ctx, unsigned int flags) + { + ext2_inode_scan scan; + errcode_t retval; + ext2_ino_t ino; + struct ext2_inode *inode; +- int pass; ++ int rewrite; ++ ++ retval = ext2fs_get_mem(ctx->inode_size, &inode); ++ if (retval) ++ fatal_err(retval, "while allocating memory"); ++ ++ retval = ext2fs_open_inode_scan(ctx->fs, 0, &scan); ++ if (retval) ++ fatal_err(retval, "while opening inode scan"); ++ ++ do { ++ retval = ext2fs_get_next_inode_full(scan, &ino, inode, ++ ctx->inode_size); ++ if (retval) ++ fatal_err(retval, "while getting next inode"); ++ if (!ino) ++ break; ++ ++ rewrite = 0; ++ if (inode->i_flags & EXT4_EA_INODE_FL) { ++ if (flags & REWRITE_EA_FL) ++ rewrite = 1; ++ } else if (LINUX_S_ISDIR(inode->i_mode)) { ++ if (flags & REWRITE_DIR_FL) ++ rewrite = 1; ++ } else { ++ if (flags & REWRITE_NONDIR_FL) ++ rewrite = 1; ++ } ++ if (rewrite) ++ rewrite_one_inode(ctx, ino, inode); ++ } while (ino); ++ ext2fs_close_inode_scan(scan); ++ ext2fs_free_mem(&inode); ++} ++ ++/* ++ * Forcibly rewrite checksums in inodes specified by 'flags' ++ */ ++static void rewrite_inodes(ext2_filsys fs, unsigned int flags) ++{ + struct rewrite_context ctx = { + .fs = fs, + .inode_size = EXT2_INODE_SIZE(fs->super), + }; ++ errcode_t retval; + + if (fs->super->s_creator_os == EXT2_OS_HURD) + return; + +- retval = ext2fs_get_mem(ctx.inode_size, &inode); +- if (retval) +- fatal_err(retval, "while allocating memory"); +- + retval = ext2fs_get_memzero(ctx.inode_size, &ctx.zero_inode); + if (retval) + fatal_err(retval, "while allocating memory"); +@@ -858,39 +911,16 @@ static void rewrite_inodes(ext2_filsys fs) + * + * pass 2: go over other inodes to update their checksums. + */ +- if (ext2fs_has_feature_ea_inode(fs->super)) +- pass = 1; +- else +- pass = 2; +- for (;pass <= 2; pass++) { +- retval = ext2fs_open_inode_scan(fs, 0, &scan); +- if (retval) +- fatal_err(retval, "while opening inode scan"); +- +- do { +- retval = ext2fs_get_next_inode_full(scan, &ino, inode, +- ctx.inode_size); +- if (retval) +- fatal_err(retval, "while getting next inode"); +- if (!ino) +- break; +- +- if (((pass == 1) && +- (inode->i_flags & EXT4_EA_INODE_FL)) || +- ((pass == 2) && +- !(inode->i_flags & EXT4_EA_INODE_FL))) +- rewrite_one_inode(&ctx, ino, inode); +- } while (ino); +- +- ext2fs_close_inode_scan(scan); +- } ++ if (ext2fs_has_feature_ea_inode(fs->super) && (flags & REWRITE_EA_FL)) ++ rewrite_inodes_pass(&ctx, REWRITE_EA_FL); ++ flags &= ~REWRITE_EA_FL; ++ rewrite_inodes_pass(&ctx, flags); + + ext2fs_free_mem(&ctx.zero_inode); + ext2fs_free_mem(&ctx.ea_buf); +- ext2fs_free_mem(&inode); + } + +-static void rewrite_metadata_checksums(ext2_filsys fs) ++static void rewrite_metadata_checksums(ext2_filsys fs, unsigned int flags) + { + errcode_t retval; + dgrp_t i; +@@ -902,7 +932,7 @@ static void rewrite_metadata_checksums(ext2_filsys fs) + retval = ext2fs_read_bitmaps(fs); + if (retval) + fatal_err(retval, "while reading bitmaps"); +- rewrite_inodes(fs); ++ rewrite_inodes(fs, flags); + ext2fs_mark_ib_dirty(fs); + ext2fs_mark_bb_dirty(fs); + ext2fs_mmp_update2(fs, 1); +@@ -1201,6 +1231,23 @@ mmp_error: + uuid_generate((unsigned char *) sb->s_hash_seed); + } + ++ if (FEATURE_OFF(E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_INDEX) && ++ ext2fs_has_feature_metadata_csum(sb)) { ++ check_fsck_needed(fs, ++ _("Disabling directory index on filesystem with " ++ "checksums could take some time.")); ++ if (mount_flags & EXT2_MF_MOUNTED) { ++ fputs(_("Cannot disable dir_index on a mounted " ++ "filesystem!\n"), stderr); ++ exit(1); ++ } ++ /* ++ * Clearing dir_index on checksummed filesystem requires ++ * rewriting all directories to update checksums. ++ */ ++ rewrite_checksums |= REWRITE_DIR_FL; ++ } ++ + if (FEATURE_OFF(E2P_FEATURE_INCOMPAT, EXT4_FEATURE_INCOMPAT_FLEX_BG)) { + if (ext2fs_check_desc(fs)) { + fputs(_("Clearing the flex_bg flag would " +@@ -1244,7 +1291,7 @@ mmp_error: + "The larger fields afforded by this feature " + "enable full-strength checksumming. " + "Run resize2fs -b to rectify.\n")); +- rewrite_checksums = 1; ++ rewrite_checksums = REWRITE_ALL; + /* metadata_csum supersedes uninit_bg */ + ext2fs_clear_feature_gdt_csum(fs->super); + +@@ -1272,7 +1319,7 @@ mmp_error: + "filesystem!\n"), stderr); + exit(1); + } +- rewrite_checksums = 1; ++ rewrite_checksums = REWRITE_ALL; + + /* Enable uninit_bg unless the user expressly turned it off */ + memcpy(test_features, old_features, sizeof(test_features)); +@@ -1454,7 +1501,7 @@ mmp_error: + } + check_fsck_needed(fs, _("Recalculating checksums " + "could take some time.")); +- rewrite_checksums = 1; ++ rewrite_checksums = REWRITE_ALL; + } + } + +@@ -3191,7 +3238,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n" + check_fsck_needed(fs, + _("Setting the UUID on this " + "filesystem could take some time.")); +- rewrite_checksums = 1; ++ rewrite_checksums = REWRITE_ALL; + } + + if (ext2fs_has_group_desc_csum(fs)) { +@@ -3302,7 +3349,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n" + if (retval == 0) { + printf(_("Setting inode size %lu\n"), + new_inode_size); +- rewrite_checksums = 1; ++ rewrite_checksums = REWRITE_ALL; + } else { + printf("%s", _("Failed to change inode size\n")); + rc = 1; +@@ -3311,7 +3358,7 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n" + } + + if (rewrite_checksums) +- rewrite_metadata_checksums(fs); ++ rewrite_metadata_checksums(fs, rewrite_checksums); + + if (l_flag) + list_super(sb); +-- +2.35.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-zap_sector-fix-memory-leak.patch b/SOURCES/e2fsprogs-1.45.6-zap_sector-fix-memory-leak.patch new file mode 100644 index 0000000..66e0bc5 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-zap_sector-fix-memory-leak.patch @@ -0,0 +1,37 @@ +From 8f0e75091cfcbdfbfa0f6d0e379e153ddaa268ac Mon Sep 17 00:00:00 2001 +From: wuguanghao +Date: Wed, 30 Jun 2021 16:27:15 +0800 +Subject: [PATCH 28/46] zap_sector: fix memory leak +Content-Type: text/plain + +In zap_sector(), need free buf before return, +otherwise it will cause memory leak. + +Signed-off-by: Wu Guanghao +Signed-off-by: Zhiqiang Liu +Reviewed-by: Wu Bo +Signed-off-by: Theodore Ts'o +Signed-off-by: Lukas Czerner +--- + misc/mke2fs.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/misc/mke2fs.c b/misc/mke2fs.c +index 0184a3a8..389d0981 100644 +--- a/misc/mke2fs.c ++++ b/misc/mke2fs.c +@@ -582,8 +582,10 @@ static void zap_sector(ext2_filsys fs, int sect, int nsect) + else { + magic = (unsigned int *) (buf + BSD_LABEL_OFFSET); + if ((*magic == BSD_DISKMAGIC) || +- (*magic == BSD_MAGICDISK)) ++ (*magic == BSD_MAGICDISK)) { ++ free(buf); + return; ++ } + } + } + +-- +2.35.1 + diff --git a/SPECS/e2fsprogs.spec b/SPECS/e2fsprogs.spec new file mode 100644 index 0000000..4e5b47b --- /dev/null +++ b/SPECS/e2fsprogs.spec @@ -0,0 +1,1134 @@ +Summary: Utilities for managing ext2, ext3, and ext4 file systems +Name: e2fsprogs +Version: 1.45.6 +Release: 5%{?dist} + +# License tags based on COPYING file distinctions for various components +License: GPLv2 +Group: System Environment/Base +Source0: https://www.kernel.org/pub/linux/kernel/people/tytso/%{name}/v%{version}/%{name}-%{version}.tar.xz + +Url: http://e2fsprogs.sourceforge.net/ +Requires: e2fsprogs-libs%{?_isa} = %{version}-%{release} +Requires: libcom_err%{?_isa} = %{version}-%{release} +Requires: libss = %{version}-%{release} + +# e4fsprogs was a parallel ext4-capable package in RHEL5.x +%if 0%{?rhel} > 0 +Obsoletes: e4fsprogs < %{version}-%{release} +Provides: e4fsprogs = %{version}-%{release} +%endif + +BuildRequires: pkgconfig, texinfo, libselinux-devel, gcc +BuildRequires: fuse-devel +BuildRequires: libsepol-devel +BuildRequires: libblkid-devel +BuildRequires: libuuid-devel +BuildRequires: gettext +BuildRequires: multilib-rpm-config + +Patch0: e2fsprogs-1.45.6-Makefile.in-Disable-e2scrub.patch +Patch1: e2fsprogs-1.45.6-Revert-fuse2fs-install-fuse2fs-in-usr-bin-instead-of.patch +Patch2: e2fsprogs-1.45.6-mke2fs.conf-Introduce-rhel6-and-rhel7-fs_type.patch +Patch3: e2fsprogs-1.45.6-man-Add-note-about-RHEL8-supported-features-and-moun.patch +Patch4: e2fsprogs-1.45.6-Revert-libext2fs-revamp-bitmap-types-to-fix-LTO-warn.patch +Patch5: e2fsprogs-1.45.6-Revert-libext2fs-hide-struct-ext2fs_hashmap-as-an-in.patch +Patch6: e2fsprogs-1.45.6-ext2fs-fix-ABI-change-in-the-struct_ext2_filsys-stru.patch +Patch7: e2fsprogs-1.45.6-mke2fs-Escape-double-quotes-when-parsing-mke2fs.conf.patch +Patch8: 0001-reisze2fs-sanity-check-free-block-group-counts-when-.patch +Patch9: 0001-tests-support-older-versions-of-timeout-in-r_corrupt.patch +Patch10: 0001-tests-specify-inode-size-in-r_corrupt_fs.patch +Patch11: e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_open2-on-Big-Endian-sy.patch +Patch12: e2fsprogs-1.45.6-libext2fs-fix-crash-in-ext2fs_image_super_write-on-B.patch +Patch13: e2fsprogs-1.45.6-libext2fs-teach-ext2fs_flush-to-check-if-group-descr.patch +Patch14: e2fsprogs-1.45.6-libext2fs-don-t-needlessly-byte-swap-the-group-descr.patch +Patch15: e2fsprogs-1.45.6-e2fsck-fix-indexed-dir-rehash-failure-with-metadata_.patch +Patch16: e2fsprogs-1.45.6-tune2fs-update-dir-checksums-when-clearing-dir_index.patch +Patch17: e2fsprogs-1.45.6-e2fsck-fix-off-by-one-check-when-validating-depth-of.patch +Patch18: e2fsprogs-1.45.6-libext2fs-fix-potential-buffer-overrun-in-__get_dire.patch +Patch19: e2fsprogs-1.45.6-e2fsck-use-size_t-instead-of-int-in-string_copy.patch +Patch20: e2fsprogs-1.45.6-mke2fs-fix-up-check-for-hardlinks-always-false-if-in.patch +Patch21: e2fsprogs-1.45.6-resize2fs-prevent-block-group-descriptors-from-overf.patch +Patch22: e2fsprogs-1.45.6-debugfs-fix-parse_uint-for-64-bit-fields.patch +Patch23: e2fsprogs-1.45.6-create_inode-set-xattrs-to-the-root-directory-as-wel.patch +Patch24: e2fsprogs-1.45.6-filefrag-handle-invalid-st_dev-and-blksize-cases.patch +Patch25: e2fsprogs-1.45.6-libext2fs-fix-incorrect-negative-error-return-in-uni.patch +Patch26: e2fsprogs-1.45.6-debugfs-fix-double-free-in-realloc-error-path-in-rea.patch +Patch27: e2fsprogs-1.45.6-Fix-clang-warnings.patch +Patch28: e2fsprogs-1.45.6-libext2fs-fix-segault-when-setting-an-xattr-with-an-.patch +Patch29: e2fsprogs-1.45.6-debugfs-fix-memory-allocation-failures-when-parsing-.patch +Patch30: e2fsprogs-1.45.6-libext2fs-fix-crash-when-ext2fs_mmp_stop-is-called-b.patch +Patch31: e2fsprogs-1.45.6-Add-checks-for-fs-blocksize-0-which-could-cause-some.patch +Patch32: e2fsprogs-1.45.6-debugfs-fix-memory-leak-problem-in-read_list.patch +Patch33: e2fsprogs-1.45.6-mmp-do-not-use-O_DIRECT-when-working-with-regular-fi.patch +Patch34: e2fsprogs-1.45.6-resize2fs-avoid-allocating-over-the-MMP-block.patch +Patch35: e2fsprogs-1.45.6-e2image-fix-overflow-in-l2-table-processing.patch +Patch36: e2fsprogs-1.45.6-e2fsck-fix-last-mount-write-time-when-e2fsck-is-forc.patch +Patch37: e2fsprogs-1.45.6-tdb_transaction_recover-fix-memory-leak.patch +Patch38: e2fsprogs-1.45.6-zap_sector-fix-memory-leak.patch +Patch39: e2fsprogs-1.45.6-append_pathname-check-the-value-returned-by-realloc.patch +Patch40: e2fsprogs-1.45.6-argv_parse-check-return-value-of-malloc-in-argv_pars.patch +Patch41: e2fsprogs-1.45.6-misc-fix-potential-segmentation-fault-problem-in-sca.patch +Patch42: e2fsprogs-1.45.6-lib-ss-error.c-check-return-value-malloc-in-ss_name.patch +Patch43: e2fsprogs-1.45.6-ext2ed-fix-potential-NULL-pointer-dereference-in-dup.patch +Patch44: e2fsprogs-1.45.6-mke2fs-only-try-discarding-a-single-block-to-test-if.patch +Patch45: e2fsprogs-1.45.6-ss_add_info_dir-fix-error-handling-when-memory-alloc.patch +Patch46: e2fsprogs-1.45.6-ss_create_invocation-fix-error-handling-when-memory-.patch +Patch47: e2fsprogs-1.45.6-lsattr-check-whether-path-is-NULL-in-lsattr_dir_proc.patch +Patch48: e2fsprogs-1.45.6-ss_create_invocation-fix-potential-unititalized-refe.patch +Patch49: e2fsprogs-1.45.6-quota-Do-not-account-space-used-by-project-quota-fil.patch +Patch50: e2fsprogs-1.45.6-libext2fs-fix-unexpected-NULL-variable.patch +Patch51: e2fsprogs-1.45.6-libext2fs-remove-augmented-rbtree-functionality.patch +Patch52: e2fsprogs-1.45.6-libss-handle-memory-allcation-failure-in-ss_help.patch +Patch53: e2fsprogs-1.45.6-libss-Add-missing-error-handling-for-fdopen.patch +Patch54: e2fsprogs-1.45.6-libsupport-fix-potental-NULL-pointer-dereferences-in.patch +Patch55: e2fsprogs-1.45.6-e2fsck-add-maximum-string-length-specifiers-to-fscan.patch +Patch56: e2fsprogs-1.45.6-tests-Add-option-to-print-diff-output-of-failed-test.patch +Patch57: e2fsprogs-1.45.6-libext2fs-add-sanity-check-to-extent-manipulation.patch +Patch58: e2fsprogs-1.45.6-libss-fix-possible-NULL-pointer-dereferece-on-alloca.patch + +%description +The e2fsprogs package contains a number of utilities for creating, +checking, modifying, and correcting any inconsistencies in second, +third and fourth extended (ext2/ext3/ext4) file systems. E2fsprogs +contains e2fsck (used to repair file system inconsistencies after an +unclean shutdown), mke2fs (used to initialize a partition to contain +an empty ext2 file system), debugfs (used to examine the internal +structure of a file system, to manually repair a corrupted +file system, or to create test cases for e2fsck), tune2fs (used to +modify file system parameters), and most of the other core ext2fs +file system utilities. + +You should install the e2fsprogs package if you need to manage the +performance of an ext2, ext3, or ext4 file system. + +%package libs +Summary: Ext2/3/4 file system specific shared libraries +Group: Development/Libraries +License: GPLv2 and LGPLv2 +Requires: libcom_err%{?_isa} = %{version}-%{release} + +%description libs +E2fsprogs-libs contains libe2p and libext2fs, the libraries of the +e2fsprogs package. + +These libraries are used to directly access ext2/3/4 file systems +from user space. + +%package static +Summary: Ext2/3/4 file system specific static libraries +Group: Development/Libraries +License: GPLv2 and LGPLv2 + +%description static +E2fsprogs-static contains all static libraries built from e2fsprogs, +including libext2fs, libcom_err, libe2p, and libss. + +These libraries are used to directly access ext2/3/4 file systems +from user space, and perform other useful functions. + +%package devel +Summary: Ext2/3/4 file system specific libraries and headers +Group: Development/Libraries +License: GPLv2 and LGPLv2 +Requires: e2fsprogs-libs%{?_isa} = %{version}-%{release} +Requires: libcom_err-devel%{?_isa} = %{version}-%{release} +Requires: gawk +Requires: pkgconfig +Requires(post): info +Requires(preun): info + +%description devel +E2fsprogs-devel contains the libraries and header files needed to +develop second, third and fourth extended (ext2/ext3/ext4) +file system specific programs. + +You should install e2fsprogs-devel if you want to develop ext2/3/4 +file system specific programs. If you install e2fsprogs-devel, you'll +also want to install e2fsprogs. + +%package -n libcom_err +Summary: Common error description library +Group: Development/Libraries +License: MIT + +%description -n libcom_err +This is the common error description library, part of e2fsprogs. + +libcom_err is an attempt to present a common error-handling mechanism. + +%package -n libcom_err-devel +Summary: Common error description library +Group: Development/Libraries +License: MIT +Requires: libcom_err%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n libcom_err-devel +This is the common error description development library and headers, +part of e2fsprogs. It contains the compile_et command, used +to convert a table listing error-code names and associated messages +messages into a C source file suitable for use with the library. + +libcom_err is an attempt to present a common error-handling mechanism. + +%package -n libss +Summary: Command line interface parsing library +Group: Development/Libraries +License: MIT +Requires: libcom_err%{?_isa} = %{version}-%{release} + +%description -n libss +This is libss, a command line interface parsing library, part of e2fsprogs. + +This package includes a tool that parses a command table to generate +a simple command-line interface parser, the include files needed to +compile and use it. + +It was originally inspired by the Multics SubSystem library. + +%package -n libss-devel +Summary: Command line interface parsing library +Group: Development/Libraries +License: MIT +Requires: libss%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n libss-devel +This is the command line interface parsing (libss) development library +and headers, part of e2fsprogs. It contains the mk_cmds command, which +parses a command table to generate a simple command-line interface parser. + +It was originally inspired by the Multics SubSystem library. + +%prep +%setup -q + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +%patch36 -p1 +%patch37 -p1 +%patch38 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 +%patch45 -p1 +%patch46 -p1 +%patch47 -p1 +%patch48 -p1 +%patch49 -p1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 + +%build +%configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ + --enable-elf-shlibs --enable-nls --disable-uuidd --disable-fsck \ + --disable-e2initrd-helper --disable-libblkid --disable-libuuid \ + --enable-quota --with-root-prefix=/usr +make V=1 %{?_smp_mflags} + +%install +rm -rf %{buildroot} +export PATH=/sbin:$PATH +make install install-libs DESTDIR=%{buildroot} INSTALL="%{__install} -p" \ + root_sbindir=%{_sbindir} root_libdir=%{_libdir} + +# Replace arch-dependent header file with arch-independent stub (when needed). +%multilib_fix_c_header --file %{_includedir}/ext2fs/ext2_types.h + +# Hack for now, otherwise strip fails. +chmod +w %{buildroot}%{_libdir}/*.a + +%find_lang %{name} + +%check +make PRINT_FAILED=yes fullcheck + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + +%post devel +# Test for file; if installed with --excludedocs it may not be there +if [ -f %{_infodir}/libext2fs.info.gz ]; then + /sbin/install-info %{_infodir}/libext2fs.info.gz %{_infodir}/dir || : +fi + +%preun devel +if [ $1 = 0 -a -f %{_infodir}/libext2fs.info.gz ]; then + /sbin/install-info --delete %{_infodir}/libext2fs.info.gz %{_infodir}/dir || : +fi +exit 0 + +%post -n libcom_err -p /sbin/ldconfig +%postun -n libcom_err -p /sbin/ldconfig + +%post -n libss -p /sbin/ldconfig +%postun -n libss -p /sbin/ldconfig + +%files -f %{name}.lang +%doc README +%{!?_licensedir:%global license %%doc} + +%config(noreplace) /etc/mke2fs.conf +%{_sbindir}/badblocks +%{_sbindir}/debugfs +%{_sbindir}/dumpe2fs +%{_sbindir}/e2fsck +%{_sbindir}/e2image +%{_sbindir}/e2label +%{_sbindir}/e2mmpstatus +%{_sbindir}/e2undo +%{_sbindir}/e4crypt +%{_sbindir}/fsck.ext2 +%{_sbindir}/fsck.ext3 +%{_sbindir}/fsck.ext4 +%{_sbindir}/fuse2fs +%{_sbindir}/logsave +%{_sbindir}/mke2fs +%{_sbindir}/mkfs.ext2 +%{_sbindir}/mkfs.ext3 +%{_sbindir}/mkfs.ext4 +%{_sbindir}/resize2fs +%{_sbindir}/tune2fs +%{_sbindir}/filefrag +%{_sbindir}/e2freefrag +%{_sbindir}/e4defrag +%{_sbindir}/mklost+found + +%{_bindir}/chattr +%{_bindir}/lsattr +%{_mandir}/man1/chattr.1* +%{_mandir}/man1/fuse2fs.1* +%{_mandir}/man1/lsattr.1* + +%{_mandir}/man5/ext2.5* +%{_mandir}/man5/ext3.5* +%{_mandir}/man5/ext4.5* +%{_mandir}/man5/e2fsck.conf.5* +%{_mandir}/man5/mke2fs.conf.5* + +%{_mandir}/man8/badblocks.8* +%{_mandir}/man8/debugfs.8* +%{_mandir}/man8/dumpe2fs.8* +%{_mandir}/man8/e2fsck.8* +%{_mandir}/man8/e4crypt.8* +%{_mandir}/man8/filefrag.8* +%{_mandir}/man8/e2freefrag.8* +%{_mandir}/man8/e4defrag.8* +%{_mandir}/man8/fsck.ext2.8* +%{_mandir}/man8/fsck.ext3.8* +%{_mandir}/man8/fsck.ext4.8* +%{_mandir}/man8/e2image.8* +%{_mandir}/man8/e2label.8* +%{_mandir}/man8/e2mmpstatus.8* +%{_mandir}/man8/e2undo.8* +%{_mandir}/man8/logsave.8* +%{_mandir}/man8/mke2fs.8* +%{_mandir}/man8/mkfs.ext2.8* +%{_mandir}/man8/mkfs.ext3.8* +%{_mandir}/man8/mkfs.ext4.8* +%{_mandir}/man8/mklost+found.8* +%{_mandir}/man8/resize2fs.8* +%{_mandir}/man8/tune2fs.8* + +%files libs +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/libe2p.so.* +%{_libdir}/libext2fs.so.* + +%files static +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/*.a + +%files devel +%{_infodir}/libext2fs.info* +%{_libdir}/libe2p.so +%{_libdir}/libext2fs.so +%{_libdir}/pkgconfig/e2p.pc +%{_libdir}/pkgconfig/ext2fs.pc + +%{_includedir}/e2p +%{_includedir}/ext2fs + +%files -n libcom_err +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/libcom_err.so.* + +%files -n libcom_err-devel +%{_bindir}/compile_et +%{_libdir}/libcom_err.so +%{_datadir}/et +%{_includedir}/et +%{_includedir}/com_err.h +%{_mandir}/man1/compile_et.1* +%{_mandir}/man3/com_err.3* +%{_libdir}/pkgconfig/com_err.pc + +%files -n libss +%{!?_licensedir:%global license %%doc} +%license NOTICE +%{_libdir}/libss.so.* + +%files -n libss-devel +%{_bindir}/mk_cmds +%{_libdir}/libss.so +%{_datadir}/ss +%{_includedir}/ss +%{_mandir}/man1/mk_cmds.1* +%{_libdir}/pkgconfig/ss.pc + +%changelog +* Wed May 11 2022 Lukas Czerner 1.45.6-5 +- Update e2fsprogs with upstream fixes and improvements (#2083621) +- Fix out-of-bounds read/write via crafter filesystem (#2073548) + +* Wed Feb 16 2022 Lukas Czerner 1.45.6-4 +- Sanity check free block group counts when calculating minimum size (#2054129) + +* Thu Jan 27 2022 Lukas Czerner 1.45.6-3 +- Rebuild to ship libss-devel package (#1947449) + +* Thu Jun 17 2021 Lukas Czerner 1.45.6-2 +- Fix internal configuration pseudo file (#1889464) + +* Wed Jun 03 2020 Lukas Czerner 1.45.6-1 +- Rebase to the upstream release 1.45.6 (#1843548) + +* Tue Jan 14 2020 Lukas Czerner 1.45.4-3 +- Fix clang warning introduced in previous release (#1783777) + +* Tue Jan 14 2020 Lukas Czerner 1.45.4-2 +- Fix ABI breakage introduced in previous release (#1783777) + +* Sun Dec 15 2019 Lukas Czerner 1.45.4-1 +- Rebase to the release 1.45.4 (#1783777) +- provide rhel6/7 compatible fs_type in mke2fs.conf (#1780279) +- fix crafted ext4 partition leads to out-of-bounds write (#1768709) +- include note about supported rhel8 features and options (#1788573) + +* Wed May 29 2019 Lukas Czerner 1.44.6-3 +- Backport fixes from 1.45.2 (#1714927) +- Fix errors in rpmdiff (#1714923) + +* Wed May 15 2019 Lukas Czerner 1.44.6-2 +- Backport fixes from 1.45.1 + +* Tue Apr 2 2019 Lukas Czerner 1.44.6-1 +- Rebase to the release 1.44.6 (#1695147) +- Backport fixes from 1.45.0 +- Add gating.yaml (#1679654) + +* Fri Dec 14 2018 Lukas Czerner 1.44.3-2 +- Backport fixes from upstream version 1.44.4 (#1659526) + +* Wed Jul 18 2018 Lukas Czerner 1.44.3-1 +- New upstream release + +* Wed Feb 07 2018 Fedora Release Engineering - 1.43.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jan 9 2018 Lukas Czerner 1.43.8-1 +- New upstream release +- Fix build failure swapfs.c on big-endian + +* Wed Oct 18 2017 Eric Sandeen 1.43.7-1 +- New upstream release + +* Wed Aug 30 2017 Eric Sandeen 1.43.6-1 +- New upstream release + +* Fri Aug 11 2017 Kalev Lember 1.43.5-2 +- Bump and rebuild for an rpm signing issue + +* Tue Aug 08 2017 Eric Sandeen 1.43.5-1 +- New upstream release + +* Wed Aug 02 2017 Fedora Release Engineering - 1.43.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.43.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Feb 01 2017 Stephen Gallagher - 1.43.4-2 +- Add missing %%license macro + +* Tue Jan 31 2017 Eric Sandeen 1.43.4-1 +- New upstream release + +* Mon Sep 05 2016 Eric Sandeen 1.43.3-1 +- New upstream release + +* Mon Sep 05 2016 Eric Sandeen 1.43.2-1 +- New upstream release (broken on i686, not built) + +* Thu Jun 16 2016 Eric Sandeen 1.43.1-2 +- Fix e2undo endian issues (#1344636) + +* Wed Jun 08 2016 Eric Sandeen 1.43.1-1 +- New upstream release + +* Wed Feb 03 2016 Fedora Release Engineering - 1.42.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.42.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jun 08 2015 Eric Sandeen 1.42.13-2 +- Add -fno-strict-aliasing (#1211582) + +* Mon May 18 2015 Eric Sandeen 1.42.13-1 +- New upstream release + +* Thu Apr 30 2015 Eric Sandeen 1.42.12-5 +- Don't trigger full check within time fudge window (#1202024) + +* Tue Feb 24 2015 Eric Sandeen 1.42.12-4 +- Fix potential buffer overflow in closefs (#1193947, CVE-2015-1572) +- Fix dumpe2fs segfault with no arguments (#1194063) +- Don't require fsck prior to resize2fs -P (#1170803) + +* Sat Feb 21 2015 Till Maas - 1.42.12-3 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Tue Feb 17 2015 Eric Sandeen 1.42.12-2 +- Fix use after free (#1192861) +- Fix time-based fsck if set in superblock (e2fsck.conf, #963283) + +* Fri Aug 29 2014 Eric Sandeen 1.42.12-1 +- New upstream release + +* Sat Aug 16 2014 Fedora Release Engineering - 1.42.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jul 12 2014 Tom Callaway 1.42.11-2 +- fix license handling + +* Fri Jul 11 2014 Eric Sandeen 1.42.11-1 +- New upstream release + +* Tue Jul 01 2014 Dan Horák - 1.42.10-5 +- Rebuilt for buggy rpm 4.12 alpha - + https://lists.fedoraproject.org/pipermail/devel/2014-June/200633.html + +* Mon Jun 30 2014 Dan Horák - 1.42.10-4 +- Add missing dependency info for quota.c - fixes build on s390(x) + +* Sat Jun 07 2014 Fedora Release Engineering - 1.42.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 21 2014 Eric Sandeen 1.42.10-2 +- Fix large file handling on 32-bit builds + +* Mon May 19 2014 Eric Sandeen 1.42.10-1 +- New upstream release +- Enable userspace quota + +* Mon Jan 20 2014 Eric Sandeen 1.42.9-2 +- Fix up Source0 URL + +* Thu Jan 02 2014 Eric Sandeen 1.42.9-1 +- New upstream release +- Re-enable disabled tests for now + +* Sat Aug 03 2013 Fedora Release Engineering - 1.42.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jul 22 2013 Eric Sandeen 1.42.8-2 +- Interpackage dependencies should be for same arch +- Remove newly added but failing resize2fs tests for now + +* Wed Jun 26 2013 Eric Sandeen 1.42.8-1 +- New upstream release + +* Tue Jan 29 2013 Eric Sandeen 1.42.7-2 +- Tighten up inter-package dependencies + +* Tue Jan 22 2013 Eric Sandeen 1.42.7-1 +- New upstream release + +* Tue Oct 02 2012 Eric Sandeen 1.42.6-2 +- Switch back to gzipped tarball to make sf.net source URL correct + +* Tue Oct 02 2012 Eric Sandeen 1.42.6-1 +- New upstream release + +* Thu Aug 16 2012 Eric Sandeen 1.42.5-2 +- Add explicit library deps to e2fsprogs (#848805) + +* Mon Jul 30 2012 Eric Sandeen 1.42.5-1 +- New upstream release + +* Wed Jul 18 2012 Fedora Release Engineering - 1.42.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jun 12 2012 Eric Sandeen 1.42.4-1 +- New upstream release + +* Thu May 31 2012 Eric Sandeen 1.42.3-2 +- Fixes for > 16T filesystems + +* Mon May 14 2012 Eric Sandeen 1.42.3-1 +- New upstream release + +* Sun Apr 22 2012 Eric Sandeen 1.42.2-6 +- Add missing [options] tag to e2fsck.conf + +* Fri Apr 20 2012 Eric Sandeen 1.42.2-5 +- Add broken system clock config to e2fsck.conf to let boot + continue even if system clock very wrong. + +* Mon Apr 09 2012 Eric Sandeen 1.42.2-4 +- Handle 32-bit bitmaps in new find_first_zero functions + +* Fri Mar 30 2012 Richard W.M. Jones 1.42.2-3 +- Rebuild against new RPM (RHBZ#808250). + +* Wed Mar 28 2012 Eric Sandeen 1.42.2-2 +- Move files out of /sbin and /lib into /usr/... + +* Tue Mar 27 2012 Eric Sandeen 1.42.2-1 +- New upstream release + +* Mon Feb 20 2012 Eric Sandeen 1.42.1-1 +- New upstream release + +* Fri Jan 13 2012 Fedora Release Engineering - 1.42-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Nov 29 2011 Eric Sandeen 1.42-1 +- New upstream point release + +* Mon Nov 21 2011 Eric Sandeen 1.42-0.9.WIP.1120 +- Build the right tarball for 1.42-WIP-1120 + +* Mon Nov 21 2011 Eric Sandeen 1.42-0.8.WIP.1120 +- New upstream snapshot release + +* Thu Nov 10 2011 Eric Sandeen 1.42-0.7.WIP.1016 +- Several mmp-related fixes + +* Tue Nov 08 2011 Eric Sandeen 1.42-0.6.WIP.1016 +- Fix e2fsck / make check on big endian arch + +* Mon Oct 17 2011 Eric Sandeen 1.42-0.5.WIP.1016 +- New upstream snapshot release + +* Mon Oct 10 2011 Eric Sandeen 1.42-0.4.WIP.2011.1009 +- New upstream snapshot release + +* Mon Sep 26 2011 Eric Sandeen 1.42-0.3.WIP.0925 +- New upstream snapshot release + +* Tue Aug 09 2011 Eric Sandeen 1.42-0.2.WIP.0702 +- Fix use of uninitialized memory via ext2fs_copy_generic_bmap() + +* Tue Aug 09 2011 Eric Sandeen 1.42-0.1.WIP.0702 +- Test release for >16T support + +* Tue Feb 08 2011 Fedora Release Engineering - 1.41.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 23 2010 Eric Sandeen 1.41.14-1 +- New upstream release + +* Wed Dec 22 2010 Dan Horák 1.41.13-2 +- Add upstream fix for big-endian machines + +* Mon Dec 20 2010 Eric Sandeen 1.41.13-1 +- New upstream release + +* Tue Dec 07 2010 Eric Sandeen 1.41.12-7 +- Fix up UTF-8 formatting in e2fsck output (#655227) + +* Wed Oct 06 2010 Eric Sandeen 1.41.12-6 +- Install e4defrag for testing + +* Tue Jul 13 2010 Eric Sandeen 1.41.12-5 +- Relax fsck requirements for resize2fs -P + +* Mon Jul 12 2010 Eric Sandeen 1.41.12-4 +- Add COPYING file to the static subpackage + +* Wed Jun 02 2010 Eric Sandeen 1.41.12-3 +- Reinstate static libs in dedicated package (#596377) + +* Wed May 19 2010 Eric Sandeen 1.41.12-2 +- Fix fsck thinko in 1.41.12 release + +* Mon May 17 2010 Eric Sandeen 1.41.12-1 +- New upstream version + +* Mon Mar 15 2010 Eric Sandeen 1.41.11-1 +- New upstream version + +* Mon Mar 01 2010 Eric Sandeen 1.41.10-5 +- Don't ask for confirmation of misaligned mkfs with -F (#569021) + +* Tue Feb 23 2010 Eric Sandeen 1.41.10-4 +- Fix for e2fsck -fD corruption + +* Fri Feb 12 2010 Eric Sandeen 1.41.10-3 +- And drop virtual provides for static libs + +* Fri Feb 12 2010 Eric Sandeen 1.41.10-2 +- Drop static libs (#545144) + +* Wed Feb 10 2010 Eric Sandeen 1.41.10-1 +- New upstream version + +* Sun Feb 07 2010 Eric Sandeen 1.41.9-10 +- Upstream version of resize2fs array fix, original was wrong + +* Sat Jan 23 2010 Eric Sandeen 1.41.9-9 +- Fix up stray output & re-enable make check +- Fix dlopen issues for newer libreadline +- Fix access beyond end of array in resize2fs + +* Tue Nov 10 2009 Eric Sandeen 1.41.9-8 +- Fix up topology patch to build w/ new util-linux-ng +- Fix endian swapping of backup journal blocks in sb + +* Tue Nov 10 2009 Eric Sandeen 1.41.9-7 +- Re-enable "make check" during build + +* Wed Oct 28 2009 Eric Sandeen 1.41.9-6 +- Add support for block discard (TRIM) at mkfs time +- Add support for new blkid topology awareness + +* Mon Oct 19 2009 Eric Sandeen 1.41.9-5 +- Allow superblock timestamp differences up to 24h (#522969) + +* Tue Oct 06 2009 Eric Sandeen 1.41.9-4 +- Fix install with --excludedocs (#515987) + +* Mon Sep 14 2009 Eric Sandeen 1.41.9-3 +- Drop defrag bits for now, not ready yet. + +* Thu Sep 10 2009 Josef Bacik 1.41.9-2 +- Fix resize -m bug with flexbg (#519131) + +* Sun Aug 23 2009 Eric Sandeen 1.41.9-1 +- New upstream release + +* Thu Aug 06 2009 Eric Sandeen 1.41.8-6 +- Fix filefrag in fallback case +- Add e2freefrag & e4defrag (experimental) + +* Sun Jul 26 2009 Karel Zak 1.41.8-5 +- disable fsck (replaced by util-linux-ng) + +* Sat Jul 25 2009 Karel Zak 1.41.8-4 +- disable libuuid and uuidd (replaced by util-linux-ng) + +* Fri Jul 24 2009 Fedora Release Engineering - 1.41.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Jul 17 2009 Eric Sandeen 1.41.8-2 +- Address some package review concerns (#225714) + +* Sun Jul 12 2009 Eric Sandeen 1.41.8-1 +- New upstream version, several resize fixes. + +* Tue Jun 30 2009 Eric Sandeen 1.41.7-1 +- New upstream version + +* Fri Jun 26 2009 Eric Sandeen 1.41.6-6 +- Split out sub-libraries (#225406) +- Don't start uuidd by default + +* Thu Jun 18 2009 Eric Sandeen 1.41.6-5 +- Update journal backup blocks in sb after resize (#505339) +- Fix memory leak in extent handling functions +- Fix bug in inode writing in extent code, clobbered i_extra_isize etc + +* Mon Jun 8 2009 Karel Zak 1.41.6-4 +- set BuildRequires: libblkid-devel (from util-linux-ng) + +* Mon Jun 8 2009 Karel Zak 1.41.6-3 +- temporary use BuildRequires: e2fsprogs-devel (we cannot install + new util-linux-ng with libblkid to buildroots without new e2fsprogs + without libblkid). + +* Thu Jun 4 2009 Karel Zak 1.41.6-2 +- disable libblkid (replaced by libblkid from util-linux-ng) + +* Sat May 30 2009 Eric Sandeen 1.41.6-1 +- New upstream version + +* Fri Apr 24 2009 Eric Sandeen 1.41.5-1 +- New upstream version + +* Wed Apr 22 2009 Eric Sandeen 1.41.4-8 +- Fix support for external journals + +* Wed Apr 22 2009 Eric Sandeen 1.41.4-7 +- Fix ext4 resize issues (#496982) + +* Sat Apr 11 2009 Eric Sandeen 1.41.4-6 +- ignore differing NEEDS_RECOVERY flag on fsck post-resize (#471925) + +* Thu Feb 26 2009 Eric Sandeen 1.41.4-5 +- fix a couple missed descriptions; obsolete e4fsprogs + +* Thu Feb 26 2009 Eric Sandeen 1.41.4-4 +- Edit summary & description to include ext4 (#487469) +- Fix blkid null ptr deref in initrd (#486997) + +* Tue Feb 24 2009 Fedora Release Engineering - 1.41.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Jan 29 2009 Eric Sandeen 1.41.4-2 +- Fix debugfs "stat" segfault if no open fs (#482894) +- Fix name of libext2fs info page (#481620) + +* Thu Jan 29 2009 Eric Sandeen 1.41.4-1 +- New upstream release +- Dropped btrfs & resize fixes, upstream now + +* Tue Jan 20 2009 Eric Sandeen 1.41.3-4 +- resize2fs fixes, esp. for ext4 + +* Sat Jan 10 2009 Eric Sandeen 1.41.3-3 +- Remove conservative "don't change journal location" patch for F11 +- Add btrfs recognition to blkid + +* Fri Nov 07 2008 Eric Sandeen 1.41.3-2 +- Bump to revision 2, f10 was behind f9, oops. + +* Mon Oct 13 2008 Eric Sandeen 1.41.3-1 +- New upstream version (very minor fixes, ext4-related) + +* Thu Oct 02 2008 Eric Sandeen 1.41.2-2 +- Fix blkid to recognize ext4dev filesystems as ext4-mountable + +* Thu Oct 02 2008 Eric Sandeen 1.41.2-1 +- New upstream version +- Updated default dir hash (half_md4) for better perf & fewer collisions +- Fixed ext4 online resizing with flex_bg +- ext4 journal now in extents format and in middle of filesystem +- fix unreadable e2image files +- fix file descriptor leak in libcom_err (#464689) + +* Sat Aug 23 2008 Eric Sandeen 1.41.0-2 +- Don't check the group checksum when !GDT_CSUM (#459875) + +* Thu Jul 10 2008 Eric Sandeen 1.41.0-1 +- New upstream version +- ext4 capable + +* Mon Jul 07 2008 Eric Sandeen 1.41-0.2.WIP.0707 +- Fix release macro snafu + +* Mon Jul 07 2008 Eric Sandeen 1.41-0.1.WIP.0707 +- New upstream snapshot release + +* Fri Jun 20 2008 Eric Sandeen 1.41-0.WIP.0617.1 +- Fix blkid -g segfault when clearing entries (#452333) + +* Wed Jun 18 2008 Eric Sandeen 1.41-0.WIP.0617 +- New upstream snapshot release for ext4 capability + +* Wed Jun 04 2008 Eric Sandeen 1.40.10-3 +- Tidy up multilib hack for non-multilib arches (#446016) +- Fix up postun script (#449868) + +* Wed Jun 04 2008 Dennis Gilmore 1.40.10-2 +- setup header support for sparc + +* Fri May 23 2008 Eric Sandeen 1.40.10-1 +- New upstream version +- Fixes unprivileged blkid use problem (#448591) + +* Mon May 12 2008 Eric Sandeen 1.40.9-2 +- Fix blkid swap recognition on big-endian boxes (#445786) + +* Sun Apr 27 2008 Eric Sandeen 1.40.9-1 +- New upstream version + +* Fri Mar 14 2008 Eric Sandeen 1.40.8-2 +- Update ext2fs_swap_inode_full() fix to match upstream +- Check more of swapv1 header in blkid detection (#442937) + +* Fri Mar 14 2008 Eric Sandeen 1.40.8-1 +- New upstream version + +* Mon Mar 03 2008 Eric Sandeen 1.40.7-2 +- second try at fixing resize2fs vs. large inodes... (#434893) + +* Fri Feb 29 2008 Eric Sandeen 1.40.7-1 +- New upstream version, special leap-day edition +- Fix resize2fs losing inline xattrs when shrinking (#434893) + and add patch to fix swap_inode_full in this case +- Allow mke2fs & tune2fs to manipulate large_file feature (#258381) +- Handle lvm error conditions in libblkid (#433857) +- Allow tune2fs to clear the resize_inode feature (#167816) +- Teach blkid to detect LVM2 physical volumes (#409321) +- Show "mostly printable" xattrs as text in debugfs (#430621) +- Trimmed pre-1.38 rpm changelog entries + +* Sun Feb 10 2008 Eric Sandeen 1.40.6-1 +- New upstream version + +* Fri Feb 08 2008 Eric Sandeen 1.40.5-2 +- gcc-4.3 rebuild + +* Mon Jan 28 2008 Eric Sandeen 1.40.5-1 +- New upstream version, drop several now-upstream patches. + +* Thu Jan 24 2008 Eric Sandeen 1.40.4-7 +- Fix sb flag comparisons properly this time (#428893) +- Make 256-byte inodes for the [default] mkfs case. + This will facilitate upgrades to ext4 later, and help xattr perf. + +* Wed Jan 23 2008 Eric Sandeen 1.40.4-6 +- Completely clobber e2fsck.static build. + +* Wed Jan 23 2008 Eric Sandeen 1.40.4-5 +- Ignore some primary/backup superblock flag differences (#428893) +- Teach libblkid about ext4dev. + +* Tue Jan 15 2008 Eric Sandeen 1.40.4-4 +- Build e2fsck as a dynamically linked binary. +- Re-fix uidd manpage default paths. + +* Mon Jan 14 2008 Eric Sandeen 1.40.4-3 +- New uuidd subpackage, and properly set up uuidd at install. + +* Tue Jan 01 2008 Eric Sandeen 1.40.4-2 +- Add new uidd files to specfile + +* Tue Jan 01 2008 Eric Sandeen 1.40.4-1 +- New upstream version, drop several now-upstream patches. + +* Tue Jan 01 2008 Eric Sandeen 1.40.2-15 +- Drop resize_inode removal patch from tune2fs; ostensibly was + for old kernels which could not mount, but seems to be fine. +- Drop pottcdate removal patch, and don't rebuild .po files, + causes multilib problems and we generally shouldn't rebuild. +- Drop multilib patch; wrapper header should take care of this now. +- Drop ->open rename, Fedora seems ok with this now. + +* Tue Dec 11 2007 Eric Sandeen 1.40.2-14 +- Fix integer overflows (#414591 / CVE-2007-5497) + +* Tue Dec 4 2007 Stepan Kasal 1.40.2-13 +- The -devel package now requires device-mapper-devel, to match + the dependency in blkid.pc (#410791) + +* Tue Nov 27 2007 Eric Sandeen 1.40.2-12 +- Use upstream patch for blkid fat detection, avoids div-by-zero + when encountering some BSD partitions (#398281) + +* Tue Oct 23 2007 Eric Sandeen 1.40.2-11 +- Add arm to multilib header wrapper + +* Sat Oct 20 2007 Eric Sandeen 1.40.2-10 +- Make (more) file timestamps match those in tarball for multilib tidiness +- Fix e2fsprogs-libs summary (shared libs not static) + +* Mon Oct 15 2007 Eric Sandeen 1.40.2-9 +- Detect big-endian squashfs filesystems in libblkid (#305151) + +* Tue Oct 02 2007 Eric Sandeen 1.40.2-8 +- Detect squashfs filesystems in libblkid (#305151) + +* Tue Sep 18 2007 Eric Sandeen 1.40.2-7 +- Fix blkid fat probe when there is a real MBR (#290951) + +* Tue Sep 18 2007 Oliver Falk 1.40.2-6 +- Add alpha to the header wrappers + +* Fri Sep 07 2007 Eric Sandeen 1.40.2-5 +- wrap a couple headers to fix multilib issues (#270441) + +* Wed Aug 29 2007 Eric Sandeen 1.40.2-4 +- add gawk to e2fsprogs-devel Requires, compile_et needs it (#265961) + +* Thu Aug 23 2007 Eric Sandeen 1.40.2-3 +- Update license tags +- Fix one open-create caller with no mode +- Protect ->open ops from glibc open-create-mode-checker +- Fix source URL +- Add gawk to BuildRequires + +* Wed Jul 18 2007 Eric Sandeen 1.40.2-2 +- Fix bug in ext2fs_swap_inode_full() on big-endian boxes + +* Tue Jul 17 2007 Eric Sandeen 1.40.2-1 +- New version 1.40.2 +- Fix up warning in badblocks + +* Mon Jun 25 2007 Eric Sandeen 1.39-15 +- Fix up .po files to remove timestamps; multilib issues (#245653) + +* Fri Jun 22 2007 Eric Sandeen 1.39-14 +- Many coverity-found potential leaks, segfaults, etc (#239354) +- Fix debugfs segfaults when no fs open (#208416, #209330) +- Avoid recursive loops in logdump due to symlinks in /dev (#210371) +- Don't write changes to the backup superblocks by default (#229561) +- Correct byteswapping for fast symlinks with xattrs (#232663) +- e2fsck: added sanity check for xattr validation (#230193) + +* Wed Jun 20 2007 Eric Sandeen 1.39-13 +- add dist tag to release field + +* Wed Jun 20 2007 Eric Sandeen 1.39-12 +- add LUKS support to libblkid (#242421) + +* Fri Feb 23 2007 Karsten Hopp 1.39-11 +- fix post/preun requirements +- use smp flags + +* Mon Feb 05 2007 Alasdair Kergon - 1.39-10 +- Add build dependency on new device-mapper-devel package. + +* Mon Dec 25 2006 Thomas Woerner - 1.39-9 +- build fixes for new automake 1.10 (#220715) + +* Mon Dec 18 2006 Thomas Woerner - 1.39-8 +- make uuid_generate_time generate unique uuids (#218606) + +* Wed Sep 20 2006 Jarod Wilson - 1.39-7 +- 32-bit 16T fixups from esandeen (#202807) +- Update summaries and descriptions + +* Sun Sep 17 2006 Karel Zak - 1.39-6 +- Fix problem with empty FAT label (#206656) + +* Tue Sep 5 2006 Peter Jones - 1.39-5 +- Fix memory leak in device probing. + +* Mon Jul 24 2006 Thomas Woerner - 1.39-4 +- fixed multilib devel conflicts (#192665) + +* Thu Jul 20 2006 Bill Nottingham - 1.39-3 +- prevent libblkid returning /dev/dm-X + +* Wed Jul 12 2006 Jesse Keating - 1.39-2.1 +- rebuild + +* Mon Jul 10 2006 Karel Zak - 1.39-2 +- add GFS abd GFS2 support to libblkid + +* Thu Jul 6 2006 Thomas Woerner - 1.39-1 +- new version 1.39 +- dropped ext2online, because resize2fs is now able to do online resize +- spec file cleanup +- enabled checks for build + +* Tue Jun 13 2006 Bill Nottingham - 1.38-15 +- prevent libblkid returning /dev/dm-X +- fix build + +* Tue Mar 21 2006 Karel Zak - 1.38-14 +- prevent error messages to stderr caused by libblkid calling libdevmapper + +* Mon Mar 13 2006 Karel Zak - 1.38-13 +- used upstream version of the blkid-epoch patch (by Theodore Tso, #182188) + +* Wed Mar 8 2006 Peter Jones - 1.38-12 +- Move /etc/blkid.tab to /etc/blkid/blkid.tab + +* Tue Mar 7 2006 David Cantrell - 1.38-11 +- BuildRequires pkgconfig + +* Tue Mar 7 2006 David Cantrell - 1.38-10 +- Disable /etc/blkid.tab caching if time is set before epoch (#182188) + +* Fri Feb 24 2006 Peter Jones - 1.38-9 +- _don't_ handle selinux context on blkid.tab, dwalsh says this is a no-no. + +* Wed Feb 22 2006 Peter Jones - 1.38-8 +- handle selinux context on blkid.tab + +* Mon Feb 20 2006 Karsten Hopp 1.38-7 +- BuildRequires: gettext-devel + +* Fri Feb 10 2006 Jesse Keating - 1.38-6.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 7 2006 Jesse Keating - 1.38-6.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Wed Jan 11 2006 Karel Zak 1.38-6 +- cleanup device-mapper patch +- use pkg-config for device-mapper + +* Mon Jan 9 2006 Peter Jones 1.38-5 +- fix some more minor logic errors in dm probing + +* Wed Jan 4 2006 Peter Jones 1.38-4 +- fix a logic error in dm probing +- add priority group for dm devices, so they'll be preferred + +* Tue Jan 3 2006 Peter Jones 1.38-3 +- added support for device-mapper devices + +* Fri Dec 9 2005 Jesse Keating +- rebuilt + +* Thu Nov 10 2005 Thomas Woerner 1.38-2.1 +- fixed file conflicts between 32bit and 64bit packages (#168815) +- fixed mklost+found crashes with buffer overflow (#157773) + Thanks to Arjan van de Ven for the patch + +* Wed Nov 9 2005 Thomas Woerner 1.38-2 +- splitted up libs from main package, into a new e2fsprogs-libs package +- fixed requires and prereqs + +* Thu Sep 8 2005 Thomas Woerner 1.38-1 +- new version 1.38 +- Close File descriptor for unregognized devices (#159878) + Thanks to David Milburn for the patch. + Merged from RHEL-4 +- enable tune2fs to set and clear feature resize_inode (#167816) +- removed outdated information from ext2online man page (#164383) +