Whamcloud - gitweb
libext2fs: reject various bitmap and inode operations for journal_dev file systems
authorTheodore Ts'o <tytso@mit.edu>
Tue, 9 Aug 2022 00:52:43 +0000 (20:52 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 9 Aug 2022 00:52:43 +0000 (20:52 -0400)
commit95d4ab9917cf1503b9c56acac98633efe89d48e5
tree48dad251c1c86727f58cf7ce3813760173f253dc
parent42c11edd0863e093a2cb84c56720af0e9b8e8c68
libext2fs: reject various bitmap and inode operations for journal_dev file systems

The ext2fs_open() function will only allow journal_dev file systems to
be open if explicitly requested by programs using the
EXT2_FLAG_JOURNAL_DEV_OK flag.  Those programs will not try to call
functions that make no sense, such as ext2fs_read_inode(),
ext2fs_read_bitmaps(), etc.  Just to make things the library more
robust against buggy programs (or unrealistic fuzzers) add a check for
journal_dev file systems to various ext2fs library functions to return
a new error, EXT2_ET_EXTERNAL_JOURNAL_NOSUPP.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/bitmaps.c
lib/ext2fs/ext2_err.et.in
lib/ext2fs/inode.c
lib/ext2fs/rw_bitmaps.c