Skip to content

Commit af8c68a

Browse files
Merge pull request #1766 from AFLplusplus/dev
v4.07c release
2 parents 26cbc1e + bf2727b commit af8c68a

File tree

7 files changed

+71
-11
lines changed

7 files changed

+71
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<img align="right" src="https://raw.githubusercontent.com/AFLplusplus/Website/main/static/aflpp_bg.svg" alt="AFL++ logo" width="250" heigh="250">
44

5-
Release version: [4.06c](https://github.com/AFLplusplus/AFLplusplus/releases)
5+
Release version: [4.07c](https://github.com/AFLplusplus/AFLplusplus/releases)
66

7-
GitHub version: 4.07a
7+
GitHub version: 4.07c
88

99
Repository:
1010
[https://github.com/AFLplusplus/AFLplusplus](https://github.com/AFLplusplus/AFLplusplus)

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Should
44

5+
- afl-crash-analysis
6+
- show in the UI when fuzzing is "done"
57
- test cmplog for less than 16bit
68
- support persistent and deferred fork server in afl-showmap?
79
- better autodetection of shifting runtime timeout values

docs/Changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This is the list of all noteworthy changes made in every public
44
release of the tool. See README.md for the general instruction manual.
55

6-
### Version ++4.07a (dev)
6+
### Version ++4.07c (release)
77
- afl-fuzz:
88
- reverse reading the seeds only on restarts (increases performance)
99
- new env `AFL_POST_PROCESS_KEEP_ORIGINAL` to keep the orignal
@@ -18,6 +18,7 @@
1818
- rewrote our PCGUARD pass to be compatible with LLVM 15+ shenanigans,
1919
requires LLVM 13+ now instead of 10.0.1+
2020
- fallback to native LLVM PCGUARD if our PCGUARD is unavailable
21+
- fixed a crash in GCC CMPLOG
2122
- afl-showmap:
2223
- added custom mutator post_process and send support
2324
- add `-I filelist` option, an alternative to `-i in_dir`

docs/FAQ.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,54 @@ If you find an interesting or important question missing, submit it via
279279

280280
Solution: just do an `export AFL_MAP_SIZE=(the value in the warning)`.
281281
</p></details>
282+
283+
<details>
284+
<summary id="linker-errors">Linker errors.</summary><p>
285+
286+
If you compile C++ harnesses and see `undefined reference` errors for
287+
variables named `__afl_...`, e.g.:
288+
289+
```
290+
/usr/bin/ld: /tmp/test-d3085f.o: in function `foo::test()':
291+
test.cpp:(.text._ZN3fooL4testEv[_ZN3fooL4testEv]+0x35): undefined reference to `foo::__afl_connected'
292+
clang: error: linker command failed with exit code 1 (use -v to see invocation)
293+
```
294+
295+
Then you use AFL++ macros like `__AFL_LOOP` within a namespace and this
296+
will not work.
297+
298+
Solution: Move that harness portion to the global namespace, e.g. before:
299+
```
300+
#include <cstdio>
301+
namespace foo {
302+
static void test() {
303+
while(__AFL_LOOP(1000)) {
304+
foo::function();
305+
}
306+
}
307+
}
308+
309+
int main(int argc, char** argv) {
310+
foo::test();
311+
return 0;
312+
}
313+
```
314+
after:
315+
```
316+
#include <cstdio>
317+
static void mytest() {
318+
while(__AFL_LOOP(1000)) {
319+
foo::function();
320+
}
321+
}
322+
namespace foo {
323+
static void test() {
324+
mytest();
325+
}
326+
}
327+
int main(int argc, char** argv) {
328+
foo::test();
329+
return 0;
330+
}
331+
```
332+
</p></details>

docs/custom_mutators.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,15 @@ def deinit(): # optional for Python
145145

146146
- `fuzz` (optional):
147147

148-
This method performs custom mutations on a given input. It also accepts an
149-
additional test case. Note that this function is optional - but it makes
150-
sense to use it. You would only skip this if `post_process` is used to fix
151-
checksums etc. so if you are using it, e.g., as a post processing library.
152-
Note that a length > 0 *must* be returned!
153-
The returned output buffer is under **your** memory management!
148+
This method performs your custom mutations on a given input.
149+
The add_buf is the contents of another queue item that can be used for
150+
splicing - or anything else - and can also be ignored. If you are not
151+
using this additional data then define `splice_optout` (see above).
152+
This function is optional.
153+
Returing a length of 0 is valid and is interpreted as skipping this
154+
one mutation result.
155+
For non-Python: the returned output buffer is under **your** memory
156+
management!
154157

155158
- `describe` (optional):
156159

include/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* Version string: */
2727

2828
// c = release, a = volatile github dev, e = experimental branch
29-
#define VERSION "++4.07a"
29+
#define VERSION "++4.07c"
3030

3131
/******************************************************
3232
* *

instrumentation/afl-gcc-cmptrs-pass.so.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ struct afl_cmptrs_pass : afl_base_pass {
157157
/* We expect it to be a record type. */
158158
if (TREE_CODE(t) != RECORD_TYPE) return false;
159159

160+
/* The type has an identifier. */
161+
if (!TYPE_IDENTIFIER(t)) return false;
162+
160163
/* The type of the template is basic_string. */
161164
if (strcmp(IDENTIFIER_POINTER(TYPE_IDENTIFIER(t)), "basic_string") != 0)
162165
return false;
@@ -201,7 +204,7 @@ struct afl_cmptrs_pass : afl_base_pass {
201204
/* Now go back to the first data member. Its type should be a
202205
record type named _Alloc_hider. */
203206
c = TREE_TYPE(c);
204-
if (!c || TREE_CODE(c) != RECORD_TYPE ||
207+
if (!c || TREE_CODE(c) != RECORD_TYPE || !TYPE_IDENTIFIER(t) ||
205208
strcmp(IDENTIFIER_POINTER(TYPE_IDENTIFIER(c)), "_Alloc_hider") != 0)
206209
return false;
207210

0 commit comments

Comments
 (0)