Compare commits

..

14 Commits
dev ... release

Author SHA1 Message Date
64da32a3ff Merge pull request #2487 from AFLplusplus/stable
v4.33c
2025-06-28 22:30:45 +02:00
11a5e37684 Merge pull request #2486 from AFLplusplus/dev
push to stable
2025-06-28 22:29:37 +02:00
2f6106879f Merge pull request #2402 from AFLplusplus/stable
v4.32c
2025-04-26 15:37:37 +02:00
4567a836e5 Merge pull request #2262 from AFLplusplus/stable
v4.30c
2024-12-03 15:49:48 +01:00
4b63eb2cf3 Merge pull request #2054 from AFLplusplus/stable
v4.20c
2024-04-13 11:57:22 +02:00
d33020db57 Merge pull request #1986 from AFLplusplus/stable
v4.10c
2024-02-03 12:11:56 +01:00
103884de2a Merge pull request #1934 from AFLplusplus/stable
v4.09c
2023-12-15 09:36:46 +01:00
96b5159eed Merge pull request #1833 from AFLplusplus/stable
4.08c
2023-08-10 09:07:33 +00:00
a961039b19 Merge pull request #1768 from AFLplusplus/stable
v4.07c release
2023-06-12 10:04:59 +03:00
ecc1ddaec6 Merge pull request #1707 from AFLplusplus/stable
v4.06c release
2023-04-17 10:27:52 +02:00
05cc21e9d6 Merge pull request #1611 from AFLplusplus/stable
4.05c
2023-01-05 13:53:14 +01:00
954f50fa00 Merge pull request #1552 from AFLplusplus/stable
v4.04c
2022-10-11 15:42:40 +02:00
27d08ee0b2 Merge pull request #1490 from AFLplusplus/stable
4.02c
2022-08-08 15:36:17 +02:00
05c8dd90ca Merge pull request #1465 from AFLplusplus/stable
4.01c
2022-06-29 08:45:19 +02:00
6 changed files with 31 additions and 22 deletions

View File

@ -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)

View File

@ -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

View File

@ -26,7 +26,7 @@
/* Version string: */
// c = release, a = volatile github dev, e = experimental branch
#define VERSION "++4.34a"
#define VERSION "++4.33c"
/******************************************************
* *

View File

@ -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;

View File

@ -24,6 +24,8 @@
*/
#include <sys/select.h>
#include "afl-fuzz.h"
#include "cmplog.h"

View File

@ -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) {