From 3b974a41d1a46cd3b6d73e3db730942d74c4531a Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 29 2020 07:04:20 +0000 Subject: import e2fsprogs-1.42.9-19.el7 --- diff --git a/.e2fsprogs.metadata b/.e2fsprogs.metadata index ab7c432..396bcb4 100644 --- a/.e2fsprogs.metadata +++ b/.e2fsprogs.metadata @@ -1 +1,2 @@ af55e3b6ca87773fd9f76db0e59519dcfc2fdb13 SOURCES/e2fsprogs-1.42.9.tar.xz +01b632e48f0cde4fc50da202cc870f26ef4f5731 SOURCES/image.gz diff --git a/.gitignore b/.gitignore index 547de4d..c2c0662 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ SOURCES/e2fsprogs-1.42.9.tar.xz +SOURCES/image.gz diff --git a/SOURCES/e2fsprogs-1.42.9-Fix-typo-in-the-ext4-5-man-page.patch b/SOURCES/e2fsprogs-1.42.9-Fix-typo-in-the-ext4-5-man-page.patch new file mode 100644 index 0000000..1b3b5ce --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-Fix-typo-in-the-ext4-5-man-page.patch @@ -0,0 +1,29 @@ +From beed1a9f0e8357de209c2c1418ca7db5d18a14f4 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Wed, 9 Sep 2015 10:53:49 -0400 +Subject: [PATCH 5/7] Fix typo in the ext4(5) man page + +Addresses-Debian-Bug: #798425 + +RHBZ: 1720130 +Signed-off-by: Theodore Ts'o +--- + misc/ext4.5.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/misc/ext4.5.in b/misc/ext4.5.in +index 366916d8..b73046ca 100644 +--- a/misc/ext4.5.in ++++ b/misc/ext4.5.in +@@ -6,7 +6,7 @@ + .SH NAME + ext2 \- the second extended file system + .br +-ext2 \- the third extended file system ++ext3 \- the third extended file system + .br + ext4 \- the fourth extended file system + .SH DESCRIPTION +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.42.9-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch b/SOURCES/e2fsprogs-1.42.9-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch new file mode 100644 index 0000000..a002803 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch @@ -0,0 +1,54 @@ +From bd2ce466bd00d2fcdbc5154754fc4711f3348a18 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 19 Dec 2019 19:37:34 -0500 +Subject: [PATCH 1/7] e2fsck: abort if there is a corrupted directory block + when rehashing + +In e2fsck pass 3a, when we are rehashing directories, at least in +theory, all of the directories should have had corruptions with +respect to directory entry structure fixed. However, it's possible +(for example, if the user declined a fix) that we can reach this stage +of processing with a corrupted directory entries. + +So check for that case and don't try to process a corrupted directory +block so we don't run into trouble in mutate_name() if there is a +zero-length file name. + +RHBZ: 1797731 +Addresses: TALOS-2019-0973 +Addresses: CVE-2019-5188 +Signed-off-by: Theodore Ts'o +--- + e2fsck/rehash.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c +index 3aafbb12..fbc4e558 100644 +--- a/e2fsck/rehash.c ++++ b/e2fsck/rehash.c +@@ -129,6 +129,10 @@ static int fill_dir_block(ext2_filsys fs, + dir_offset += rec_len; + if (dirent->inode == 0) + continue; ++ if ((dirent->name_len & 0xFF) == 0) { ++ fd->err = EXT2_ET_DIR_CORRUPTED; ++ return BLOCK_ABORT; ++ } + if (!fd->compress && ((dirent->name_len&0xFF) == 1) && + (dirent->name[0] == '.')) + continue; +@@ -367,6 +371,11 @@ static int duplicate_search_and_fix(e2fsck_t ctx, ext2_filsys fs, + } + memcpy(new_name, ent->dir->name, ent->dir->name_len & 0xFF); + new_len = ent->dir->name_len; ++ if ((new_len & 0xFF) == 0) { ++ /* should never happen */ ++ ext2fs_unmark_valid(fs); ++ continue; ++ } + mutate_name(new_name, &new_len); + for (j=0; j < fd->num_array; j++) { + if ((i==j) || +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.42.9-e2fsck-clarify-overflow-link-count-error-message.patch b/SOURCES/e2fsprogs-1.42.9-e2fsck-clarify-overflow-link-count-error-message.patch new file mode 100644 index 0000000..22fd21c --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-e2fsck-clarify-overflow-link-count-error-message.patch @@ -0,0 +1,97 @@ +From 334cc898f177771a5f1ca14c181d6df775cc55ec Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 13 Feb 2020 11:15:56 +0100 +Subject: [PATCH 7/7] e2fsck: clarify overflow link count error message + +When directory link count is set to overflow value (1) but during pass 4 +we find out the exact link count would fit, we either silently fix this +(which is not great because e2fsck then reports the fs was modified but +output doesn't indicate why in any way), or we report that link count is +wrong and ask whether we should fix it (in case -n option was +specified). The second case is even more misleading because it suggests +non-trivial fs corruption which then gets silently fixed on the next +run. Similarly to how we fix up other non-problems, just create a new +error message for the case directory link count is not overflown anymore +and always report it to clarify what is going on. + +RHBZ: 1820048 +Reviewed-by: Andreas Dilger +Signed-off-by: Jan Kara +Signed-off-by: Theodore Ts'o +(cherry picked from commit 4ebce13292f54c96f43dcb1bd1d5b8df5dc8749d) +--- + e2fsck/pass4.c | 19 +++++++++++++++---- + e2fsck/problem.c | 5 +++++ + e2fsck/problem.h | 3 +++ + 3 files changed, 23 insertions(+), 4 deletions(-) + +diff --git a/e2fsck/pass4.c b/e2fsck/pass4.c +index ad95227c..c9586dfb 100644 +--- a/e2fsck/pass4.c ++++ b/e2fsck/pass4.c +@@ -173,6 +173,7 @@ void e2fsck_pass4(e2fsck_t ctx) + link_counted = 1; + } + if (link_counted != link_count) { ++ int fix_nlink = 0; + e2fsck_read_inode(ctx, i, inode, "pass4"); + pctx.ino = i; + pctx.inode = inode; +@@ -185,10 +186,20 @@ void e2fsck_pass4(e2fsck_t ctx) + pctx.num = link_counted; + /* i_link_count was previously exceeded, but no longer + * is, fix this but don't consider it an error */ +- if ((isdir && link_counted > 1 && +- (inode->i_flags & EXT2_INDEX_FL) && +- link_count == 1 && !(ctx->options & E2F_OPT_NO)) || +- fix_problem(ctx, PR_4_BAD_REF_COUNT, &pctx)) { ++ if (isdir && link_counted > 1 && ++ (inode->i_flags & EXT2_INDEX_FL) && ++ link_count == 1) { ++ if ((ctx->options & E2F_OPT_READONLY) == 0) { ++ fix_nlink = ++ fix_problem(ctx, ++ PR_4_DIR_OVERFLOW_REF_COUNT, ++ &pctx); ++ } ++ } else { ++ fix_nlink = fix_problem(ctx, PR_4_BAD_REF_COUNT, ++ &pctx); ++ } ++ if (fix_nlink) { + inode->i_links_count = link_counted; + e2fsck_write_inode(ctx, i, inode, "pass4"); + } +diff --git a/e2fsck/problem.c b/e2fsck/problem.c +index 0210ff8f..2e41bb2e 100644 +--- a/e2fsck/problem.c ++++ b/e2fsck/problem.c +@@ -1581,6 +1581,11 @@ static struct e2fsck_problem problem_table[] = { + N_("@d exceeds max links, but no DIR_NLINK feature in @S.\n"), + PROMPT_FIX, 0 }, + ++ /* Directory inode ref count set to overflow but could be exact value */ ++ { PR_4_DIR_OVERFLOW_REF_COUNT, ++ N_("@d @i %i ref count set to overflow but could be exact value %N. "), ++ PROMPT_FIX, PR_PREEN_OK, 0, 0, 0 }, ++ + /* Pass 5 errors */ + + /* Pass 5: Checking group summary information */ +diff --git a/e2fsck/problem.h b/e2fsck/problem.h +index 5712de59..a591974e 100644 +--- a/e2fsck/problem.h ++++ b/e2fsck/problem.h +@@ -948,6 +948,9 @@ struct problem_context { + /* Inconsistent inode count information cached */ + #define PR_4_INCONSISTENT_COUNT 0x040004 + ++/* Directory ref count set to overflow but it doesn't have to be */ ++#define PR_4_DIR_OVERFLOW_REF_COUNT 0x040007 ++ + /* + * Pass 5 errors + */ +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.42.9-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch b/SOURCES/e2fsprogs-1.42.9-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch new file mode 100644 index 0000000..e67c80d --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch @@ -0,0 +1,48 @@ +From 16c22d11ac511d6b228db36b62c1567e9578f290 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 19 Dec 2019 19:45:06 -0500 +Subject: [PATCH 2/7] e2fsck: don't try to rehash a deleted directory + +If directory has been deleted in pass1[bcd] processing, then we +shouldn't try to rehash the directory in pass 3a when we try to +rehash/reoptimize directories. + +RHBZ: 1797731 +Signed-off-by: Theodore Ts'o +--- + e2fsck/pass1b.c | 4 ++++ + e2fsck/rehash.c | 3 +++ + 2 files changed, 7 insertions(+) + +diff --git a/e2fsck/pass1b.c b/e2fsck/pass1b.c +index 13bd9e98..0e6c29ef 100644 +--- a/e2fsck/pass1b.c ++++ b/e2fsck/pass1b.c +@@ -643,6 +643,10 @@ static void delete_file(e2fsck_t ctx, ext2_ino_t ino, + fix_problem(ctx, PR_1B_BLOCK_ITERATE, &pctx); + if (ctx->inode_bad_map) + ext2fs_unmark_inode_bitmap2(ctx->inode_bad_map, ino); ++ if (ctx->inode_reg_map) ++ ext2fs_unmark_inode_bitmap2(ctx->inode_reg_map, ino); ++ ext2fs_unmark_inode_bitmap2(ctx->inode_dir_map, ino); ++ ext2fs_unmark_inode_bitmap2(ctx->inode_used_map, ino); + ext2fs_inode_alloc_stats2(fs, ino, -1, LINUX_S_ISDIR(dp->inode.i_mode)); + quota_data_sub(ctx->qctx, &dp->inode, ino, + pb.dup_blocks * fs->blocksize); +diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c +index fbc4e558..6f65edf3 100644 +--- a/e2fsck/rehash.c ++++ b/e2fsck/rehash.c +@@ -882,6 +882,9 @@ void e2fsck_rehash_directories(e2fsck_t ctx) + } + if (ino == ctx->lost_and_found) + continue; ++ if (!ext2fs_test_inode_bitmap2(ctx->inode_dir_map, ino)) ++ continue; ++ + pctx.dir = ino; + if (first) { + fix_problem(ctx, PR_3A_PASS_HEADER, &pctx); +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.42.9-e2image-fix-metadata-image-handling-on-big-endian-sy.patch b/SOURCES/e2fsprogs-1.42.9-e2image-fix-metadata-image-handling-on-big-endian-sy.patch new file mode 100644 index 0000000..e12db40 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-e2image-fix-metadata-image-handling-on-big-endian-sy.patch @@ -0,0 +1,228 @@ +From 8f575d0b2c297f09491093b9e7ba6b914639be71 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Mon, 9 Apr 2018 11:58:15 -0400 +Subject: [PATCH 4/7] e2image: fix metadata image handling on big endian + systems + +Currently e2image metadata image handling and creating is completely +broken on big endian systems. It just does not care about endianness at +all. This was uncovered With addition of i_bitmaps test, which is the +first test that actually tests e2image metadata image. + +Fix it by making sure that all on-disk metadata that we write and read +to/from the metadata image is properly converted. + +RHBZ: 1711880 +Signed-off-by: Lukas Czerner +Signed-off-by: Theodore Ts'o +--- + lib/ext2fs/imager.c | 41 +++++++++++++++++++++++++++++++++++++++++ + lib/ext2fs/inode.c | 2 +- + lib/ext2fs/openfs.c | 4 ++-- + lib/ext2fs/rw_bitmaps.c | 4 ++-- + misc/e2image.c | 22 +++++++++++----------- + 5 files changed, 57 insertions(+), 16 deletions(-) + +diff --git a/lib/ext2fs/imager.c b/lib/ext2fs/imager.c +index b643cc6f..6caca65b 100644 +--- a/lib/ext2fs/imager.c ++++ b/lib/ext2fs/imager.c +@@ -194,6 +194,11 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, + char *buf, *cp; + ssize_t actual; + errcode_t retval; ++#ifdef WORDS_BIGENDIAN ++ unsigned int groups_per_block; ++ struct ext2_group_desc *gdp; ++ int j; ++#endif + + buf = malloc(fs->blocksize); + if (!buf) +@@ -203,7 +208,17 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, + * Write out the superblock + */ + memset(buf, 0, fs->blocksize); ++#ifdef WORDS_BIGENDIAN ++ /* ++ * We're writing out superblock so let's convert ++ * it to little endian and then back if needed ++ */ ++ ext2fs_swap_super(fs->super); + memcpy(buf, fs->super, SUPERBLOCK_SIZE); ++ ext2fs_swap_super(fs->super); ++#else ++ memcpy(buf, fs->super, SUPERBLOCK_SIZE); ++#endif + actual = write(fd, buf, fs->blocksize); + if (actual == -1) { + retval = errno; +@@ -217,8 +232,34 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, + /* + * Now write out the block group descriptors + */ ++ + cp = (char *) fs->group_desc; ++ ++#ifdef WORDS_BIGENDIAN ++ /* ++ * Convert group descriptors to little endian and back ++ * 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); ++ } ++#endif ++ + actual = write(fd, cp, fs->blocksize * fs->desc_blocks); ++ ++ ++#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); ++ } ++#endif ++ + if (actual == -1) { + retval = errno; + goto errout; +diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c +index 573a8fa5..4297ec12 100644 +--- a/lib/ext2fs/inode.c ++++ b/lib/ext2fs/inode.c +@@ -560,7 +560,7 @@ errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, + } + if (fs->flags & EXT2_FLAG_IMAGE_FILE) { + inodes_per_block = fs->blocksize / EXT2_INODE_SIZE(fs->super); +- block_nr = fs->image_header->offset_inode / fs->blocksize; ++ block_nr = ext2fs_le32_to_cpu(fs->image_header->offset_inode) / fs->blocksize; + block_nr += (ino - 1) / inodes_per_block; + offset = ((ino - 1) % inodes_per_block) * + EXT2_INODE_SIZE(fs->super); +diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c +index 200f7815..384dbf0f 100644 +--- a/lib/ext2fs/openfs.c ++++ b/lib/ext2fs/openfs.c +@@ -177,10 +177,10 @@ errcode_t ext2fs_open2(const char *name, const char *io_options, + fs->image_header); + if (retval) + goto cleanup; +- if (fs->image_header->magic_number != EXT2_ET_MAGIC_E2IMAGE) ++ if (ext2fs_le32_to_cpu(fs->image_header->magic_number) != EXT2_ET_MAGIC_E2IMAGE) + return EXT2_ET_MAGIC_E2IMAGE; + superblock = 1; +- block_size = fs->image_header->fs_blocksize; ++ block_size = ext2fs_le32_to_cpu(fs->image_header->fs_blocksize); + } + + /* +diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c +index ad1d8c80..0e7986b0 100644 +--- a/lib/ext2fs/rw_bitmaps.c ++++ b/lib/ext2fs/rw_bitmaps.c +@@ -205,7 +205,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) + ext2fs_free_mem(&buf); + + if (fs->flags & EXT2_FLAG_IMAGE_FILE) { +- blk = (fs->image_header->offset_inodemap / fs->blocksize); ++ blk = (ext2fs_le32_to_cpu(fs->image_header->offset_inodemap) / fs->blocksize); + ino_cnt = fs->super->s_inodes_count; + while (inode_nbytes > 0) { + retval = io_channel_read_blk64(fs->image_io, blk++, +@@ -223,7 +223,7 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) + ino_cnt -= fs->blocksize << 3; + inode_nbytes -= fs->blocksize; + } +- blk = (fs->image_header->offset_blockmap / ++ blk = (ext2fs_le32_to_cpu(fs->image_header->offset_blockmap) / + fs->blocksize); + blk_cnt = EXT2_GROUPS_TO_CLUSTERS(fs->super, + fs->group_desc_count); +diff --git a/misc/e2image.c b/misc/e2image.c +index 98dafa3d..41e54636 100644 +--- a/misc/e2image.c ++++ b/misc/e2image.c +@@ -232,7 +232,7 @@ static void write_image_file(ext2_filsys fs, int fd) + write_header(fd, NULL, sizeof(struct ext2_image_hdr), fs->blocksize); + memset(&hdr, 0, sizeof(struct ext2_image_hdr)); + +- hdr.offset_super = seek_relative(fd, 0); ++ hdr.offset_super = ext2fs_cpu_to_le32(seek_relative(fd, 0)); + retval = ext2fs_image_super_write(fs, fd, 0); + if (retval) { + com_err(program_name, retval, "%s", +@@ -240,7 +240,7 @@ static void write_image_file(ext2_filsys fs, int fd) + exit(1); + } + +- hdr.offset_inode = seek_relative(fd, 0); ++ hdr.offset_inode = ext2fs_cpu_to_le32(seek_relative(fd, 0)); + retval = ext2fs_image_inode_write(fs, fd, + (fd != 1) ? IMAGER_FLAG_SPARSEWRITE : 0); + if (retval) { +@@ -249,7 +249,7 @@ static void write_image_file(ext2_filsys fs, int fd) + exit(1); + } + +- hdr.offset_blockmap = seek_relative(fd, 0); ++ hdr.offset_blockmap = ext2fs_cpu_to_le32(seek_relative(fd, 0)); + retval = ext2fs_image_bitmap_write(fs, fd, 0); + if (retval) { + com_err(program_name, retval, "%s", +@@ -257,7 +257,7 @@ static void write_image_file(ext2_filsys fs, int fd) + exit(1); + } + +- hdr.offset_inodemap = seek_relative(fd, 0); ++ hdr.offset_inodemap = ext2fs_cpu_to_le32(seek_relative(fd, 0)); + retval = ext2fs_image_bitmap_write(fs, fd, IMAGER_FLAG_INODEMAP); + if (retval) { + com_err(program_name, retval, "%s", +@@ -265,23 +265,23 @@ static void write_image_file(ext2_filsys fs, int fd) + exit(1); + } + +- hdr.magic_number = EXT2_ET_MAGIC_E2IMAGE; ++ hdr.magic_number = ext2fs_cpu_to_le32(EXT2_ET_MAGIC_E2IMAGE); + strcpy(hdr.magic_descriptor, "Ext2 Image 1.0"); + gethostname(hdr.fs_hostname, sizeof(hdr.fs_hostname)); + strncpy(hdr.fs_device_name, device_name, sizeof(hdr.fs_device_name)-1); + hdr.fs_device_name[sizeof(hdr.fs_device_name) - 1] = 0; +- hdr.fs_blocksize = fs->blocksize; ++ hdr.fs_blocksize = ext2fs_cpu_to_le32(fs->blocksize); + + if (stat(device_name, &st) == 0) +- hdr.fs_device = st.st_rdev; ++ hdr.fs_device = ext2fs_cpu_to_le32(st.st_rdev); + + if (fstat(fd, &st) == 0) { +- hdr.image_device = st.st_dev; +- hdr.image_inode = st.st_ino; ++ hdr.image_device = ext2fs_cpu_to_le32(st.st_dev); ++ hdr.image_inode = ext2fs_cpu_to_le32(st.st_ino); + } + memcpy(hdr.fs_uuid, fs->super->s_uuid, sizeof(hdr.fs_uuid)); + +- hdr.image_time = time(0); ++ hdr.image_time = ext2fs_cpu_to_le32(time(0)); + write_header(fd, &hdr, sizeof(struct ext2_image_hdr), fs->blocksize); + } + +@@ -1406,7 +1406,7 @@ static void install_image(char *device, char *image_fn, int type) + + ext2fs_rewrite_to_io(fs, io); + +- seek_set(fd, fs->image_header->offset_inode); ++ seek_set(fd, ext2fs_le32_to_cpu(fs->image_header->offset_inode)); + + retval = ext2fs_image_inode_read(fs, fd, 0); + if (retval) { +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.42.9-libsupport-add-checks-to-prevent-buffer-overrun-bugs.patch b/SOURCES/e2fsprogs-1.42.9-libsupport-add-checks-to-prevent-buffer-overrun-bugs.patch new file mode 100644 index 0000000..a843255 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-libsupport-add-checks-to-prevent-buffer-overrun-bugs.patch @@ -0,0 +1,212 @@ +From 94020540808683e648b56c795f1621cc6362054e Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sun, 1 Sep 2019 00:59:16 -0400 +Subject: [PATCH 3/7] libsupport: add checks to prevent buffer overrun bugs in + quota code + +A maliciously corrupted file systems can trigger buffer overruns in +the quota code used by e2fsck. To fix this, add sanity checks to the +quota header fields as well as to block number references in the quota +tree. + +RHBZ: 1768710 +Addresses: CVE-2019-5094 +Addresses: TALOS-2019-0887 +Signed-off-by: Theodore Ts'o +--- + lib/quota/mkquota.c | 1 + + lib/quota/quotaio_tree.c | 70 +++++++++++++++++++++++++++------------- + lib/quota/quotaio_v2.c | 28 ++++++++++++++++ + 3 files changed, 76 insertions(+), 23 deletions(-) + +diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c +index 3aa81003..f1fc64a0 100644 +--- a/lib/quota/mkquota.c ++++ b/lib/quota/mkquota.c +@@ -552,6 +552,7 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype, + err = qh.qh_ops->scan_dquots(&qh, scan_dquots_callback, &scan_data); + if (err) { + log_err("Error scanning dquots"); ++ *usage_inconsistent = 1; + goto out; + } + *usage_inconsistent = scan_data.usage_is_inconsistent; +diff --git a/lib/quota/quotaio_tree.c b/lib/quota/quotaio_tree.c +index c1653a39..2579450e 100644 +--- a/lib/quota/quotaio_tree.c ++++ b/lib/quota/quotaio_tree.c +@@ -534,6 +534,17 @@ struct dquot *qtree_read_dquot(struct quota_handle *h, qid_t id) + return dquot; + } + ++static int check_reference(struct quota_handle *h, unsigned int blk) ++{ ++ if (blk >= h->qh_info.u.v2_mdqi.dqi_qtree.dqi_blocks) { ++ log_err("Illegal reference (%u >= %u) in %s quota file", ++ blk, h->qh_info.u.v2_mdqi.dqi_qtree.dqi_blocks, ++ type2name(h->qh_type)); ++ return -1; ++ } ++ return 0; ++} ++ + /* + * Scan all dquots in file and call callback on each + */ +@@ -552,7 +563,7 @@ static int report_block(struct dquot *dquot, uint blk, char *bitmap, + int entries, i; + + if (!buf) +- return 0; ++ return -1; + + set_bit(bitmap, blk); + read_blk(dquot->dq_h, blk, buf); +@@ -574,22 +585,12 @@ static int report_block(struct dquot *dquot, uint blk, char *bitmap, + return entries; + } + +-static void check_reference(struct quota_handle *h, uint blk) +-{ +- if (blk >= h->qh_info.u.v2_mdqi.dqi_qtree.dqi_blocks) +- log_err("Illegal reference (%u >= %u) in %s quota file. " +- "Quota file is probably corrupted.\n" +- "Please run e2fsck (8) to fix it.", +- blk, +- h->qh_info.u.v2_mdqi.dqi_qtree.dqi_blocks, +- type2name(h->qh_type)); +-} + + static int report_tree(struct dquot *dquot, uint blk, int depth, char *bitmap, + int (*process_dquot) (struct dquot *, void *), + void *data) + { +- int entries = 0, i; ++ int entries = 0, ret, i; + dqbuf_t buf = getdqbuf(); + u_int32_t *ref = (u_int32_t *) buf; + +@@ -600,22 +601,40 @@ static int report_tree(struct dquot *dquot, uint blk, int depth, char *bitmap, + if (depth == QT_TREEDEPTH - 1) { + for (i = 0; i < QT_BLKSIZE >> 2; i++) { + blk = ext2fs_le32_to_cpu(ref[i]); +- check_reference(dquot->dq_h, blk); +- if (blk && !get_bit(bitmap, blk)) +- entries += report_block(dquot, blk, bitmap, +- process_dquot, data); ++ if (check_reference(dquot->dq_h, blk)) { ++ entries = -1; ++ goto errout; ++ } ++ if (blk && !get_bit(bitmap, blk)) { ++ ret = report_block(dquot, blk, bitmap, ++ process_dquot, data); ++ if (ret < 0) { ++ entries = ret; ++ goto errout; ++ } ++ entries += ret; ++ } + } + } else { + for (i = 0; i < QT_BLKSIZE >> 2; i++) { + blk = ext2fs_le32_to_cpu(ref[i]); + if (blk) { +- check_reference(dquot->dq_h, blk); +- entries += report_tree(dquot, blk, depth + 1, +- bitmap, process_dquot, +- data); ++ if (check_reference(dquot->dq_h, blk)) { ++ entries = -1; ++ goto errout; ++ } ++ ret = report_tree(dquot, blk, depth + 1, ++ bitmap, process_dquot, ++ data); ++ if (ret < 0) { ++ entries = ret; ++ goto errout; ++ } ++ entries += ret; + } + } + } ++errout: + freedqbuf(buf); + return entries; + } +@@ -634,6 +653,7 @@ int qtree_scan_dquots(struct quota_handle *h, + int (*process_dquot) (struct dquot *, void *), + void *data) + { ++ int ret; + char *bitmap; + struct v2_mem_dqinfo *v2info = &h->qh_info.u.v2_mdqi; + struct qtree_mem_dqinfo *info = &v2info->dqi_qtree; +@@ -647,10 +667,14 @@ int qtree_scan_dquots(struct quota_handle *h, + ext2fs_free_mem(&dquot); + return -1; + } +- v2info->dqi_used_entries = report_tree(dquot, QT_TREEOFF, 0, bitmap, +- process_dquot, data); ++ ret = report_tree(dquot, QT_TREEOFF, 0, bitmap, process_dquot, data); ++ if (ret < 0) ++ goto errout; ++ v2info->dqi_used_entries = ret; + v2info->dqi_data_blocks = find_set_bits(bitmap, info->dqi_blocks); ++ ret = 0; ++errout: + ext2fs_free_mem(&bitmap); + ext2fs_free_mem(&dquot); +- return 0; ++ return ret; + } +diff --git a/lib/quota/quotaio_v2.c b/lib/quota/quotaio_v2.c +index e7bf29c3..8957d487 100644 +--- a/lib/quota/quotaio_v2.c ++++ b/lib/quota/quotaio_v2.c +@@ -174,6 +174,8 @@ static int v2_check_file(struct quota_handle *h, int type, int fmt) + static int v2_init_io(struct quota_handle *h) + { + struct v2_disk_dqinfo ddqinfo; ++ struct v2_mem_dqinfo *info; ++ __u64 filesize; + + h->qh_info.u.v2_mdqi.dqi_qtree.dqi_entry_size = + sizeof(struct v2r1_disk_dqblk); +@@ -184,6 +186,32 @@ static int v2_init_io(struct quota_handle *h) + sizeof(ddqinfo)) != sizeof(ddqinfo)) + return -1; + v2_disk2memdqinfo(&h->qh_info, &ddqinfo); ++ ++ /* Check to make sure quota file info is sane */ ++ info = &h->qh_info.u.v2_mdqi; ++ if (ext2fs_file_get_lsize(h->qh_qf.e2_file, &filesize)) ++ return -1; ++ if ((filesize > (1U << 31)) || ++ (info->dqi_qtree.dqi_blocks > ++ (filesize + QT_BLKSIZE - 1) >> QT_BLKSIZE_BITS)) { ++ log_err("Quota inode %u corrupted: file size %llu; " ++ "dqi_blocks %u", h->qh_qf.ino, ++ filesize, info->dqi_qtree.dqi_blocks); ++ return -1; ++ } ++ if (info->dqi_qtree.dqi_free_blk >= info->dqi_qtree.dqi_blocks) { ++ log_err("Quota inode %u corrupted: free_blk %u; dqi_blocks %u", ++ h->qh_qf.ino, info->dqi_qtree.dqi_free_blk, ++ info->dqi_qtree.dqi_blocks); ++ return -1; ++ } ++ if (info->dqi_qtree.dqi_free_entry >= info->dqi_qtree.dqi_blocks) { ++ log_err("Quota inode %u corrupted: free_entry %u; " ++ "dqi_blocks %u", h->qh_qf.ino, ++ info->dqi_qtree.dqi_free_entry, ++ info->dqi_qtree.dqi_blocks); ++ return -1; ++ } + return 0; + } + +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.42.9-mke2fs.conf-Introduce-rhel6-fs_type.patch b/SOURCES/e2fsprogs-1.42.9-mke2fs.conf-Introduce-rhel6-fs_type.patch new file mode 100644 index 0000000..1d80f41 --- /dev/null +++ b/SOURCES/e2fsprogs-1.42.9-mke2fs.conf-Introduce-rhel6-fs_type.patch @@ -0,0 +1,31 @@ +From d01edcbdb6e151d425ecb1631e10a207e54e1fe5 Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Mon, 4 May 2020 14:44:49 +0200 +Subject: [PATCH 6/7] mke2fs.conf: Introduce rhel6 fs_type + +RHBZ: 1780277 +Signed-off-by: Lukas Czerner +--- + misc/mke2fs.conf.in | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in +index 667800c8..e074fd58 100644 +--- a/misc/mke2fs.conf.in ++++ b/misc/mke2fs.conf.in +@@ -19,6 +19,12 @@ + inode_size = 256 + options = test_fs=1 + } ++ 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 = "" ++ } + small = { + blocksize = 1024 + inode_size = 128 +-- +2.21.1 + diff --git a/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-file-systems-with-an-overly-large-s_first.patch b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-file-systems-with-an-overly-large-s_first.patch new file mode 100644 index 0000000..6637b46 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-e2fsck-fix-file-systems-with-an-overly-large-s_first.patch @@ -0,0 +1,69 @@ +From 06b155bff995fe13d68cc2829121d0d719e6fde7 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 9 Aug 2014 12:31:04 -0400 +Subject: [PATCH 1/5] e2fsck: fix file systems with an overly large + s_first_meta_bg + +Signed-off-by: Theodore Ts'o +--- + e2fsck/problem.c | 5 +++++ + e2fsck/problem.h | 3 +++ + e2fsck/super.c | 12 ++++++++++++ + 3 files changed, 20 insertions(+) + +diff --git a/e2fsck/problem.c b/e2fsck/problem.c +index 2e41bb2e..6c7f514e 100644 +--- a/e2fsck/problem.c ++++ b/e2fsck/problem.c +@@ -438,6 +438,11 @@ static struct e2fsck_problem problem_table[] = { + N_("@S 64bit filesystems needs extents to access the whole disk. "), + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK}, + ++ /* The first_meta_bg is too big */ ++ { PR_0_FIRST_META_BG_TOO_BIG, ++ N_("First_meta_bg is too big. (%N, max value %g). "), ++ PROMPT_CLEAR, 0 }, ++ + /* Meta_bg and resize_inode are not compatible, disable resize_inode*/ + { PR_0_DISABLE_RESIZE_INODE, + N_("Resize_@i and meta_bg features are enabled. Those features are\n" +diff --git a/e2fsck/problem.h b/e2fsck/problem.h +index a591974e..2fc9be05 100644 +--- a/e2fsck/problem.h ++++ b/e2fsck/problem.h +@@ -252,6 +252,9 @@ struct problem_context { + /* 64bit is set but extents are not set. */ + #define PR_0_64BIT_WITHOUT_EXTENTS 0x000048 + ++/* The first_meta_bg is too big */ ++#define PR_0_FIRST_META_BG_TOO_BIG 0x000049 ++ + /* Meta_bg and resize_inode are not compatible, remove resize_inode*/ + #define PR_0_DISABLE_RESIZE_INODE 0x000051 + +diff --git a/e2fsck/super.c b/e2fsck/super.c +index 7e2c2e4f..7439d9d4 100644 +--- a/e2fsck/super.c ++++ b/e2fsck/super.c +@@ -599,6 +599,18 @@ void check_super_block(e2fsck_t ctx) + ext2fs_mark_super_dirty(fs); + } + ++ if ((fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) && ++ (fs->super->s_first_meta_bg > fs->desc_blocks)) { ++ pctx.group = fs->desc_blocks; ++ pctx.num = fs->super->s_first_meta_bg; ++ if (fix_problem(ctx, PR_0_FIRST_META_BG_TOO_BIG, &pctx)) { ++ fs->super->s_feature_incompat &= ++ ~EXT2_FEATURE_INCOMPAT_META_BG; ++ fs->super->s_first_meta_bg = 0; ++ ext2fs_mark_super_dirty(fs); ++ } ++ } ++ + /* + * Verify the group descriptors.... + */ +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-resize2fs-disable-the-meta_bg-feature-if-necessary.patch b/SOURCES/e2fsprogs-1.45.6-resize2fs-disable-the-meta_bg-feature-if-necessary.patch new file mode 100644 index 0000000..01b84df --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-resize2fs-disable-the-meta_bg-feature-if-necessary.patch @@ -0,0 +1,60 @@ +From 92bd5b69d7e7096fffc8cab08cc6886fe22df77d Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 9 Aug 2014 12:33:11 -0400 +Subject: [PATCH 2/5] resize2fs: disable the meta_bg feature if necessary + +When shrinking a file system, if the number block groups drops below +the point where we started using the meta_bg layout, disable the +meta_bg feature and set s_first_meta_bg to zero. This is necessary to +avoid creating an invalid/corrupted file system after the shrink. + +Addresses-Debian-Bug: #756922 + +Signed-off-by: Theodore Ts'o +Reported-by: Marcin Wolcendorf +Tested-by: Marcin Wolcendorf +--- + resize/resize2fs.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/resize/resize2fs.c b/resize/resize2fs.c +index a73390de..a2ff29ad 100644 +--- a/resize/resize2fs.c ++++ b/resize/resize2fs.c +@@ -461,6 +461,13 @@ retry: + fs->super->s_reserved_gdt_blocks = new; + } + ++ if ((fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) && ++ (fs->super->s_first_meta_bg > fs->desc_blocks)) { ++ fs->super->s_feature_incompat &= ++ ~EXT2_FEATURE_INCOMPAT_META_BG; ++ fs->super->s_first_meta_bg = 0; ++ } ++ + /* + * If we are shrinking the number of block groups, we're done + * and can exit now. +@@ -946,13 +953,15 @@ static errcode_t blocks_to_move(ext2_resize_t rfs) + ext2fs_mark_block_bitmap2(rfs->reserve_blocks, blk); + } + +- if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) { ++ if (old_fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) + old_blocks = old_fs->super->s_first_meta_bg; ++ else ++ old_blocks = old_fs->desc_blocks + ++ old_fs->super->s_reserved_gdt_blocks; ++ if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) + new_blocks = fs->super->s_first_meta_bg; +- } else { +- old_blocks = old_fs->desc_blocks + old_fs->super->s_reserved_gdt_blocks; ++ else + new_blocks = fs->desc_blocks + fs->super->s_reserved_gdt_blocks; +- } + + if (old_blocks == new_blocks) { + retval = 0; +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-tests-add-f_first_meta_bg_too_big-test.patch b/SOURCES/e2fsprogs-1.45.6-tests-add-f_first_meta_bg_too_big-test.patch new file mode 100644 index 0000000..0fd2c82 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-tests-add-f_first_meta_bg_too_big-test.patch @@ -0,0 +1,69 @@ +From 821c525c50d0fd704a3f189d8bdab2b97b65d887 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 9 Aug 2014 13:03:43 -0400 +Subject: [PATCH] tests: add f_first_meta_bg_too_big test + +The test verifies that e2fsck can properly fix a file system where the +value of s_first_meta_bg in the superblock is larger than the number +of block group descriptors in the file system. E2fsck will fix this +by clearing the meta_bg feature. + +Signed-off-by: Theodore Ts'o +--- + tests/f_first_meta_bg_too_big/expect.1 | 20 ++++++++++++++++++++ + tests/f_first_meta_bg_too_big/expect.2 | 7 +++++++ + tests/f_first_meta_bg_too_big/name | 1 + + 3 files changed, 28 insertions(+) + create mode 100644 tests/f_first_meta_bg_too_big/expect.1 + create mode 100644 tests/f_first_meta_bg_too_big/expect.2 + create mode 100644 tests/f_first_meta_bg_too_big/name + +diff --git a/tests/f_first_meta_bg_too_big/expect.1 b/tests/f_first_meta_bg_too_big/expect.1 +new file mode 100644 +index 00000000..85786bda +--- /dev/null ++++ b/tests/f_first_meta_bg_too_big/expect.1 +@@ -0,0 +1,20 @@ ++First_meta_bg is too big. (2, max value 1). Clear? yes ++ ++Pass 1: Checking inodes, blocks, and sizes ++Pass 2: Checking directory structure ++Pass 3: Checking directory connectivity ++Pass 4: Checking reference counts ++Pass 5: Checking group summary information ++Block bitmap differences: -3 ++Fix? yes ++ ++Free blocks count wrong for group #0 (79, counted=80). ++Fix? yes ++ ++Free blocks count wrong (79, counted=80). ++Fix? yes ++ ++ ++test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** ++test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks ++Exit status is 1 +diff --git a/tests/f_first_meta_bg_too_big/expect.2 b/tests/f_first_meta_bg_too_big/expect.2 +new file mode 100644 +index 00000000..44bff624 +--- /dev/null ++++ b/tests/f_first_meta_bg_too_big/expect.2 +@@ -0,0 +1,7 @@ ++Pass 1: Checking inodes, blocks, and sizes ++Pass 2: Checking directory structure ++Pass 3: Checking directory connectivity ++Pass 4: Checking reference counts ++Pass 5: Checking group summary information ++test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks ++Exit status is 0 +diff --git a/tests/f_first_meta_bg_too_big/name b/tests/f_first_meta_bg_too_big/name +new file mode 100644 +index 00000000..47ec96db +--- /dev/null ++++ b/tests/f_first_meta_bg_too_big/name +@@ -0,0 +1 @@ ++s_first_meta_bg is too large +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-tests-add-the-r_meta_bg_shrink-test.patch b/SOURCES/e2fsprogs-1.45.6-tests-add-the-r_meta_bg_shrink-test.patch new file mode 100644 index 0000000..a801472 --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-tests-add-the-r_meta_bg_shrink-test.patch @@ -0,0 +1,59 @@ +From c4e61a30629918fded02c728a2000d195db7ebe6 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 9 Aug 2014 13:05:21 -0400 +Subject: [PATCH 5/5] tests: add the r_meta_bg_shrink test + +This test checks to make sure resize2fs can properly handle a file +system which started life as a normal ext4 file system and then was +grown to a size where meta_bg was enabled, and then shrunk back below +the point where the meta_bg format is still needed. + +Signed-off-by: Theodore Ts'o +--- + tests/r_meta_bg_shrink/script | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + create mode 100644 tests/r_meta_bg_shrink/script + +diff --git a/tests/r_meta_bg_shrink/script b/tests/r_meta_bg_shrink/script +new file mode 100644 +index 00000000..de777775 +--- /dev/null ++++ b/tests/r_meta_bg_shrink/script +@@ -0,0 +1,34 @@ ++if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then ++ ++test_description="meta_bg shrink" ++FEATURES="-t ext4 -O 64bit,meta_bg,^resize_inode -b 1024" ++SIZE_1=1G ++SIZE_2=48M ++LOG=$test_name.log ++E2FSCK=../e2fsck/e2fsck ++RESIZE2FS_OPTS=-f ++ ++. $cmd_dir/scripts/resize_test ++ ++export MKE2FS_FIRST_META_BG=2 ++resize_test ++unset MKE2FS_FIRST_META_BG ++ ++RC=$? ++if [ $RC -eq 0 ]; then ++ echo "$test_name: $test_description: ok" ++ touch $test_name.ok ++elif [ $RC -eq 111 ]; then ++ echo "$test_name: $test_description: skipped" ++ touch $test_name.ok ++else ++ echo "$test_name: $test_description: failed" ++ ln $LOG $test_name.failed ++fi ++ ++unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK ++ ++else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then ++ echo "$test_name: $test_description: skipped" ++fi ++ +-- +2.21.3 + diff --git a/SOURCES/e2fsprogs-1.45.6-tests-make-sure-MKE2FS_FIRST_META_BG-is-unset-while-.patch b/SOURCES/e2fsprogs-1.45.6-tests-make-sure-MKE2FS_FIRST_META_BG-is-unset-while-.patch new file mode 100644 index 0000000..9619aaa --- /dev/null +++ b/SOURCES/e2fsprogs-1.45.6-tests-make-sure-MKE2FS_FIRST_META_BG-is-unset-while-.patch @@ -0,0 +1,29 @@ +From 00b5f688f0d5df5913ea25e3481946c8191d826d Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Sat, 9 Aug 2014 13:02:36 -0400 +Subject: [PATCH 3/5] tests: make sure MKE2FS_FIRST_META_BG is unset while + running tests + +If the developer has set the MKE2FS_FIRST_META_BG environment +variable, this can cause test failures. + +Signed-off-by: Theodore Ts'o +--- + tests/test_config | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/test_config b/tests/test_config +index 67896562..1872e5c8 100644 +--- a/tests/test_config ++++ b/tests/test_config +@@ -32,6 +32,7 @@ E2FSCK_CONFIG=/dev/null + export E2FSCK_CONFIG + MKE2FS_CONFIG=./mke2fs.conf + export MKE2FS_CONFIG ++unset MKE2FS_FIRST_META_BG + E2FSPROGS_SKIP_PROGRESS=yes + export E2FSPROGS_SKIP_PROGRESS + EXT2FS_NO_MTAB_OK=yes +-- +2.21.3 + diff --git a/SPECS/e2fsprogs.spec b/SPECS/e2fsprogs.spec index ed62e2e..4b1428c 100644 --- a/SPECS/e2fsprogs.spec +++ b/SPECS/e2fsprogs.spec @@ -1,7 +1,7 @@ Summary: Utilities for managing ext2, ext3, and ext4 filesystems Name: e2fsprogs Version: 1.42.9 -Release: 17%{?dist} +Release: 19%{?dist} # License tags based on COPYING file distinctions for various components License: GPLv2 @@ -9,6 +9,8 @@ Group: System Environment/Base Source0: https://www.kernel.org/pub/linux/kernel/people/tytso/%{name}/v%{version}/%{name}-%{version}.tar.xz Source1: ext2_types-wrapper.h Source2: e2fsck.conf +# Test image for f_first_meta_bg_too_big test +Source3: image.gz Patch1: e2fsprogs-1.40.4-sb_feature_check_ignore.patch Patch2: e2fsprogs-1.42.9-set-pointer-to-NULL-after-ext2fs_free.patch @@ -60,6 +62,18 @@ Patch47: e2fsprogs-1.42.9-14-Clarify-how-the-description-of-the-dir_nlink-featur Patch48: e2fsprogs-1.42.9-14-e2fsck-set-dir_nlink-feature-if-large-dir-exists.patch Patch49: e2fsprogs-1.42.11-e2fsck-free-ctx-fs-not-fs-at-the-end-of-fsck.patch Patch50: e2fsprogs-1.42.9-resize2fs-fix-resizing-large-file-systems-when-block.patch +Patch51: e2fsprogs-1.42.9-e2fsck-abort-if-there-is-a-corrupted-directory-block.patch +Patch52: e2fsprogs-1.42.9-e2fsck-don-t-try-to-rehash-a-deleted-directory.patch +Patch53: e2fsprogs-1.42.9-libsupport-add-checks-to-prevent-buffer-overrun-bugs.patch +Patch54: e2fsprogs-1.42.9-e2image-fix-metadata-image-handling-on-big-endian-sy.patch +Patch55: e2fsprogs-1.42.9-Fix-typo-in-the-ext4-5-man-page.patch +Patch56: e2fsprogs-1.42.9-mke2fs.conf-Introduce-rhel6-fs_type.patch +Patch57: e2fsprogs-1.42.9-e2fsck-clarify-overflow-link-count-error-message.patch +Patch58: e2fsprogs-1.45.6-e2fsck-fix-file-systems-with-an-overly-large-s_first.patch +Patch59: e2fsprogs-1.45.6-resize2fs-disable-the-meta_bg-feature-if-necessary.patch +Patch60: e2fsprogs-1.45.6-tests-make-sure-MKE2FS_FIRST_META_BG-is-unset-while-.patch +Patch61: e2fsprogs-1.45.6-tests-add-f_first_meta_bg_too_big-test.patch +Patch62: e2fsprogs-1.45.6-tests-add-the-r_meta_bg_shrink-test.patch Url: http://e2fsprogs.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -259,11 +273,24 @@ It was originally inspired by the Multics SubSystem library. %patch48 -p1 %patch49 -p1 %patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +%patch60 -p1 +%patch61 -p1 +%patch62 -p1 %build %configure --enable-elf-shlibs --enable-nls --disable-uuidd --disable-fsck \ --disable-e2initrd-helper --disable-libblkid --disable-libuuid \ --with-root-prefix=/usr + # Disable some instructions on ppc build of libext2fs; see bug #1074604 # and e2fsprogs-1.42.9-no-ppc-altivec.patch %ifarch ppc @@ -305,6 +332,8 @@ rm -rf tests/r_ext4_small_bg # but either this test or the build environment. Anyway it's # blocking release of a hotfix so let's remove it for now. rm -rf tests/f_mmp +# Copy the image.gz for the f_first_meta_bg_too_big test to it's place +cp --force %{SOURCE3} tests/f_first_meta_bg_too_big/image.gz make check %clean @@ -451,6 +480,17 @@ exit 0 %{_libdir}/pkgconfig/ss.pc %changelog +* Tue Jul 07 2020 Lukas Czerner 1.45.6-19 +- fix issues with meta_bg when resizing file system (#1849718) + +* Wed May 06 2020 Lukas Czerner 1.42.9-18 +- fix out-of-bounds write on corrupted fs (#1797731) +- fix out-of-bounds write on corrupted fs (#1768710) +- fix e2fsprogs creating corrupted meta image (#1711880) +- fix typo in ext4 man page (#1720130) +- provide easy metod for creating compatible rhel6 fs (#1780277) +- better handling of trivial dir link count problem (#1820048) + * Mon Nov 18 2019 Lukas Czerner 1.42.9-17 - fix resizing large file systems when block size != page size (#1771515)