From f51a34696bff9c60bc03d6a9c2934121d9423061 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Tue, 30 Aug 2016 15:22:14 +0800 Subject: [PATCH] btrfs-progs: fuzz-test: Add test case for invalid drop level Reported-by: Lukas Lueg Signed-off-by: Qu Wenruo [ added bko-NNN- prefix to the files ] Signed-off-by: David Sterba --- .../bko-154021-invalid-drop-level.raw.txt | 30 ++++++++++++++++++ .../bko-154021-invalid-drop-level.raw.xz | Bin 0 -> 3788 bytes 2 files changed, 30 insertions(+) create mode 100644 tests/fuzz-tests/images/bko-154021-invalid-drop-level.raw.txt create mode 100644 tests/fuzz-tests/images/bko-154021-invalid-drop-level.raw.xz diff --git a/tests/fuzz-tests/images/bko-154021-invalid-drop-level.raw.txt b/tests/fuzz-tests/images/bko-154021-invalid-drop-level.raw.txt new file mode 100644 index 00000000..dab91dcc --- /dev/null +++ b/tests/fuzz-tests/images/bko-154021-invalid-drop-level.raw.txt @@ -0,0 +1,30 @@ +URL: https://bugzilla.kernel.org/show_bug.cgi?id=154021 +Lukas Lueg 2016-08-26 22:53:42 UTC + +Created attachment 230361 [details] +Image triggering btrfsck to segv + +The fuzzer hit again: + +==32522==ERROR: AddressSanitizer: SEGV on unknown address 0x00027fff801c (pc +0x0000004a952e bp 0x7fff5222ce70 sp 0x7fff5222c600 T0) + #0 0x4a952d in __asan_memcpy +(/home/lukas/dev/btrfsfuzz/bin-asan/bin/btrfs+0x4a952d) + #1 0x66a323 in read_extent_buffer +/home/lukas/dev/btrfsfuzz/src-asan/extent_io.c:867:2 + #2 0x55ad25 in btrfs_node_key +/home/lukas/dev/btrfsfuzz/src-asan/./ctree.h:1668:2 + #3 0x58573b in check_fs_root +/home/lukas/dev/btrfsfuzz/src-asan/cmds-check.c:3748:3 + #4 0x544136 in check_fs_roots +/home/lukas/dev/btrfsfuzz/src-asan/cmds-check.c:3896:10 + #5 0x53d8c5 in cmd_check +/home/lukas/dev/btrfsfuzz/src-asan/cmds-check.c:11470:8 + #6 0x4f105f in main /home/lukas/dev/btrfsfuzz/src-asan/btrfs.c:243:8 + #7 0x7fea1bcb7730 in __libc_start_main (/lib64/libc.so.6+0x20730) + #8 0x421238 in _start +(/home/lukas/dev/btrfsfuzz/bin-asan/bin/btrfs+0x421238) + + +See the attached image to reproduce using btrfs-progs btrfs-progs +v4.7-42-g56e9586. diff --git a/tests/fuzz-tests/images/bko-154021-invalid-drop-level.raw.xz b/tests/fuzz-tests/images/bko-154021-invalid-drop-level.raw.xz new file mode 100644 index 0000000000000000000000000000000000000000..76c58dce433dc6939c35d25cd4c2f2165be3c94c GIT binary patch literal 3788 zcmeH~=|2>T8pp>rOk7JTgJxt4Lt`gQ*2CB^^nl&V!aLzI z@0jC7ai7WK7!5Tr{LL$kd&tn#5c(071;%nA5O#be2iJ)jDeLZ*AUR(PJ8YwA4!I3$ zTpdI@RKC`Yxssl+H&OY9Hrq-6GTl|V4x+X#s3G;?A=8m?^YJdYIPJx2VFvt3`A6$) zbFc+!VFWSadFqZ1VmvcIKef|;?3cDy`_{s?GW@7B(Ex|nkC6#iqSykX37G9Ug~#WP z%6x4!yjQ$&Npr@x!b5Tv((=S{)}`|}(rg2fE(rPBVmo?fUidm$7C}KFN^K}O`%*N* zm#DVVwLK**cnmyCx!@JFD1CqS%#^7VKf0!sIBB=F9AB^QAS>wg#X$ItOle?MEZsey zEu5fG2YH#`&@w%HnnmcLVkX2BefrqmAvV9MpZM(Nl$%=l%st10G&UmKVJfIaLa9=B zH=W%`=09o4T8Zy5S>Pbeuv$qr%@^HI-ouYQMzd%AFBu(|_+uFq;a_`y*z542{kJVM zhkuVtVq9^Jd9$uy6CCecX?RsVoX>$iMX`1Stp|dvFxS+u%zj$h>_O$~O(1@F?egG1 zR_Vg(skuT3i>bAGsG%>x!)Ky>Nyk_a{!iGbrjvQ!~DSJYxRWSPJMmx7(4y8~Gg-{`IpjdX=7>N!zQqFs<;ETR;( z&L8rqkFEyx@lO93;^xKp_^*w%oN!bq;Yspo0Y0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