Commit Graph

6389 Commits

Author SHA1 Message Date
Eric Biggers
f08f1c6492 chattr.1: clarify that ext4 doesn't support tail-merging either
This old text was never updated to mention ext4 in addition to ext2 and
ext3.  Do so now.  Also don't bother to mention old unmerged patches.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-18 12:14:33 -05:00
Eric Biggers
26d6e57c5c chattr.1: fix some grammatical errors
- "can only be open" => "can only be opened"
- "is not candidate" => "is not a candidate"
- "written ... on the disk" => "written ... to the disk"

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-18 12:14:33 -05:00
Eric Biggers
6e58704680 chattr.1: add casefold attribute to mode string
When the casefold attribute ('F') was added to the chattr man page, it
was forgotten to add it to the mode string.  Add it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-18 12:14:33 -05:00
Eric Biggers
93cea43534 chattr.1: adjust documentation for encryption attribute
Adjust the documentation for the encryption attribute ('E') to clarify
that encryption isn't experimental anymore and isn't restricted to
regular files, and that the encryption is done by the filesystem.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-18 12:14:33 -05:00
Eric Biggers
be335e31e7 chattr.1: document the verity attribute
Document the verity file attribute ('V').

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-18 12:14:33 -05:00
Theodore Ts'o
b9bb6a512e configure: don't fail if /usr/include/sys/mount.h does not exist
The AX_CHECK_MOUNT_OPT macro fails if /usr/include/sys/mount.h.
Unfortunately, the GNU HURD doesn't have this header file.  Drop the
requirement, since if it doesn't exist, the macro will assume that
given mount options don't exist, which for e2fsprogs is used to test
to for the existence of the mount options nosuid and nodev.  This is
only used for fuse2fs, and HURD doesn't support fuse2fs anyway.

Addresses-Debian-Bug: #944649
Reported-by: Svante Signell <svante.signell@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-13 13:55:29 -05:00
Theodore Ts'o
ea4d53b7b9 libext2fs/ismounted.c: check device id in advance to skip false device names
If there is a trickster which tries to use device names as the mount
device for pseudo-file systems, the resulting /proc/mounts can confuse
ext2fs_check_mount_point().  (So far as I can tell, there's no good
reason to do this, but sysadmins do the darnest things.)

An example of this might be the following /proc/mounts excerpt:

/dev/sdb /mnt2 tmpfs rw,relatime 0 0
/dev/sdb /mnt ext4 rw,relatime 0 0

This is created via "mount -t tmpfs /dev/sdb /mnt2" followed via
"mount -t ext4 /dev/sdb /mnt".  (Normally, a sane mount of tmpfs would
use something like "mount -t tmpfs tmpfs /mnt2".)

Fix this by double checking the st_rdev of the claimed mountpoint and
match it with the dev_t of the device.  (Note that the GNU HURD
doesn't support st_rdev, so we can't solve this problem for the HURD.)

Reported-by: GuiYao <guiyao@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-10 12:11:49 -05:00
Jan Kara
ac94445fc0 resize2fs: make minimum size estimates more reliable for mounted fs
Currently, the estimate of minimum filesystem size is using free blocks
counter in the superblock. The counter generally doesn't get updated
while the filesystem is mounted and thus the estimate is very unreliable
for a mounted filesystem. For some usecases such as automated
partitioning proposal to the user it is desirable that the estimate of
minimum filesystem size is reasonably accurate even for a mounted
filesystem. So use group descriptor counters of free blocks for the
estimate of minimum filesystem size. These get updated together with
block being allocated and so the resulting estimate is more accurate.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-10 08:13:53 -05:00
Darrick J. Wong
04335dbf32 e2scrub_all: fix broken stdin redirection
gregor herrmann reports that the weekly e2scrub cronjob emits these
errors:

/sbin/e2scrub_all: line 173: /proc/8234/fd/pipe:[90083173]: No such file or directory

The root cause of this is that the ls_targets stdout is piped to stdin
to the entire ls_targets loop body to prevent the loop body from reading
the loop iteration items.  Remove all the broken hackery by reading the
target list into a bash array and iterating the bash array.

Addresses-Debian-Bug: #944033

Reported-by: gregor herrmann <gregoa@debian.org>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-09 20:29:12 -05:00
Darrick J. Wong
333268d65d e2scrub_all: don't even reap if the config file doesn't allow it
Dave Chinner complains that the automated on-boot e2scrub reaping takes
a long time (because the lvs command can take a while to run) even
though the automated e2scrub is disabled via e2scrub.conf on his
systems.

We still need the reaping service to kill off stale e2scrub snapshots
after a crash, but it's unnecessary to annoy everyone with slow bootup.
Because we can look for the e2scrub snapshots in /dev/mapper, let's
skip reaping if periodic e2scrub is disabled unless we find evidence of
e2scrub snapshots in /dev.

Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-09 20:29:12 -05:00
Theodore Ts'o
b99ffaffc9 libext2fs: verify the block numbers for the allocation bitmaps are valid
This avoids a potential UBsan failure when we multiply an insanely
high block number with the block size and we get a multiplication
overflow.

Google-Bug-Id: 128130353
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-08 12:02:48 -05:00
Theodore Ts'o
a2a8cec68c libext2fs: properly free the bitmaps in read_bitmap()'s error/cleanup path
Use ext2fs_free_{block,inode}_bitmaps() instead of ext2fs_free_mem()
to avoid some memory leaks if there is an error while calling
read_bitmaps().

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-08 09:49:51 -05:00
Theodore Ts'o
6dac306792 Fix UBSan when shifting (1LL << 63)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-04 21:22:54 -05:00
Theodore Ts'o
41c05c9dc2 libext2fs: fix UBSan when updating an inline_data file
What memcpy does when the length is zero is not well-defined.  So
avoid it.

Bug: https://github.com/tytso/e2fsprogs/issues/25
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-04 18:43:49 -05:00
Theodore Ts'o
9bfbf1d5b9 libext2fs: fix bug when reading or writing more than 2GB in unix_io
If count * block_size exceeds 2GB, we will overflow a 32-bit signed
integer value.  This shouldn't happen in practice except for
fuzz-corrupted file systems, but let's fix the code so it's correct.

Bug: https://github.com/tytso/e2fsprogs/issues/24
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-11-04 16:43:41 -05:00
Eric Biggers
8692a3acf9 AOSP: Link to production releases, not testing releases
The testing links are not stable and are not guaranteed to exist.

Test: After re-generating the generated files, the link works now.
Change-Id: I36e73ef74571b3246f470280a75ae1098245eff5
From AOSP commit: 5971f6a5113b12b33d9454229bf27621853e1da7
2019-10-31 18:53:29 -04:00
Eric Biggers
de027d1c7a AOSP: Add new source files to Android.bp files
Test: see I3781b6d1e55923e9410644e8a7ba834b4d13b733
Change-Id: Ie071b30937dcf73f34df5dc3aa08d23ae30d9c63
From AOSP commit: d2a16e1616b807a6143b9c6232a1c54f90dc06f6
2019-10-31 18:51:34 -04:00
Theodore Ts'o
41479cc21d Define the codepoint for the fast_commit compat feature
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-10-03 21:15:22 -04:00
Theodore Ts'o
c2a8499d5d Update release notes, etc., for the 1.45.4 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 16:04:59 -04:00
Eric Biggers
040cd2479d tune2fs.8: tweak the documentation for the encrypt feature
Try to make it clearer that enabling 'encrypt' just enables *support*
for encryption; it doesn't actually encrypt anything by itself.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:28:36 -04:00
Eric Biggers
5f1e5f5e88 tune2fs.8: document the verity feature
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:28:36 -04:00
Eric Biggers
4ef530d95a ext4.5: tweak the documentation for the encrypt feature
Try to make it clearer that enabling 'encrypt' just enables *support*
for encryption; it doesn't actually encrypt anything by itself.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:28:36 -04:00
Eric Biggers
4cc90574e4 ext4.5: document the verity feature
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:28:36 -04:00
Eric Biggers
4ecbee2cfd ext4.5: document first kernel version to support casefold feature
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:28:36 -04:00
Eric Biggers
fea937ee09 ext4.5: move casefold feature to correct position
The features are listed in alphabetic order, so put the casefold feature
in the right place.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:28:36 -04:00
Theodore Ts'o
8111b79da7 e2scrub_all: make sure fd 3 is closed before running lvm commands
Some versions of cron leave fd 3 open for some unknown reason.  So
when e2scrub_all is run by cron (on non-systemd systems) this results
in an annoying message from the Cron Daemon because lvm will print
warning messages about "leaked file descriptors.  So force close fd 3
at the beginning of e2scrub and e2scrub_all.

Addresses-Debian-Bug: #940240
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:17:13 -04:00
Trần Ngọc Quân
1b866f5584 po: update vi.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:10:37 -04:00
Benno Schulenberg
b5ea016048 po: update nl.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:10:36 -04:00
Sharuzzaman Ahmat Raslan
128f2d3feb po: update ms.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:10:36 -04:00
Antonio Ceballos
be2e7b1cda po: update es.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:10:36 -04:00
Mario Blättermann
091a21ae79 po: update de.po (from translationproject.org)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-23 13:10:36 -04:00
Theodore Ts'o
8dbe7b475e 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>
2019-09-23 13:09:26 -04:00
Theodore Ts'o
16eca7ce12 e2fsck: check the validity of the casefold flag
The casefold flag is only allowed on directories and when the casefold
feature is enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-03 10:37:51 -04:00
Theodore Ts'o
576fada197 e2fsck: make the low dtime check consistent when using the backup superblock
The backup superblock may have a last mounted time of zero, if it has
never been updated since the file system was created.  In that case,
the low dtime check may get disabled when using the backup superblock,
even though subsequent e2fsck runs will end up using the low dtime
check.  This can cause a failure of ext4/007, since since when e2fsck
is run a second time after the file system is mounted, the low dtime
check will trigger the e2fsck complaint:

Inode NNNN was part of the orphaned inode list.  IGNORED.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-02 20:40:45 -04:00
Theodore Ts'o
82d6fa9ea7 e2fsck: update the quota records when the root directory is recreated
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-02 20:35:14 -04:00
Theodore Ts'o
638940d422 libsupport: remove unnecessary code to set the quota inode size
This is done correctly by the fileio routines; and it forces the quota
inode's file size to be unnecessarily rounded up to the block size.

Also remove the unnecessary double colon in the quota's error messages.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-09-02 20:35:14 -04:00
Theodore Ts'o
2e8cb3bebf e2scrub_all: allow scrubbing in vg's whose free space == snapshot size
If the volume group's free space is exactly the same as snapshot size,
e2scrub_all will skip those logical volumes in those volume groups.
Fix this by changing the test from '>' to '>='.

Fixes: c120312253 ("e2scrub_all: make sure there's enough free space...")
Addresses-Debian-Bug: #935009
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-18 19:23:07 -04:00
Matthias Andree
420246cd8f libuuid: signedness/type fixes
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-18 19:09:48 -04:00
Theodore Ts'o
11b8de0431 debian: add changelog for 1.45.3-4 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-06 20:19:26 -04:00
Theodore Ts'o
6fc6ef7f4c debian: don't gitignore debian/patches
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-08-03 01:12:21 -04:00
Theodore Ts'o
7525e8bc12 libblkid: fix gcc -Wall warnings
Google-Bug-Id: 118836063

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-30 21:13:44 -04:00
Theodore Ts'o
cfb073a4d4 debian: stop using LTO (link-time optimization)
LTO breaks reproducible builds, and there is some question as to how
reliable LTO's code generator is --- there are some scary stories that
it doesn't work well, and the GCC maintainers aren't super-interested
in fixing the bugs:

https://lists.debian.org/debian-devel/2019/07/msg00610.html

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-29 11:40:25 -04:00
Theodore Ts'o
20a18d5474 debian: skip running "make check" if DEB_BUILD_OPTIONS contains nocheck
This was done automatically by debhelper, but it got dropped when
override_dh_auto_test was added by commit 7f4c3bb120 ("debian: run
"make check" with V=1 to keep blhc happy").

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-27 12:17:06 -04:00
Theodore Ts'o
51bd35712d debian: mark more files in e2fsprogs.install as only being present on Linux
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-25 20:07:45 -04:00
Theodore Ts'o
740bbce950 debian: update changelog for 1.45.3-3 release
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-25 15:38:59 -04:00
Theodore Ts'o
a368e0cbfb e2fsck: set E2FSCK_TIME correctly on a 32-bit arch with a 64-bit time_t
Addresses-Debian-Bug: #932906

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-24 22:25:11 -04:00
Theodore Ts'o
4a6ef8e682 debian: mark logsave as Multi-Arch: foreign
Also fix logsave so it is Architecure: any.  It was previously
"linux-any kfreebsd-any" due to a cut-and-paste error.

Addresses-Debian-Bug: #932876

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-24 21:54:23 -04:00
Theodore Ts'o
b434d9d2c2 debian: fix Breaks/Replace dependency for logsave
Addresses-Debian-Bug: #932874

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-24 21:50:24 -04:00
Theodore Ts'o
da7a11394f debian: only install the udev and systemd files to e2fsprogs on Linux systems
Otherwise it will fail to build on hurd and kfreebsd.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-24 21:46:00 -04:00
Theodore Ts'o
7f4c3bb120 debian: run "make check" with V=1 to keep blhc happy
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2019-07-24 20:46:38 -04:00