diff options
author | Andrea Fioraldi <andreafioraldi@gmail.com> | 2022-01-20 17:41:38 +0100 |
---|---|---|
committer | Andrea Fioraldi <andreafioraldi@gmail.com> | 2022-01-20 17:41:38 +0100 |
commit | a9d549ca073ca3fc37b63c1fa454c575bba174b9 (patch) | |
tree | b219601f9f48197ecf4b1e6a9aec588ce13c673b /utils/aflpp_driver/aflpp_driver.c | |
parent | 4721d869ad70241953cd74bcc391f794bed72eb7 (diff) | |
download | afl++-a9d549ca073ca3fc37b63c1fa454c575bba174b9.tar.gz |
Raw read syscall in aflpp_driver.c to bypass ASan checks
Diffstat (limited to 'utils/aflpp_driver/aflpp_driver.c')
-rw-r--r-- | utils/aflpp_driver/aflpp_driver.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/aflpp_driver/aflpp_driver.c b/utils/aflpp_driver/aflpp_driver.c index 65b8de06..547b78fb 100644 --- a/utils/aflpp_driver/aflpp_driver.c +++ b/utils/aflpp_driver/aflpp_driver.c @@ -45,6 +45,9 @@ $AFL_HOME/afl-fuzz -i IN -o OUT ./a.out #include <sys/stat.h> #include <fcntl.h> #include <sys/mman.h> +#ifndef __HAIKU__ + #include <sys/syscall.h> +#endif #include "config.h" #include "types.h" @@ -205,7 +208,11 @@ static int ExecuteFilesOnyByOne(int argc, char **argv) { if (fd == -1) { continue; } - ssize_t length = read(fd, buf, MAX_FILE); +#ifndef __HAIKU__ + ssize_t length = syscall(SYS_read, fd, buf, MAX_FILE); +#else + ssize_t length = _kern_read(fd, buf, MAX_FILE); +#endif // HAIKU if (length > 0) { |