From b46fbf3d52e722d9810dad97a5fa443b280c8a82 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 7 Apr 2018 01:12:00 -0400 Subject: [PATCH] tests: add new test f_ea_inode_self_ref 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 --- tests/f_ea_inode_self_ref/expect.1 | 17 +++++++++++++++++ tests/f_ea_inode_self_ref/expect.2 | 7 +++++++ tests/f_ea_inode_self_ref/image.gz | Bin 0 -> 661 bytes tests/f_ea_inode_self_ref/name | 1 + 4 files changed, 25 insertions(+) create mode 100644 tests/f_ea_inode_self_ref/expect.1 create mode 100644 tests/f_ea_inode_self_ref/expect.2 create mode 100644 tests/f_ea_inode_self_ref/image.gz create mode 100644 tests/f_ea_inode_self_ref/name diff --git a/tests/f_ea_inode_self_ref/expect.1 b/tests/f_ea_inode_self_ref/expect.1 new file mode 100644 index 0000000..f94c04d --- /dev/null +++ b/tests/f_ea_inode_self_ref/expect.1 @@ -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 index 0000000..9398061 --- /dev/null +++ b/tests/f_ea_inode_self_ref/expect.2 @@ -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 index 0000000000000000000000000000000000000000..3cc733b55280d31527a6704d8632bf062994ba20 GIT binary patch literal 661 zcmb2|=3sc>d?Jd8`RyHFZ;?b9h7aj!riZq#v8lMC!@;!C`~=^`5r%+yK9C^JI|seZ)X;om4}8zU2gsR_k(@@?=}BtCjLAB zM$bl=>B72S$y1U`j?K{7ruvn)?b@RK5q~Rk3$dET#$K3w>k0QLE-hLlvvtyrCePv3*pO2p}d+v~`>bm~x zRbR5cYIM%)4#O9h7PC%ClIb@Lx>7$Yey)S{im>Yc_n7NL8p|df+x4E)(`wfJ-b*)^s9Ku8;{Vi3QGc0p4~5qS{BQWhe#L&lKgO^8E9xEoGQW}s3o$T6O%l9tVV{$S zefs$oryhkwtXpUQa`lhQ1(!CYTFn1<=D*SYZLg!#J_{a|uDP-6t=B$%_LX}MzixjO zKJ8U`*^-?{=9k%hxf=U#_51%@n2*o0D?k0a^6;(D&0deQcG+7`-}1!P?)K_)6@Syt zfBPltf4^qV_u~?u4$CtjgDqS3bsk+A^(OtEzOZ8bzZ=i~EKR!b>|xEVuezBMYiF?Z z>n^UGy3<1P^@|%de^q_?rR-jP*|x_#^1t!6(EpR$4(9%vKW{?s%Dj7r?%b-ec((Rv z6@U2r|Np;~Z~dd5bT4X4^1q2Qwu`Y({GW0ry8GB4=fBkx>m61yBRhd)_6F{HhW9Qy KzZfPkG5`Qmr#)H# literal 0 HcmV?d00001 diff --git a/tests/f_ea_inode_self_ref/name b/tests/f_ea_inode_self_ref/name new file mode 100644 index 0000000..4e68da8 --- /dev/null +++ b/tests/f_ea_inode_self_ref/name @@ -0,0 +1 @@ +corrupted, self-referential ea_in_inode -- 1.8.3.1