diff options
| author | Your Name <you@example.com> | 2021-08-27 18:38:22 +0100 |
|---|---|---|
| committer | Your Name <you@example.com> | 2021-08-27 18:38:58 +0100 |
| commit | 5559dd9c244848a1dbb19981f0295774f4e176d9 (patch) | |
| tree | 95b66fa3fe4afde786a7ec7567388a53eccccaaa /frida_mode/src/seccomp/seccomp_event.c | |
| parent | 7a2f81e0d992cf0f20d8d2fed26310c03c8b4fa9 (diff) | |
| download | afl++-5559dd9c244848a1dbb19981f0295774f4e176d9.tar.gz | |
Added seccomp support
Diffstat (limited to 'frida_mode/src/seccomp/seccomp_event.c')
| -rw-r--r-- | frida_mode/src/seccomp/seccomp_event.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/frida_mode/src/seccomp/seccomp_event.c b/frida_mode/src/seccomp/seccomp_event.c new file mode 100644 index 00000000..ecb9be32 --- /dev/null +++ b/frida_mode/src/seccomp/seccomp_event.c @@ -0,0 +1,45 @@ +#include <stdint.h> +#include <stdio.h> +#include <sys/eventfd.h> +#include <unistd.h> + +#include "debug.h" + +#include "seccomp.h" + +int seccomp_event_create(void) { + + int fd = eventfd(0, 0); + if (fd < 0) { FATAL("seccomp_event_create"); } + return fd; + +} + +void seccomp_event_signal(int fd) { + + uint64_t val = 1; + if (write(fd, &val, sizeof(uint64_t)) != sizeof(uint64_t)) { + + FATAL("seccomp_event_signal"); + + } + +} + +void seccomp_event_wait(int fd) { + + uint64_t val = 1; + if (read(fd, &val, sizeof(uint64_t)) != sizeof(uint64_t)) { + + FATAL("seccomp_event_wait"); + + } + +} + +void seccomp_event_destroy(int fd) { + + if (close(fd) < 0) { FATAL("seccomp_event_destroy"); } + +} + |
