mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-07-03 18:05:25 +00:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
64da32a3ff | |||
11a5e37684 | |||
2f6106879f | |||
4567a836e5 | |||
4b63eb2cf3 | |||
d33020db57 | |||
103884de2a | |||
96b5159eed | |||
a961039b19 | |||
ecc1ddaec6 | |||
05cc21e9d6 | |||
954f50fa00 | |||
27d08ee0b2 | |||
05c8dd90ca |
@ -4,7 +4,7 @@
|
||||
|
||||
Release version: [4.33c](https://github.com/AFLplusplus/AFLplusplus/releases)
|
||||
|
||||
GitHub version: 4.34a
|
||||
GitHub version: 4.33c
|
||||
|
||||
Repository:
|
||||
[https://github.com/AFLplusplus/AFLplusplus](https://github.com/AFLplusplus/AFLplusplus)
|
||||
|
@ -4,10 +4,6 @@
|
||||
release of the tool. See README.md for the general instruction manual.
|
||||
|
||||
|
||||
### Version ++4.34a (dev)
|
||||
- ...
|
||||
|
||||
|
||||
### Version ++4.33c (release)
|
||||
- afl-fuzz:
|
||||
- Use `AFL_PRELOAD_DISCRIMINATE_FORKSERVER_PARENT` if you use AFL_PRELOAD
|
||||
|
@ -26,7 +26,7 @@
|
||||
/* Version string: */
|
||||
|
||||
// c = release, a = volatile github dev, e = experimental branch
|
||||
#define VERSION "++4.34a"
|
||||
#define VERSION "++4.33c"
|
||||
|
||||
/******************************************************
|
||||
* *
|
||||
|
@ -46,10 +46,10 @@
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <poll.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/stat.h>
|
||||
#include <grp.h>
|
||||
|
||||
@ -400,28 +400,31 @@ void afl_fsrv_setup_preload(afl_forkserver_t *fsrv, char *argv0) {
|
||||
|
||||
}
|
||||
|
||||
/* Wrapper for poll() and read(), reading a 32 bit var.
|
||||
/* Wrapper for select() and read(), reading a 32 bit var.
|
||||
Returns the time passed to read.
|
||||
If the wait times out, returns timeout_ms + 1;
|
||||
Returns 0 if an error occurred (fd closed, signal, ...); */
|
||||
static u32 __attribute__((hot)) read_s32_timed(s32 fd, s32 *buf, u32 timeout_ms,
|
||||
volatile u8 *stop_soon_p) {
|
||||
|
||||
int pret;
|
||||
fd_set readfds;
|
||||
FD_ZERO(&readfds);
|
||||
FD_SET(fd, &readfds);
|
||||
struct timeval timeout;
|
||||
int sret;
|
||||
ssize_t len_read;
|
||||
struct pollfd fds[1];
|
||||
int nfds = 1;
|
||||
|
||||
timeout.tv_sec = (timeout_ms / 1000);
|
||||
timeout.tv_usec = (timeout_ms % 1000) * 1000;
|
||||
#if !defined(__linux__)
|
||||
u32 read_start = get_cur_time_us();
|
||||
|
||||
memset(&fds, 0, sizeof(fds));
|
||||
fds[0].fd = fd;
|
||||
fds[0].events = POLLIN;
|
||||
#endif
|
||||
|
||||
/* set exceptfds as well to return when a child exited/closed the pipe. */
|
||||
restart_poll:
|
||||
pret = poll(fds, nfds, timeout_ms);
|
||||
if (likely(pret > 0)) {
|
||||
restart_select:
|
||||
sret = select(fd + 1, &readfds, NULL, NULL, &timeout);
|
||||
|
||||
if (likely(sret > 0)) {
|
||||
|
||||
restart_read:
|
||||
if (*stop_soon_p) {
|
||||
@ -435,7 +438,13 @@ restart_poll:
|
||||
|
||||
if (likely(len_read == 4)) { // for speed we put this first
|
||||
|
||||
#if defined(__linux__)
|
||||
u32 exec_ms = MIN(
|
||||
timeout_ms,
|
||||
((u64)timeout_ms - (timeout.tv_sec * 1000 + timeout.tv_usec / 1000)));
|
||||
#else
|
||||
u32 exec_ms = MIN(timeout_ms, (get_cur_time_us() - read_start) / 1000);
|
||||
#endif
|
||||
|
||||
// ensure to report 1 ms has passed (0 is an error)
|
||||
return exec_ms > 0 ? exec_ms : 1;
|
||||
@ -450,14 +459,14 @@ restart_poll:
|
||||
|
||||
}
|
||||
|
||||
} else if (unlikely(!pret)) {
|
||||
} else if (unlikely(!sret)) {
|
||||
|
||||
*buf = -1;
|
||||
return timeout_ms + 1;
|
||||
|
||||
} else if (unlikely(pret < 0)) {
|
||||
} else if (unlikely(sret < 0)) {
|
||||
|
||||
if (likely(errno == EINTR)) goto restart_poll;
|
||||
if (likely(errno == EINTR)) goto restart_select;
|
||||
|
||||
*buf = -1;
|
||||
return 0;
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
*/
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
#include "afl-fuzz.h"
|
||||
#include "cmplog.h"
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
/* This file roughly follows afl-fuzz-asanfuzz */
|
||||
|
||||
#include <sys/select.h>
|
||||
|
||||
#include "afl-fuzz.h"
|
||||
|
||||
void sanfuzz_exec_child(afl_forkserver_t *fsrv, char **argv) {
|
||||
|
Reference in New Issue
Block a user