Skip to contentSkip to conversation

e2fsck: Make sure quota files are not referenced from dirs

PATCH Applied Jan Kara 2 participants 2 messages Aug 12, 2021 – Aug 13, 2021

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 e2fsck: Make sure quota files are not referenced from dirs

Quota files must not be referenced from directory entries. Otherwise they can get corrupted under the hands of the kernel.

---
 e2fsck/pass2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
e2fsck/pass2.c +4 -1
index bd974c551b74..cb80d33311bc 100644
@@ -1441,7 +1441,10 @@ skip_checksum:
 		name_len = ext2fs_dirent_name_len(dirent);
 		if (((dirent->inode != EXT2_ROOT_INO) &&
 		     (dirent->inode < EXT2_FIRST_INODE(fs->super))) ||
-		    (dirent->inode > fs->super->s_inodes_count)) {
+		    (dirent->inode > fs->super->s_inodes_count) ||
+		    (dirent->inode == fs->super->s_usr_quota_inum) ||
+		    (dirent->inode == fs->super->s_grp_quota_inum) ||
+		    (dirent->inode == fs->super->s_prj_quota_inum)) {
 			problem = PR_2_BAD_INO;
 		} else if (ctx->inode_bb_map &&
 			   (ext2fs_test_inode_bitmap2(ctx->inode_bb_map,
Signature · 1 line
2.26.2
#1 lore raw
Quoted 6 lines · Jan Kara

Quota files must not be referenced from directory entries. Otherwise they can get corrupted under the hands of the kernel.

Applied, thanks!

[1/1] e2fsck: Make sure quota files are not referenced from dirs
(no commit info)

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>