aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-08-30 21:10:38 -0700
committerDmitry Vyukov <dvyukov@google.com>2018-08-30 21:45:04 -0700
commita4718693a3d9fcabb02299b2ec07c19d8208c539 (patch)
tree4646830d734816c5d6ab7bd5f71338ce3f9b1b54 /executor/common.h
parent4239b99abbcccac9104facbf2b040a5af4ffe1b1 (diff)
sys/linux: add syz_execute_func
The function executes random code. Update #310
Diffstat (limited to 'executor/common.h')
-rw-r--r--executor/common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/executor/common.h b/executor/common.h
index 5dbb7f7b9..15b279956 100644
--- a/executor/common.h
+++ b/executor/common.h
@@ -364,6 +364,15 @@ static uint16 csum_inet_digest(struct csum_inet* csum)
}
#endif
+#if SYZ_EXECUTOR || __NR_syz_execute_func
+// syz_execute_func(text ptr[in, text[taget]])
+static long syz_execute_func(long text)
+{
+ ((void (*)(void))(text))();
+ return 0;
+}
+#endif
+
#if GOOS_akaros
#include "common_akaros.h"
#elif GOOS_freebsd || GOOS_netbsd || GOOS_openbsd