tools/flask/utils/flask-setenforce
tools/flask/utils/flask-set-bool
tools/flask/utils/flask-label-pci
+tools/fuzz/libelf/afl-libelf-fuzzer
tools/fuzz/x86_instruction_emulator/x86_emulate*
tools/fuzz/x86_instruction_emulator/afl-x86-insn-emulator-fuzzer
tools/helpers/_paths.h
.PHONY: libelf-fuzzer-all
libelf-fuzzer-all: libelf.a libelf-fuzzer.o
+afl-libelf-fuzzer: afl-libelf-fuzzer.o libelf-fuzzer.o $(ELF_LIB_OBJS)
+
# Common targets
.PHONY: all
all: libelf-fuzzer-all
.PHONY: clean
clean:
- rm -f *.o *.a
+ rm -f *.o *.a *-libelf-fuzzer
.PHONY: install
install: all
+
+.PHONY: afl
+afl: afl-libelf-fuzzer
--- /dev/null
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+extern int LLVMFuzzerTestOneInput(const uint8_t *data_p, size_t size);
+
+#define INPUT_SIZE 4096
+static uint8_t input[INPUT_SIZE];
+
+int main(int argc, char **argv)
+{
+ size_t size;
+ FILE *fp;
+
+ if ( argc != 2 )
+ {
+ printf("Expecting only one argument\n");
+ exit(-1);
+ }
+
+ fp = fopen(argv[1], "rb");
+ if ( fp == NULL )
+ {
+ perror("fopen");
+ exit(-1);
+ }
+
+ size = fread(input, 1, INPUT_SIZE, fp);
+
+ if ( ferror(fp) )
+ {
+ perror("fread");
+ exit(-1);
+ }
+
+ if ( !feof(fp) )
+ {
+ printf("Input too large\n");
+ exit(-1);
+ }
+
+ fclose(fp);
+
+ LLVMFuzzerTestOneInput(input, size);
+
+ return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */