Whamcloud - gitweb
tests: add new test f_ea_inode_self_ref
authorTheodore Ts'o <tytso@mit.edu>
Sat, 7 Apr 2018 05:12:00 +0000 (01:12 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 7 Apr 2018 05:12:00 +0000 (01:12 -0400)
Make sure we can handle a maliciously created file system containing
an inode containing an extended attribute whose e_value_inum points
back at itself.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/f_ea_inode_self_ref/expect.1 [new file with mode: 0644]
tests/f_ea_inode_self_ref/expect.2 [new file with mode: 0644]
tests/f_ea_inode_self_ref/image.gz [new file with mode: 0644]
tests/f_ea_inode_self_ref/name [new file with mode: 0644]

diff --git a/tests/f_ea_inode_self_ref/expect.1 b/tests/f_ea_inode_self_ref/expect.1
new file mode 100644 (file)
index 0000000..f94c04d
--- /dev/null
@@ -0,0 +1,17 @@
+Pass 1: Checking inodes, blocks, and sizes
+Inode 16 has INLINE_DATA_FL flag but extended attribute not found.  Truncate? yes
+
+Extended attribute in inode 16 has a hash (553648128) which is invalid
+Clear? yes
+
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+Block bitmap differences:  -20
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 16/16 files (0.0% non-contiguous), 21/100 blocks
+Exit status is 1
diff --git a/tests/f_ea_inode_self_ref/expect.2 b/tests/f_ea_inode_self_ref/expect.2
new file mode 100644 (file)
index 0000000..9398061
--- /dev/null
@@ -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: 16/16 files (0.0% non-contiguous), 21/100 blocks
+Exit status is 0
diff --git a/tests/f_ea_inode_self_ref/image.gz b/tests/f_ea_inode_self_ref/image.gz
new file mode 100644 (file)
index 0000000..3cc733b
Binary files /dev/null and b/tests/f_ea_inode_self_ref/image.gz differ
diff --git a/tests/f_ea_inode_self_ref/name b/tests/f_ea_inode_self_ref/name
new file mode 100644 (file)
index 0000000..4e68da8
--- /dev/null
@@ -0,0 +1 @@
+corrupted, self-referential ea_in_inode