Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angora can't detect the crash, ANGORA_USE_ASAN=1 did not work either #81

Open
zeqiii opened this issue Dec 12, 2019 · 2 comments
Open

Comments

@zeqiii
Copy link

zeqiii commented Dec 12, 2019

I followed the steps showed on README.md and installed Angora on Ubuntu 18.04, LLVM 7.0. When I run "test.sh mini", all things go well, the result showed one crash found. But when I fuzz a test program, Angora showed that no crash had detected. In fact, some of the seeds in "output/queue" were able to trigger the crash of "Segmentation fault".

Then I found that, given the same input file, the binary compiled by "angora_clang" did not crash but the binary compiled by "gcc" or "clang" crashed.

Then I tried using "ANGORA_USE_ASAN=1 USE_FAST=1" to compile the fast version, however the sanitizer didn't work and no crash happened. Yet when I use clang's sanitizer, it worked normally.

Here is part of the code of the test program

// stack overflow is triggered as long as this function is executed
void bug1() {
    printf("bug1\n");
    char dst[64];
    char* src = (char*)malloc(65535*sizeof(char));
    memset(src, 'A', 65535);
    memcpy(dst, src, 65535); // potential flaw
    free(src);
}

Compiled with

ANGORA_USE_ASAN=1 USE_FAST=1 /path/to/angora_clang example.c -g -o exam_fast
USE_TRACK=1 /path/to/angora_clang example.c -g -o exam_track

Run with

echo core | sudo tee /proc/sys/kernel/core_pattern
/path/to/angora_fuzzer -i in -o output -t ./exam_track -- ./exam_fast @@
@spinpx
Copy link
Member

spinpx commented Dec 15, 2019

Hi zeqii, Thanks for the report,

Angora can't report this crash since it uses "-O3" optimization by default.

If you using clang -O3 options with clang to compile the program, it also can't trigger asan reports.

You can use

ANGORA_DONT_OPTIMIZE=1 ANGORA_USE_ASAN=1 ~/Angora/bin/angora-clang issue81.c -o issue81.fast

to disable optimization.

Thanks.

@zeqiii
Copy link
Author

zeqiii commented Dec 16, 2019

Hi zeqii, Thanks for the report,

Angora can't report this crash since it uses "-O3" optimization by default.

If you using clang -O3 options with clang to compile the program, it also can't trigger asan reports.

You can use

ANGORA_DONT_OPTIMIZE=1 ANGORA_USE_ASAN=1 ~/Angora/bin/angora-clang issue81.c -o issue81.fast

to disable optimization.

Thanks.

Thanks! It works!

@zeqiii zeqiii closed this as completed Dec 16, 2019
@zeqiii zeqiii reopened this Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants