about summary refs log tree commit diff
path: root/include/config.h
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-04-24 12:09:25 +0200
committervan Hauser <vh@thc.org>2020-04-24 12:09:25 +0200
commit766085293da050f84a397161e7a84384620956a2 (patch)
tree1ea92db874c0fc8487742bf926e65e1385cd7bf6 /include/config.h
parent4a593d04056ce37743f6922f7d0f0002a6b4e0d5 (diff)
downloadafl++-766085293da050f84a397161e7a84384620956a2.tar.gz
variable map size fix, error reporting through forkserver, code format
Diffstat (limited to 'include/config.h')
-rw-r--r--include/config.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h
index f11ac919..dca5a8f0 100644
--- a/include/config.h
+++ b/include/config.h
@@ -402,12 +402,26 @@
 
 /* Extended forkserver option values */
 
+/* Reporting errors */
+#define FS_OPT_ERROR 0xf800008f
+#define FS_OPT_GET_ERROR(x) ((x & 0x00ffff00) >> 8)
+#define FS_OPT_SET_ERROR(x) ((x & 0x0000ffff) << 8)
+#define FS_ERROR_MAP_SIZE 1
+#define FS_ERROR_MAP_ADDR 2
+#define FS_ERROR_SHM_OPEN 4
+#define FS_ERROR_SHMAT 8
+#define FS_ERROR_MMAP 16
+
+/* Reporting options */
 #define FS_OPT_ENABLED 0x8f000001
 #define FS_OPT_MAPSIZE 0x40000000
 #define FS_OPT_SNAPSHOT 0x20000000
 #define FS_OPT_AUTODICT 0x10000000
+// FS_OPT_MAX_MAPSIZE is 8388608 = 0x800000 = 2^23 = 1 << 22
+#define FS_OPT_MAX_MAPSIZE ((0x00fffffe >> 1) + 1)
 #define FS_OPT_GET_MAPSIZE(x) (((x & 0x00fffffe) >> 1) + 1)
-#define FS_OPT_SET_MAPSIZE(x) (x <= 1 || x > 0x1000000 ? 0 : ((x - 1) << 1))
+#define FS_OPT_SET_MAPSIZE(x) \
+  (x <= 1 || x > FS_OPT_MAX_MAPSIZE ? 0 : ((x - 1) << 1))
 
 #endif                                                  /* ! _HAVE_CONFIG_H */