Commit Graph

6240 Commits

Author SHA1 Message Date
Theodore Ts'o
e042d2a593 debian: update changelog for 1.44.5-1+dub10u3 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2020-01-09 22:27:49 -05:00
Theodore Ts'o
7940cfe1b3 Update debian/patches 2020-01-09 14:42:28 -05:00
Wang Shilong
f3689a5d46 e2fsck: fix use after free in calculate_tree()
The problem is alloc_blocks() will call get_next_block() which might
reallocate outdir->buf, and memory address could be changed after
this.  To fix this, pointers that point into outdir->buf, such as
int_limit and root need to be recaulated based on the new starting
address of outdir->buf.

[ Changed to correctly recalculate int_limit, and to optimize how we
  reallocate outdir->buf.  -TYT ]

Addresses-Debian-Bug: 948517
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 101e73e99c)
2020-01-09 14:21:46 -05:00
Theodore Ts'o
3c23017d9f 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.

Addresses-Debian-Bug: 948508
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 71ba137553)
2020-01-09 14:19:58 -05:00
Theodore Ts'o
3d0a5b1c88 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.

Addresses-Debian-Bug: 948508
Addresses: TALOS-2019-0973
Addresses: CVE-2019-5188
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 8dd73c149f)
2020-01-09 14:18:37 -05:00
Theodore Ts'o
06a9388053 debian: update changelog for 1.44.5-1+deb10u2
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-25 13:45:45 -04:00
Theodore Ts'o
8d71898d5b Commit Debian 3.0 (quilt) metadata
[dgit (9.9) quilt-fixup]
2019-09-25 13:40:46 -04:00
Theodore Ts'o
09fe1fd2a1 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.

Addresses: CVE-2019-5094
Addresses: TALOS-2019-0887
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit 8dbe7b475e)
2019-09-25 13:32:19 -04:00
Theodore Y. Ts'o
6e1098f996 Declare fast forward from 1.44.5-1
[dgit --overwrite]
2019-08-02 23:49:00 -04:00
Theodore Ts'o
bf9e7043be debian: update changelog for 1.44.5-1+deb10u1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-03 13:13:43 -04:00
Theodore Ts'o
f8dcdd3dd8 Commit Debian 3.0 (quilt) metadata
[dgit (9.3) quilt-fixup]
2019-08-03 00:11:37 -04:00
Theodore Ts'o
96bee300e2 debian: don't gitignore debian/patches
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-03 00:11:15 -04:00
Theodore Ts'o
622e629421 Revert "e4defrag: use 64-bit counters to track # files defragged"
This reverts commit 3293ea9ecb.

This wasn't really the right fix, since there can't be more than 2**32
files in a file system.  The real issue is when the number of files in
a directory change during the e4defrag run.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-03 00:11:15 -04:00
Theodore Ts'o
abc7922741 debian: update gbp.conf file for stable build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-03 00:11:15 -04:00
Theodore Ts'o
6ad207b1f2 Add files that were accidentally included in the 1.44.5 tarfile
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-03 00:11:15 -04:00
Theodore Ts'o
346a9922a2 Remove debian patches for v1.44.4 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-16 00:54:28 -05:00
Theodore Ts'o
9897e1aa1a v1.44.5
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEK2m5VNv+CHkogTfJ8vlZVpUNgaMFAlwV5TEACgkQ8vlZVpUN
 gaM9zwf/WmX1onxeWBtKDCN8UMlQLoIAuOuLZjSaIV2DcB3qIcvoY2EGN5/B4Da/
 Vcs++vDsp55BQm4ppkfElg0iIADFrmVmZld4zyuXpCV6t6dPEfaVhyKlr5KkhZES
 H/globz6nwoChIbJlzX69AuMDX6x59/C5sO85VPwreCmROIEvXrZy8mpI6RzirP7
 RWzarQ1FrFRPLFBwVYnCQsEayqV/GcqOYvsozZYNS1YwLArzcROaeqqcq6sUHdCS
 ZEL2+QTV5uZ2Qt5qDxi4tXi/DHDJJpEaQdqFlBFUvHgo1mjcfbBztq+C+4mYuyDa
 DxKYJfVpftRqRgWsYYickkUaoeeNvw==
 =M/zX
 -----END PGP SIGNATURE-----

Merge tag 'v1.44.5' into debian/master

v1.44.5
2018-12-16 00:52:33 -05:00
Theodore Ts'o
9a03c07e00 Update release notes, etc., for the 1.44.5 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-16 00:39:33 -05:00
Theodore Ts'o
b2ccbc0456 debian: create changelog for v1.44.5
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-16 00:39:26 -05:00
Theodore Ts'o
4bbb5a6336 debian: fix up libext2fs-dev.doc-base
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-15 23:32:48 -05:00
Mark Salyzyn
48f138da1d AOSP: ODR violation in tune2fs during host build
Port of commit 3271c69c97f486914fea833a36eaf5d86938c76d as applied to
e2fsck, but to tune2fs.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Bug: 112062612
Bug: 111302946
Test: $ m SANITIZE_HOST=address out/host/linux-x86/bin/tune2fs
      $ out/host/linux-x86/bin/tune2fs --help
Change-Id: If49d367d96b7bfd0b8b79c6bde23c0ded52ca683
From AOSP commit: 1cb5de330e5d1e0c6f587945ec065b995cc1c84b
2018-12-15 23:32:48 -05:00
Theodore Y. Ts'o
fe4ab18563 e2fsprogs (1.44.5-1) unstable; urgency=medium
* New upstream version
  * Avoid overflows when tracking the number of files defragged
    by e4defrag (Closes: #888899)
  * Fix groff formatting nits in various man pages (Closes: #916188)
  * Fix location of libext2fs documentation (Closes: #915942)
  * Fix regression so we are correctly translating Posix ACL's
    in libext2fs
  * Use the online free block counts so e2freefrag's percentages
    are correct
  * Fix a false warning that tune2fs will take long time to change
    a UUID if the metadata_csum feature is not enabled
  * Fix mk_cmds so it works on a usrmerge system when e2fsprogs is built
    on a non-usrmerge system (Closes: #914087)
  * E2fsck will avoid offering to set the inline_data feature flag
    unnecessarily
  * E4defrag will handle the case where it is running as root and it can't
    find the file system to open more gracefully (Closes: #907634)
  * Fix a bug where resize2fs was failing to update the extent tree
    checksums in an corner case
  * Fix fuse2fs's command line parsing when options are specified after
    the target device/image
  * Fix a bug which could cause e2fsprogs tools to segfault on a corrupted
    file system where the journal's s_nr_users is impossibly large.
  * E2image now includes the mmp block (if needed) when creating a
    metadata-only image.
  * When e2fsck notices it could optimize an extent tree, it will now ask
    "Optimize?" instead of "Fix?", which was confusing some users since it
    implied that something was broken.

[dgit import unpatched e2fsprogs 1.44.5-1]
2018-12-15 22:46:49 -05:00
Theodore Y. Ts'o
a9247612d8 Import e2fsprogs_1.44.5.orig.tar.gz
[dgit import orig e2fsprogs_1.44.5.orig.tar.gz]
2018-12-15 22:46:49 -05:00
Theodore Y. Ts'o
3fd37ab99d Import e2fsprogs_1.44.5-1.debian.tar.xz
[dgit import tarball e2fsprogs 1.44.5-1 e2fsprogs_1.44.5-1.debian.tar.xz]
2018-12-15 22:46:49 -05:00
Theodore Ts'o
ce75cf5459 e2fsck: use "Optimize?" prompt for PR_1E_CAN_{COLLAPSE,NARROW}_EXTENT_TREE
If e2fsck can optimize an inode's extent tree, it should ask for
permission to optimize it, not to "fix" it.  This was causing some
confusion, since some users interpreted this prompt as an indication
that the file system was inconsistent.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-15 22:37:53 -05:00
Theodore Ts'o
26769abf80 debian: update to Debian policy 4.2.1
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-15 12:05:16 -05:00
Theodore Ts'o
3293ea9ecb e4defrag: use 64-bit counters to track # files defragged
Addresses-Debian-Bug: 888899

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-15 10:08:42 -05:00
Bjarni Ingi Gislason
6a9c8e0b96 misc: fix groff formatting nits in man pages
Change a two-fonts macro to a one-font one, when there is only one
genuine argument.

Separate a punctuation mark or a section number from the only argument
to make two for a two-fonts macro.

Remove an unneeded escape in front of a horizontal tab character.

Correct the unit for distance from 'in' to 'i'.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-11 22:31:14 -05:00
Theodore Ts'o
de7d247a4a debian: fix location of libext2fs documentation
Addresses-Debian-Bug: #915942
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-11 22:20:52 -05:00
Theodore Ts'o
5fafc78359 libext2fs: fix regression so we are correctly translating Posix ACL's
The commit 50d0998cfe ("libext2fs: add ea_inode support to set
xattr") broke the fix that was addressed in commit 0ee1eaf70c
("libext2fs: translate internal ext4 acl to Posix ACL in
ext2fs_xattr_[sg]et()").  This was because although we calculated what
the correct on-disk ACL representation would be, we didn't actually
*store* it, but instead stored the passed-in Posix ACL memory
representation instead.

Addresses-Launchpad-Bug: #1807288
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-12-06 22:44:45 -05:00
Darrick J. Wong
93accdce51 e2freefrag: fix free blocks count during live scan
In e2freefrag live scan mode, we take the free block count from the
ondisk superblock.  This leads to screwy histogram percentages:

Extent Size Range :  Free extents   Free Blocks  Percent
    4M...    8M-  :             5          8234    1.05%
   64M...  128M-  :             2         52279    6.64%
  512M... 1024M-  :             1        202752   25.74%

...because there could be superblock updates in the journal that haven't
yet been checkpointed.  The online scan is perfectly capable of tallying
the free blocks on its own, so teach it do that and make a more accurate
report.

Reported-by: Elana Hashman <Elana.Hashman@twosigma.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-11-25 21:46:36 -05:00
Theodore Ts'o
0eeb17d061 tune2fs: fix false warning that a UUID change will take a long time
If the file system only has the flex_bg feature enabled (with out the
metadata_csum feature enabled), it won't take a long time time fix up
the checksums after changing the UUID.  While it does need to
recalculate all of the checksums in the block group descriptors, that
doesn't take a long time.

Also, if the ea_data feature is enabled, changing the UUID will also
take a long time, and we weren't warning the user about that case.

Fix up the warning message so it doesn't mislead people, and is more
accurate.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-11-23 22:47:08 -05:00
Theodore Ts'o
b7bb80dc70 mk_cmds: don't use explicit pathname for sed
$AWK doesn't use an explicit pathname, and it's perfectly fine to
assume that awk and sed are in the user's PATH.  The problem with
using an explicit pathname is that Debian currently allows merged and
non-merged /usr.  Avoid using an explicit pathname to prevent
potential problems.

Addresses-Debian-Bug: #914087
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-11-22 18:01:56 -05:00
Li Dongyang
4a11f49957 e2fsck: check xattr 'system.data' before setting inline_data feature
ext2fs_inline_data_size will happy return 0 and set size to
EXT4_MIN_INLINE_DATA_SIZE even when inode doesn't have
xattr 'system.data', a corrupted i_flags could make e2fsck
enable the inline_data on the superblock.

We should only offer to enable inline_data when i_flags is set
and xattr 'system.data' can be found.

Also use correct prompt for PR_1_INLINE_DATA_FEATURE.

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
2018-11-15 13:02:34 -05:00
Theodore Ts'o
1dc6d6e33a e4defrag: handle failure to open the file system gracefully
If e4defrag is run by root, it will try to open the underlying file
system for files that it is trying to defrag so it can get the file
system parameters.  It's currently doing this by searching /etc/mtab.
This isn't the best way to go about doing things, but we'll leave it
for now, at least for a maintenance release.  (The better way to do
things would be to look up the device using the blkid library, but
that's a more involved change.)

Since the file system parameters isn't strictly speaking necessary
(after all we get by without them when not running as root), we'll
allow e4defrag to continue running if we can't find the file system.
This can happen if /etc/mtab is pointing at /proc/mounts, and the
kernel can't properly identify the root file system, it is reported as
"/dev/root".

Addresses-Debian-Bug: #907634

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-21 07:52:29 -04:00
Theodore Ts'o
8d24eeb71a tests: move inode and its interior extent tree block
Add a test case for the bug fixed in 4b3038134b: "resize2fs: update
checksums in the extent tree's relocated block"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-20 10:11:21 -04:00
Theodore Ts'o
4b3038134b resize2fs: update checksums in the extent tree's relocated block
When shrinking an file system, and we need to relocate an inode, the
checksums in its extent tree must get updated to reflect its new inode
number.  When doing this, we need to do this *after* we update the
extent tree to reflect any blocks which need to be relocated due to
the file system shrink operation.

Otherwise, in the case where only an interior node of the extent tree
needs to get relocated, and none of the entries in that node need to
be adjusted, the checksum for that interior node is updated in the old
copy of that block, and then after the extent tree is updated to use
the new copy of that interior node, the extent tree is left with an
invalid checksum.

This is a relatively rare case, since it requires the following
conditions to be true:

*)  The metadata checksum feature must be enabled.
*)  An inode needs to be relocated.
*)  The inode needs to have an interior node.
*)  The block for that interior node needs to be relocated.
*)  None of blocks addressed by entries in that interior node needs
    to be relocated.

When all of these conditions are true, though, the file system is left
with corrupted with bad checksum for the extent tree block.

Addresses-Launchpad-Bug: 1798562

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reported-by: Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com>
2018-10-20 10:11:06 -04:00
Nicholas Clark
4dda231510 fuse2fs: fix fsname option in some cases
FUSE's parser allows command-line options to be specified before
or after the device/image and mount-path. This commit changes the
value of the fsname mount option to be correct even if options are
specified before the target device/image.

Signed-off-by: Nicholas Clark <nicholas.clark@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-16 15:34:20 -04:00
Theodore Ts'o
711da486b0 blkid: adjust copyright license for version.c to be LGPL
This makes the license of version.c to be consistent with the rest of
the files in the library.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-16 12:53:36 -04:00
Nick Kralevich
b7343ebb63 AOSP: android/perms.c: clean up error handling
There are a number of error conditions which, due to the way
ext2fs_dir_iterate2 operates, would not be propagated to the upper
layers of the call stack. As a result, certain error conditions,
such as not having enough room to allocate blocks for SELinux
labels, would fail silently, instead of causing a compile
failure.

As suggested in
https://android-review.googlesource.com/c/platform/external/e2fsprogs/+/324363
, add a error field to the caller's private data structure, and use the
bit in the field to indicate an error condition. Now, certain errors
which were silently ignored will cause a compile failure when compiling
Android.

Test: Artifically modify selabel_lookup() to return a failure, and
      verify Android doesn't compile.
Test: Verify Android compiles under normal circumstances.
Test: Artifically modify ino_add_xattr() to return a failure, and
      verify Android doesn't compile.
Bug: 117502873
Bug: 117567573
Bug: 117473440

Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Change-Id: Icdb0105a77e98c3428f20d3c59bf824dcad5db8d
From AOSP commit: 7ca13b8b2953f93536ea09eb2ff19bd7cc85b3c1
2018-10-12 22:58:08 -04:00
David Anderson
c4ef5b4f6b AOSP: Fix debugfs clang build.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Change-Id: Ic4de282039524e1858bbd288e2b85be30d843f40
From AOSP commit: 7e9e2ca4b08aab41b28e57d0c9b840b8b9e6466d
2018-10-12 22:55:57 -04:00
Jiyong Park
48453e96b2 AOSP: ODR violation in resize2fs during host build
Bug: 112062612
Test: $ m SANITIZE_HOST=address $OUT_DIR/host/linux-x86/bin/resize2fs $OUT_DIR/host/linux-x86/bin/llvm-symbolizer
      $ $OUT_DIR/host/linux-x86/bin/resize2fs

Signed-off-by: Theodore Ts'o <tytso@mit.edu>

Change-Id: I72a8c183eb887137e3a414043b3d54771aa4eedc
From AOSP commit: 9ba4dd69cfbf312c6015d5b007566e2467203f5e
2018-10-12 22:48:04 -04:00
Theodore Ts'o
4c2463c54b e2fsck: clear clang warnings for missing field initializers in structs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-11 10:25:31 -04:00
Theodore Ts'o
03fdf30663 test_one: make sure the tmpfile is cleaned up if the test script exits
f_detect_junk will skip the test by exiting; and in that case we need
to make sure the test's tmpfile gets cleaned up.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-10 22:56:12 -04:00
Theodore Ts'o
98c6113b41 Define __GNUC_PREREQ if necessary
The __GNUC_PREREQ convenience macro is defined by glibc's header
files.  If it isn't available, make it available for us to use.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-10 22:25:54 -04:00
Theodore Ts'o
1aa0d8a2e4 filefrag.c: fix build problem when using musl libc
Use HAVE_LINUX_FD_H guard since not all libc's or operating systems
provide <linux/fd.h>.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-10 22:24:01 -04:00
Lukas Czerner
b0ec76d623 libe2p: avoid segfault when s_nr_users is too high
Currently in e2fsprogs tools it's possible to access out of bounds
memory when reading list of ids sharing a journal log
(journal_superblock_t->s_users[]) in case where s_nr_users is too high.

This is because we never check whether the s_nr_users fits into the
restriction of JFS_USERS_MAX. Fix it by checking that nr_users is not
bigger than JFS_USERS_MAX and error out when possiblem.

Also add test for dumpe2fs. The rest would require involving external
journal which is not possible to test with e2fsprogs test suite at the
moment.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-10-02 21:47:10 -04:00
Theodore Ts'o
feb235e081 For --enable-subset, change "make install" so it implies "make install-libs"
The e2fsprogs-libs-1.44.x.tar.gz subset distribution had a hack so
that "make install" would install the libraries via an implied "make
install-libs" --- since after all the tarball had was just the
libraries.

This commit makes "make install" behave the same was as the
e2fsprogs-libs distribution in the case of "configure --enable-subset"

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-08-24 17:12:20 -04:00
Theodore Ts'o
f2243f1bdc debian: update changelog for 1.44.4-2 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-08-23 11:31:53 -04:00
Theodore Ts'o
1e44f35dcf debian: update changelog for 1.44.4-2 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2018-08-22 19:30:35 -04:00