hydra
hydra copied to clipboard
test image fail on my os
Hi, i encounter a problem, i create a ext4 image file , then call test command , but it fail.
how to create ext4 image: use my script:
#! /bin/bash
# i keep the same file list with sample/oracle/ext4-10.image
set -x
umount /tmp/ext4
rm -rf /tmp/ext4
mkdir /tmp/ext4
rm -f ext4.img
dd if=/dev/zero of=ext4.img bs=4k count=4096
mke2fs -t ext4 -c ext4.img
tune2fs -c0 -i0 ext4.img
mount -t ext4 ./ext4.img /tmp/ext4
cd /tmp/ext4
mkdir foo
mkdir foo/bar
touch foo/bar/baz
ln foo/bar/baz foo/bar/hln
echo "hello world\n" > foo/bar/baz
touch foo/bar/xattr
touch foo/bar/acl
touch foo/bar/æøå
echo "xyz\n" > foo/bar/æøå
#mkfifo foo/bar/fifo
touch foo/bar/fifo
ln -s mnt/foo/bar/baz foo/bar/sln
tree /tmp/ext4
how to test: run below command
# below command is copy from the terminal when i call "run.py ......"
# and i replace the image name to my image
sudo AFL_SKIP_BIN_CHECK=1 ./combined/afl-image-syscall/afl-fuzz -S fuzzer_ext4-cpu1log1grp1 -b shm_ext4-1 -s fs/ext4/ext4_wrapper.so -e ./ext4.img -y seed -i in-ext4-1 -o out-ext4-1 -u 1 -- lkl/tools/lkl/ext4-combined-consistency -t ext4 -i ./ext4.img -e emulator/emulator.py -l /tmp/mosbench/tmpfs-separate/1/log -d "/tmp/mosbench/tmpfs-separate/1/" -r -p @@
the fail message:
terminate called after throwing an instance of 'std::bad_alloc' [cpu001:100%] what(): std::bad_alloc Aborted sudo AFL_SKIP_BIN_CHECK=1 ./combined/afl-image-syscall/afl-fuzz -S fuzzer_ext4-cpu1log1grp1 -b shm_ext4-1 -s fs/ext4/ext4_wrapper.so -e ./ext4.img -y seed -i in-ext4-1 -o out-ext4-1 -u 1 -- lkl/tools/lkl/ext4-combined-consistency -t ext4 -i ./ext4.img -e emulator/emulator.py -l /tmp/mosbench/tmpfs-separate/1/log -d "/tmp/mosbench/tmpfs-separate/1/" -r -p @@
my system info:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic
$ uname -a
Linux ub1804 5.0.0-050000-generic #201903032031 SMP Mon Mar 4 01:33:18 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ gcc -v
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
my other try:
my ubuntu system have kernel version 4.15 at first, i then upgrade it to 5.0, but same error. my gcc version have version 4.7 at first, i then replace it to clang, but same error.
i also do a test, i run the test command with default ext4-10.image, it work perfectly, then i mount ext4-10.image, and edit the file fool/bar/baz as follow: delete a charactor, then save the file; then add back the charactor, and save the file , then i rerun the command with ext4-10.image, then it rise Segmentation fault.
it seems that, once the image file edit by my os, even though file content not change, it will rise a error.
what i want:
- i hope you will help me to fix the issue.
- i guess the problem is because of my os(kernel, lib version, gcc version...) is different to yours. so could you paste your local machine info, include, os release version, gcc version, os kernel version.
Thanks!