From: Eric Biggers <ebiggers@xxxxxxxxxx> Add a test which verifies that e2fsck will detect a variety of bad symlinks, both fast and slow, and with several combinations of filesystem features including extents, encryption, and inline_data. There was already a similar test (f_badsymlinks), but it's an old test that doesn't use any of these newer filesystem features. Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx> --- tests/f_badsymlinks2/expect.1 | 114 ++++++++++++++++++++++++++++ tests/f_badsymlinks2/expect.2 | 7 ++ tests/f_badsymlinks2/image.gz | Bin 0 -> 14302 bytes tests/f_badsymlinks2/mkimage.sh | 127 ++++++++++++++++++++++++++++++++ tests/f_badsymlinks2/name | 1 + 5 files changed, 249 insertions(+) create mode 100644 tests/f_badsymlinks2/expect.1 create mode 100644 tests/f_badsymlinks2/expect.2 create mode 100644 tests/f_badsymlinks2/image.gz create mode 100755 tests/f_badsymlinks2/mkimage.sh create mode 100644 tests/f_badsymlinks2/name diff --git a/tests/f_badsymlinks2/expect.1 b/tests/f_badsymlinks2/expect.1 new file mode 100644 index 00000000..939edce9 --- /dev/null +++ b/tests/f_badsymlinks2/expect.1 @@ -0,0 +1,114 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Symlink /default/empty (inode #13) is invalid. +Clear? yes + +Symlink /default/fast_isize_too_small (inode #15) is invalid. +Clear? yes + +Symlink /default/fast_isize_too_large (inode #16) is invalid. +Clear? yes + +Symlink /default/slow_isize_too_small (inode #19) is invalid. +Clear? yes + +Symlink /default/slow_isize_too_large (inode #20) is invalid. +Clear? yes + +Symlink /default/one_too_long (inode #22) is invalid. +Clear? yes + +Symlink /default/too_long (inode #23) is invalid. +Clear? yes + +Symlink /encrypted/empty (inode #25) is invalid. +Clear? yes + +Symlink /encrypted/fast_isize_too_large (inode #28) is invalid. +Clear? yes + +Symlink /encrypted/fast_isize_too_small (inode #27) is invalid. +Clear? yes + +Symlink /encrypted/one_too_long (inode #34) is invalid. +Clear? yes + +Symlink /encrypted/slow_isize_too_large (inode #32) is invalid. +Clear? yes + +Symlink /encrypted/slow_isize_too_small (inode #31) is invalid. +Clear? yes + +Symlink /encrypted/too_long (inode #35) is invalid. +Clear? yes + +Symlink /extents/empty (inode #38) is invalid. +Clear? yes + +Symlink /extents/fast_isize_too_small (inode #40) is invalid. +Clear? yes + +Symlink /extents/fast_isize_too_large (inode #41) is invalid. +Clear? yes + +Symlink /extents/slow_isize_too_small (inode #44) is invalid. +Clear? yes + +Symlink /extents/slow_isize_too_large (inode #45) is invalid. +Clear? yes + +Symlink /extents/one_too_long (inode #47) is invalid. +Clear? yes + +Symlink /extents/too_long (inode #48) is invalid. +Clear? yes + +Symlink /extents_encrypted/empty (inode #50) is invalid. +Clear? yes + +Symlink /extents_encrypted/fast_isize_too_large (inode #53) is invalid. +Clear? yes + +Symlink /extents_encrypted/fast_isize_too_small (inode #52) is invalid. +Clear? yes + +Symlink /extents_encrypted/one_too_long (inode #59) is invalid. +Clear? yes + +Symlink /extents_encrypted/slow_isize_too_large (inode #57) is invalid. +Clear? yes + +Symlink /extents_encrypted/slow_isize_too_small (inode #56) is invalid. +Clear? yes + +Symlink /extents_encrypted/too_long (inode #60) is invalid. +Clear? yes + +Symlink /inline_data/empty (inode #63) is invalid. +Clear? yes + +Symlink /inline_data/fast_isize_too_small (inode #65) is invalid. +Clear? yes + +Symlink /inline_data/fast_isize_too_large (inode #66) is invalid. +Clear? yes + +Symlink /inline_data/slow_isize_too_small (inode #69) is invalid. +Clear? yes + +Symlink /inline_data/slow_isize_too_large (inode #70) is invalid. +Clear? yes + +Symlink /inline_data/one_too_long (inode #72) is invalid. +Clear? yes + +Symlink /inline_data/too_long (inode #73) is invalid. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 36/80 files (0.0% non-contiguous), 31/150 blocks +Exit status is 1 diff --git a/tests/f_badsymlinks2/expect.2 b/tests/f_badsymlinks2/expect.2 new file mode 100644 index 00000000..3da98a87 --- /dev/null +++ b/tests/f_badsymlinks2/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: 36/80 files (0.0% non-contiguous), 31/150 blocks +Exit status is 0 diff --git a/tests/f_badsymlinks2/image.gz b/tests/f_badsymlinks2/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..d1f314ced5f639e635848b879b7dd248ec5ecade GIT binary patch literal 14302 zcmeIZ^+TIY(=d8hsZm<AcqzrLxRVxl3KX~E?k*v1DQ?9biaROpq(E^9?ydm>1cwm& z+WWrW=XuZh1J3u$$q!d{XJ=<;W@l#in%#>w^1*|L2Wk4Z@7Ow;T3h~gkcB6f1gHHO zs~*!XXGx;Ml9!dY_~w-@3(w#%4LQyt`IT*H7_kCHVwinWS`DwHU=3@oO^YNJ;qFFp zwUen??B3FdLR}&+&a%6a$PUEjNtF9js;7T_!m%#sQuTeg_gIr%H`Ljh>S^Xx=-ZsW z1(F8xdo+T4bqyJ}`aX3$6=jql?RK%El}HUOEL?da#K;aIF*2);kaCBm)%)Rh2$&Io zLg03}!@(P;`Z1rM4q=6wy8}dS0);~msHIIgx^Rs7i}eoW5R*m~?l+q*ZId{8b(khg z%rlVpbR*Bpdw~;w{r$s|f9IB<$l)dG#Z}CSeIi$V^bh>c6K(bczn%65eck@+*?*yb zL8y$SZ16vZ-GbizFBDz&><TjuHwiy6@xylWk{kfC)xeHcnBCYuEbtT2)t=`#fI@-& zzTXIAUQ?T>;SIzKd+V=jUmw&*oFyBm5NCZohXZmMf`qMJ<l<0NySTqT1zO~v#GcOf zf}%{&4mIl%ZQ#d!$3DAqF`&SmQGhEtbbli>Xjkn3_l;MOgx`=6E)#bOAm;3hH5-pU zusR2RS8jyiWPwc$CUBg>#p0@D!Orjl4Xh*8h|#aN7wSdDfYWZ=;SFdHEGZM6b{lFS zf5TOUdQl=Vh!eua2KYx`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K-}*^3leAUtZ0bki;SfOBNbFhW|%1hMJ0 z+WCcPJXfjpsDkT&V31^9k(6`Q-lVxX#!b1{FRgyJ{y<!GaaXaEcldV5UHP<L*ZL>n z!(neYIu{LVcu2nFHU{%Y;1iG(3|bHk)BJLBw}1T2$6Tv@=B1pY%$$7vTTF<-e1rwI zZ6|B$*y51;v{YsNOh704u7WslTxH(_A734#<!1#A;PAo+-y}?`KYzsEnB{A=r<J08 zVA^qPJ}?)}bZXF_vxV>`xS90Q2}6!lg4KMq5{qbWlxEe7mIu~3bbi(>AX}YTlZO{5 z_O0!Zzr5DY+q!$#<-)QflQUi)8{Ck3=fI<sKXAirPYREgY-+52*?!6cZT2*T5bGo2 z5`#u*YE}D0?lMzQr-}|fd|doOAjQ_iivmi2_+5to*S5Q%j|INTkW#D2s6Xp!B~h}3 zitF1*@1b0N<OVC*1H|3Ze^YnI(Qwip!G9~)GnI_b9=yIy*4Xtc%l|Yj!@%^FuJ8%F z^csVRuTRYi7*VcjsBxEj<Ef}KY4nlGm3Llss&aa3R!VKcAZ)Zv{9tK$n(^!y<Gy3s zsEJHSh3fJ@k9;mK&A2Hg$=I#8DJ9|TU9>u-zn=rhs3=6zU2V-va||+ZXXRdWB)_CR zF{gI;Czt)#&nrn3;0Bb%g2AP;09%iw*-yY7SaXSeGOJtmkT+6e858ATlw=MV7mWPW znMnR=-FoM-EMk?&{eNVMStEGxPx+HG&CS1L|84y1lk;B!FaM|V|N8F;oco`9uy1h$ r|2E?McmMZ==ReR6_qptUTYq8!JOA@dnn@_+R`e^C@xMMk{OkV!t(3** literal 0 HcmV?d00001 diff --git a/tests/f_badsymlinks2/mkimage.sh b/tests/f_badsymlinks2/mkimage.sh new file mode 100755 index 00000000..6bbf020d --- /dev/null +++ b/tests/f_badsymlinks2/mkimage.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +# This is the script that was used to create the image.gz in this directory. + +set -e -u + +BLOCKSIZE=4096 + +do_debugfs() { + umount mnt + debugfs -w "$@" image + mount image mnt +} + +do_tune2fs() { + umount mnt + tune2fs $@ image + mount image mnt +} + +symlink() { + local len=$1 + local src=$2 + local target=$(perl -e 'print "A" x '$len) + ln -s $target $src + stat -c %i $src +} + +# Overwrite the length in the header of the encrypted symlink target +set_encrypted_symlink_len() { + local ino=$1 + local len=$2 + + echo "zap_block -f <$ino> -p $((len%256)) -o 0 -l 1 0" + echo "zap_block -f <$ino> -p $((len/256)) -o 1 -l 1 0" +} + +create_symlinks() { + local dir=$1 + local encrypted=${2:-false} + local overhead=0 + local ino + + if $encrypted; then + overhead=2 + fi + + mkdir -p $dir + + { + ino=$(symlink 1 $dir/empty) + echo "set_inode_field <$ino> i_size 10" + echo "set_inode_field <$ino> block[0] 0" + + symlink 1 $dir/fast_min > /dev/null + + ino=$(symlink 10 $dir/fast_isize_too_small) + echo "set_inode_field <$ino> i_size 1" + + ino=$(symlink 10 $dir/fast_isize_too_large) + echo "set_inode_field <$ino> i_size 20" + + symlink $((59 - overhead)) $dir/fast_max > /dev/null + + symlink $((60 - overhead)) $dir/slow_min > /dev/null + + ino=$(symlink 100 $dir/slow_isize_too_small) + echo "set_inode_field <$ino> i_size 80" + + ino=$(symlink 100 $dir/slow_isize_too_large) + echo "set_inode_field <$ino> i_size 120" + + symlink $((BLOCKSIZE - 1 - overhead)) $dir/slow_max > /dev/null + + ino=$(symlink $((BLOCKSIZE - 1 - overhead)) $dir/one_too_long) + echo "set_inode_field <$ino> i_size $BLOCKSIZE" + echo "zap_block -f <$ino> -p 65 0" + if $encrypted; then + set_encrypted_symlink_len $ino $((BLOCKSIZE - overhead)) + fi + + ino=$(symlink $((BLOCKSIZE - 1 - overhead)) $dir/too_long) + echo "set_inode_field <$ino> i_size $((BLOCKSIZE + 1000))" + echo "zap_block -f <$ino> -p 65 0" + if $encrypted; then + set_encrypted_symlink_len $ino $((BLOCKSIZE + 1000 - overhead)) + fi + + } >> debugfs_commands + do_debugfs < debugfs_commands +} + +create_encrypted_symlinks() { + local dir=$1 link + + mkdir $dir + echo | e4crypt add_key $dir + create_symlinks $dir true + + # Move symlinks into an unencrypted directory (leaving their targets + # encrypted). This makes the fsck output consistent. + mv $dir ${dir}~encrypted + mkdir $dir + mv ${dir}~encrypted/* $dir +} + +mkdir -p mnt +umount mnt &> /dev/null || true +dd if=/dev/zero of=image bs=1024 count=600 + +mke2fs -O 'encrypt,^extents,^64bit' -b $BLOCKSIZE -I 256 image +mount image mnt + +create_symlinks mnt/default +create_encrypted_symlinks mnt/encrypted + +do_tune2fs -O extents +create_symlinks mnt/extents +create_encrypted_symlinks mnt/extents_encrypted + +do_debugfs -R 'feature inline_data' +create_symlinks mnt/inline_data + +rm -rf debugfs_commands mnt/*~encrypted +umount mnt +rmdir mnt +gzip -9 -f image diff --git a/tests/f_badsymlinks2/name b/tests/f_badsymlinks2/name new file mode 100644 index 00000000..81d32856 --- /dev/null +++ b/tests/f_badsymlinks2/name @@ -0,0 +1 @@ +more types of corrupted symlinks -- 2.16.2.395.g2e18187dfd-goog