Skip to content

Commit 40033af

Browse files
committed
update imported headers
1 parent e63c9af commit 40033af

File tree

4 files changed

+79
-37
lines changed

4 files changed

+79
-37
lines changed

qemuafl/imported/cmplog.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Dominik Maier <[email protected]>
1313
1414
Copyright 2016, 2017 Google Inc. All rights reserved.
15-
Copyright 2019-2020 AFLplusplus Project. All rights reserved.
15+
Copyright 2019-2024 AFLplusplus Project. All rights reserved.
1616
1717
Licensed under the Apache License, Version 2.0 (the "License");
1818
you may not use this file except in compliance with the License.
@@ -34,22 +34,19 @@
3434

3535
#define CMP_MAP_W 65536
3636
#define CMP_MAP_H 32
37-
#define CMP_MAP_RTN_H (CMP_MAP_H / 4)
37+
#define CMP_MAP_RTN_H (CMP_MAP_H / 2)
3838

3939
#define SHAPE_BYTES(x) (x + 1)
4040

41-
#define CMP_TYPE_INS 1
42-
#define CMP_TYPE_RTN 2
41+
#define CMP_TYPE_INS 0
42+
#define CMP_TYPE_RTN 1
4343

44-
struct cmp_header {
44+
struct cmp_header { // 16 bit = 2 bytes
4545

46-
unsigned hits : 24;
47-
unsigned id : 24;
48-
unsigned shape : 5;
49-
unsigned type : 2;
50-
unsigned attribute : 4;
51-
unsigned overflow : 1;
52-
unsigned reserved : 4;
46+
unsigned hits : 6; // up to 63 entries, we have CMP_MAP_H = 32
47+
unsigned shape : 5; // 31+1 bytes max
48+
unsigned type : 1; // 2: cmp, rtn
49+
unsigned attribute : 4; // 16 for arithmetic comparison types
5350

5451
} __attribute__((packed));
5552

@@ -59,14 +56,17 @@ struct cmp_operands {
5956
u64 v1;
6057
u64 v0_128;
6158
u64 v1_128;
59+
u64 unused;
60+
u8 unused1;
61+
u8 unused2;
6262

6363
} __attribute__((packed));
6464

6565
struct cmpfn_operands {
6666

67-
u8 v0[31];
67+
u8 v0[32];
6868
u8 v0_len;
69-
u8 v1[31];
69+
u8 v1[32];
7070
u8 v1_len;
7171

7272
} __attribute__((packed));

qemuafl/imported/config.h

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
Originally written by Michal Zalewski
66
77
Now maintained by Marc Heuse <[email protected]>,
8-
Heiko Eißfeldt <[email protected]>,
9-
Andrea Fioraldi <[email protected]>,
108
Dominik Maier <[email protected]>
9+
Andrea Fioraldi <[email protected]>,
10+
Heiko Eissfeldt <[email protected]>,
1111
1212
Copyright 2016, 2017 Google Inc. All rights reserved.
13-
Copyright 2019-2021 AFLplusplus Project. All rights reserved.
13+
Copyright 2019-2024 AFLplusplus Project. All rights reserved.
1414
1515
Licensed under the Apache License, Version 2.0 (the "License");
1616
you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
/* Version string: */
2727

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

3131
/******************************************************
3232
* *
@@ -43,9 +43,27 @@
4343
Default: 8MB (defined in bytes) */
4444
#define DEFAULT_SHMEM_SIZE (8 * 1024 * 1024)
4545

46+
/* Default time until when no more coverage finds are happening afl-fuzz
47+
switches to exploitation mode. It automatically switches back when new
48+
coverage is found.
49+
Default: 300 (seconds) */
50+
#define STRATEGY_SWITCH_TIME 1000
51+
4652
/* Default file permission umode when creating files (default: 0600) */
4753
#define DEFAULT_PERMISSION 0600
4854

55+
/* SkipDet's global configuration */
56+
57+
#define MINIMAL_BLOCK_SIZE 64
58+
#define SMALL_DET_TIME (60 * 1000 * 1000U)
59+
#define MAXIMUM_INF_EXECS (16 * 1024U)
60+
#define MAXIMUM_QUICK_EFF_EXECS (64 * 1024U)
61+
#define THRESHOLD_DEC_TIME (20 * 60 * 1000U)
62+
63+
/* Set the Prob of selecting eff_bytes 3 times more than original,
64+
Now disabled */
65+
#define EFF_HAVOC_RATE 3
66+
4967
/* CMPLOG/REDQUEEN TUNING
5068
*
5169
* Here you can modify tuning and solving options for CMPLOG.
@@ -54,21 +72,17 @@
5472
*
5573
*/
5674

57-
/* if TRANSFORM is enabled with '-l T', this additionally enables base64
58-
encoding/decoding */
59-
// #define CMPLOG_SOLVE_TRANSFORM_BASE64
60-
6175
/* If a redqueen pass finds more than one solution, try to combine them? */
6276
#define CMPLOG_COMBINE
6377

6478
/* Minimum % of the corpus to perform cmplog on. Default: 10% */
6579
#define CMPLOG_CORPUS_PERCENT 5U
6680

6781
/* Number of potential positions from which we decide if cmplog becomes
68-
useless, default 8096 */
82+
useless, default 12288 */
6983
#define CMPLOG_POSITIONS_MAX (12 * 1024)
7084

71-
/* Maximum allowed fails per CMP value. Default: 128 */
85+
/* Maximum allowed fails per CMP value. Default: 96 */
7286
#define CMPLOG_FAIL_MAX 96
7387

7488
/* -------------------------------------*/
@@ -81,7 +95,12 @@
8195
will be kept and written to the crash/ directory as RECORD:... files.
8296
Note that every crash will be written, not only unique ones! */
8397

84-
//#define AFL_PERSISTENT_RECORD
98+
// #define AFL_PERSISTENT_RECORD
99+
100+
/* Adds support in compiler-rt to replay persistent records in @@-style
101+
* harnesses */
102+
103+
// #define AFL_PERSISTENT_REPLAY_ARGPARSE
85104

86105
/* console output colors: There are three ways to configure its behavior
87106
* 1. default: colored outputs fixed on: defined USE_COLOR && defined
@@ -118,9 +137,9 @@
118137

119138
// #define _WANT_ORIGINAL_AFL_ALLOC
120139

121-
/* Comment out to disable fancy ANSI boxes and use poor man's 7-bit UI: */
140+
/* Comment out to disable fancy boxes and use poor man's 7-bit UI: */
122141

123-
#ifndef ANDROID_DISABLE_FANCY // Fancy boxes are ugly from adb
142+
#ifndef DISABLE_FANCY
124143
#define FANCY_BOXES
125144
#endif
126145

@@ -153,8 +172,9 @@
153172
/* Number of calibration cycles per every new test case (and for test
154173
cases that show variable behavior): */
155174

156-
#define CAL_CYCLES 8U
157-
#define CAL_CYCLES_LONG 20U
175+
#define CAL_CYCLES_FAST 3U
176+
#define CAL_CYCLES 7U
177+
#define CAL_CYCLES_LONG 12U
158178

159179
/* Number of subsequent timeouts before abandoning an input file: */
160180

@@ -289,10 +309,11 @@
289309

290310
#define UI_TARGET_HZ 5
291311

292-
/* Fuzzer stats file and plot update intervals (sec): */
312+
/* Fuzzer stats file, queue stats and plot update intervals (sec): */
293313

294314
#define STATS_UPDATE_SEC 60
295315
#define PLOT_UPDATE_SEC 5
316+
#define QUEUE_UPDATE_SEC 1800
296317

297318
/* Smoothing divisor for CPU load and exec speed stats (1 - no smoothing). */
298319

@@ -352,19 +373,20 @@
352373
65535, /* Overflow unsig 16-bit when incremented */ \
353374
65536, /* Overflow unsig 16 bit */ \
354375
100663045, /* Large positive number (endian-agnostic) */ \
376+
2139095040, /* float infinite */ \
355377
2147483647 /* Overflow signed 32-bit when incremented */
356378

357-
#define INTERESTING_32_LEN 8
379+
#define INTERESTING_32_LEN 9
358380

359381
/***********************************************************
360382
* *
361383
* Really exotic stuff you probably don't want to touch: *
362384
* *
363385
***********************************************************/
364386

365-
/* Call count interval between reseeding the libc PRNG from /dev/urandom: */
387+
/* Call count interval between reseeding the PRNG from /dev/urandom: */
366388

367-
#define RESEED_RNG 100000
389+
#define RESEED_RNG 2500000
368390

369391
/* The default maximum testcase cache size in MB, 0 = disable.
370392
A value between 50 and 250 is a good default value. Note that the
@@ -438,7 +460,15 @@
438460
after changing this - otherwise, SEGVs may ensue. */
439461

440462
#define MAP_SIZE_POW2 16
463+
464+
/* Do not change this unless you really know what you are doing. */
465+
441466
#define MAP_SIZE (1U << MAP_SIZE_POW2)
467+
#if MAP_SIZE <= 65536
468+
#define MAP_INITIAL_SIZE (2 << 20) // = 2097152
469+
#else
470+
#define MAP_INITIAL_SIZE MAP_SIZE
471+
#endif
442472

443473
/* Maximum allocator request size (keep well under INT_MAX): */
444474

@@ -489,10 +519,14 @@
489519

490520
#define AFL_TXT_MIN_LEN 12
491521

522+
/* Maximum length of a queue input to be evaluated for "is_ascii"? */
523+
524+
#define AFL_TXT_MAX_LEN 65535
525+
492526
/* What is the minimum percentage of ascii characters present to be classifed
493527
as "is_ascii"? */
494528

495-
#define AFL_TXT_MIN_PERCENT 94
529+
#define AFL_TXT_MIN_PERCENT 99
496530

497531
/* How often to perform ASCII mutations 0 = disable, 1-8 are good values */
498532

qemuafl/imported/snapshot-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Dominik Maier <[email protected]>
1313
1414
Copyright 2016, 2017 Google Inc. All rights reserved.
15-
Copyright 2019-2020 AFLplusplus Project. All rights reserved.
15+
Copyright 2019-2024 AFLplusplus Project. All rights reserved.
1616
1717
Licensed under the Apache License, Version 2.0 (the "License");
1818
you may not use this file except in compliance with the License.

qemuafl/imported/types.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Dominik Maier <[email protected]>
1111
1212
Copyright 2016, 2017 Google Inc. All rights reserved.
13-
Copyright 2019-2020 AFLplusplus Project. All rights reserved.
13+
Copyright 2019-2024 AFLplusplus Project. All rights reserved.
1414
1515
Licensed under the Apache License, Version 2.0 (the "License");
1616
you may not use this file except in compliance with the License.
@@ -49,6 +49,14 @@ typedef uint128_t u128;
4949
#define FS_ERROR_OLD_CMPLOG 32
5050
#define FS_ERROR_OLD_CMPLOG_QEMU 64
5151

52+
/* New Forkserver */
53+
#define FS_NEW_VERSION_MIN 1
54+
#define FS_NEW_VERSION_MAX 1
55+
#define FS_NEW_ERROR 0xeffe0000
56+
#define FS_NEW_OPT_MAPSIZE 0x00000001 // parameter: 32 bit value
57+
#define FS_NEW_OPT_SHDMEM_FUZZ 0x00000002 // parameter: none
58+
#define FS_NEW_OPT_AUTODICT 0x00000800 // autodictionary data
59+
5260
/* Reporting options */
5361
#define FS_OPT_ENABLED 0x80000001
5462
#define FS_OPT_MAPSIZE 0x40000000
@@ -57,7 +65,7 @@ typedef uint128_t u128;
5765
#define FS_OPT_SHDMEM_FUZZ 0x01000000
5866
#define FS_OPT_NEWCMPLOG 0x02000000
5967
#define FS_OPT_OLD_AFLPP_WORKAROUND 0x0f000000
60-
// FS_OPT_MAX_MAPSIZE is 8388608 = 0x800000 = 2^23 = 1 << 22
68+
// FS_OPT_MAX_MAPSIZE is 8388608 = 0x800000 = 2^23 = 1 << 23
6169
#define FS_OPT_MAX_MAPSIZE ((0x00fffffeU >> 1) + 1)
6270
#define FS_OPT_GET_MAPSIZE(x) (((x & 0x00fffffe) >> 1) + 1)
6371
#define FS_OPT_SET_MAPSIZE(x) \

0 commit comments

Comments
 (0)