diff options
author | Akira Moroo <retrage01@gmail.com> | 2021-11-12 06:01:19 +0000 |
---|---|---|
committer | Akira Moroo <retrage01@gmail.com> | 2021-11-12 06:13:25 +0000 |
commit | c2feee4ed1b35cc590e2beaa595d710b09e1427c (patch) | |
tree | 73b97d5458deeea28aed2836d10c01880f208b3a | |
parent | cf0fd0ff3342fe1b9a028dca95b750f730e2afd6 (diff) | |
download | afl++-c2feee4ed1b35cc590e2beaa595d710b09e1427c.tar.gz |
Add platform check for `-A` CoreSight mode
REF: https://github.com/AFLplusplus/AFLplusplus/pull/1156#discussion_r747454306 Signed-off-by: Akira Moroo <retrage01@gmail.com>
-rw-r--r-- | src/afl-analyze.c | 6 | ||||
-rw-r--r-- | src/afl-fuzz.c | 7 | ||||
-rw-r--r-- | src/afl-showmap.c | 6 | ||||
-rw-r--r-- | src/afl-tmin.c | 6 |
4 files changed, 25 insertions, 0 deletions
diff --git a/src/afl-analyze.c b/src/afl-analyze.c index 4872c60d..6e1a9e7b 100644 --- a/src/afl-analyze.c +++ b/src/afl-analyze.c @@ -997,6 +997,12 @@ int main(int argc, char **argv_orig, char **envp) { if (cs_mode) { FATAL("Multiple -A options not supported"); } + if (!(__aarch64__ && __linux__)) { + + FATAL("-A option is not supported on this platform"); + + } + cs_mode = 1; fsrv.cs_mode = cs_mode; break; diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c index 6538e0a0..e6d9508b 100644 --- a/src/afl-fuzz.c +++ b/src/afl-fuzz.c @@ -830,6 +830,13 @@ int main(int argc, char **argv_orig, char **envp) { case 'A': /* CoreSight mode */ if (afl->fsrv.cs_mode) { FATAL("Multiple -A options not supported"); } + + if (!(__aarch64__ && __linux__)) { + + FATAL("-A option is not supported on this platform"); + + } + afl->fsrv.cs_mode = 1; break; diff --git a/src/afl-showmap.c b/src/afl-showmap.c index 57737562..0e7d9df6 100644 --- a/src/afl-showmap.c +++ b/src/afl-showmap.c @@ -1069,6 +1069,12 @@ int main(int argc, char **argv_orig, char **envp) { if (fsrv->cs_mode) { FATAL("Multiple -P options not supported"); } + if (!(__aarch64__ && __linux__)) { + + FATAL("-P option is not supported on this platform"); + + } + fsrv->cs_mode = true; break; diff --git a/src/afl-tmin.c b/src/afl-tmin.c index 42883404..110beed5 100644 --- a/src/afl-tmin.c +++ b/src/afl-tmin.c @@ -1040,6 +1040,12 @@ int main(int argc, char **argv_orig, char **envp) { if (fsrv->cs_mode) { FATAL("Multiple -A options not supported"); } + if (!(__aarch64__ && __linux__)) { + + FATAL("-A option is not supported on this platform"); + + } + fsrv->cs_mode = 1; break; |