mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 13:58:05 +00:00
Add a new "fuzz" target that executes the fuzzers for 8192 runs each.
To run indefinately, set FUZZ_RUNS=-1, e.g. "make FUZZ_RUNS=-1 fuzz"
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: ISC
|
# SPDX-License-Identifier: ISC
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010-2015, 2017-2020 Todd C. Miller <Todd.Miller@sudo.ws>
|
# Copyright (c) 2010-2015, 2017-2021 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, and distribute this software for any
|
# Permission to use, copy, modify, and distribute this software for any
|
||||||
# purpose with or without fee is hereby granted, provided that the above
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -110,7 +110,7 @@ all: config.status
|
|||||||
exit $$?; \
|
exit $$?; \
|
||||||
done
|
done
|
||||||
|
|
||||||
check check-fuzzer pre-install: config.status
|
check check-fuzzer fuzz pre-install: config.status
|
||||||
for d in $(SUBDIRS); do \
|
for d in $(SUBDIRS); do \
|
||||||
(cd $$d && exec $(MAKE) $@) && continue; \
|
(cd $$d && exec $(MAKE) $@) && continue; \
|
||||||
exit $$?; \
|
exit $$?; \
|
||||||
|
@@ -406,6 +406,8 @@ pvs-log-files:
|
|||||||
|
|
||||||
pvs-studio:
|
pvs-studio:
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -104,6 +104,8 @@ pvs-log-files:
|
|||||||
|
|
||||||
pvs-studio:
|
pvs-studio:
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -90,6 +90,8 @@ pvs-log-files:
|
|||||||
|
|
||||||
pvs-studio:
|
pvs-studio:
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -146,6 +146,8 @@ cppcheck:
|
|||||||
|
|
||||||
pvs-log-files: $(POBJS)
|
pvs-log-files: $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: $(TEST_PROGS) check-fuzzer
|
check: $(TEST_PROGS) check-fuzzer
|
||||||
|
@@ -139,6 +139,8 @@ cppcheck:
|
|||||||
|
|
||||||
pvs-log-files: $(POBJS)
|
pvs-log-files: $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -87,6 +87,8 @@ FUZZ_PROGS = fuzz_iolog_json fuzz_iolog_legacy fuzz_iolog_timing
|
|||||||
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
||||||
FUZZ_LIBS = @LIBS@ $(LIB_FUZZING_ENGINE)
|
FUZZ_LIBS = @LIBS@ $(LIB_FUZZING_ENGINE)
|
||||||
FUZZ_LDFLAGS = @LDFLAGS@
|
FUZZ_LDFLAGS = @LDFLAGS@
|
||||||
|
FUZZ_MAX_LEN = 4096
|
||||||
|
FUZZ_RUNS = 8192
|
||||||
|
|
||||||
# Set to non-empty for development mode
|
# Set to non-empty for development mode
|
||||||
DEVEL = @DEVEL@
|
DEVEL = @DEVEL@
|
||||||
@@ -191,6 +193,23 @@ fuzz_iolog_json_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_iolog_json: fuzz_iolog_json
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/iolog_json; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_IOLOG_JSON_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_iolog_json -dict=$(srcdir)/regress/fuzz/fuzz_iolog_json.dict -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
fuzz_iolog_legacy_seed_corpus.zip:
|
fuzz_iolog_legacy_seed_corpus.zip:
|
||||||
tdir=fuzz_iolog_legacy.$$$$; \
|
tdir=fuzz_iolog_legacy.$$$$; \
|
||||||
mkdir $$tdir; \
|
mkdir $$tdir; \
|
||||||
@@ -200,6 +219,23 @@ fuzz_iolog_legacy_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_iolog_legacy: fuzz_iolog_legacy
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/iolog_legacy; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_IOLOG_LEGACY_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_iolog_legacy -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
fuzz_iolog_timing_seed_corpus.zip:
|
fuzz_iolog_timing_seed_corpus.zip:
|
||||||
tdir=fuzz_iolog_timing.$$$$; \
|
tdir=fuzz_iolog_timing.$$$$; \
|
||||||
mkdir $$tdir; \
|
mkdir $$tdir; \
|
||||||
@@ -209,6 +245,23 @@ fuzz_iolog_timing_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_iolog_timing: fuzz_iolog_timing
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/iolog_timing; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_IOLOG_TIMING_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_iolog_timing -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
pre-install:
|
pre-install:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@@ -239,6 +292,8 @@ cppcheck:
|
|||||||
|
|
||||||
pvs-log-files: $(POBJS)
|
pvs-log-files: $(POBJS)
|
||||||
|
|
||||||
|
fuzz: run-fuzz_iolog_json run-fuzz_iolog_legacy run-fuzz_iolog_timing
|
||||||
|
|
||||||
check-fuzzer: $(FUZZ_PROGS)
|
check-fuzzer: $(FUZZ_PROGS)
|
||||||
@if test X"$(cross_compiling)" != X"yes"; then \
|
@if test X"$(cross_compiling)" != X"yes"; then \
|
||||||
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
@@ -280,7 +335,8 @@ clean:
|
|||||||
-$(LIBTOOL) $(LTFLAGS) --mode=clean rm -f $(TEST_PROGS) $(FUZZ_PROGS) \
|
-$(LIBTOOL) $(LTFLAGS) --mode=clean rm -f $(TEST_PROGS) $(FUZZ_PROGS) \
|
||||||
*.lo *.o *.la
|
*.lo *.o *.la
|
||||||
-rm -f *.i *.plog stamp-* core *.core core.* regress/*/*.out \
|
-rm -f *.i *.plog stamp-* core *.core core.* regress/*/*.out \
|
||||||
regress/*/*.err
|
regress/*/*.err regress/corpus/iolog_json \
|
||||||
|
regress/corpus/iolog_legacy regress/corpus/iolog_timing
|
||||||
|
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
@@ -294,7 +350,9 @@ realclean: distclean
|
|||||||
|
|
||||||
cleandir: realclean
|
cleandir: realclean
|
||||||
|
|
||||||
.PHONY: clean mostlyclean distclean cleandir clobber realclean $(FUZZ_SEED_CORPUS)
|
.PHONY: clean mostlyclean distclean cleandir clobber realclean \
|
||||||
|
$(FUZZ_SEED_CORPUS) run-fuzz_iolog_json run-fuzz_iolog_legacy \
|
||||||
|
run-fuzz_iolog_timing
|
||||||
|
|
||||||
# Autogenerated dependencies, do not modify
|
# Autogenerated dependencies, do not modify
|
||||||
check_iolog_json.lo: $(srcdir)/regress/iolog_json/check_iolog_json.c \
|
check_iolog_json.lo: $(srcdir)/regress/iolog_json/check_iolog_json.c \
|
||||||
|
@@ -148,6 +148,8 @@ cppcheck:
|
|||||||
|
|
||||||
pvs-log-files: $(POBJS)
|
pvs-log-files: $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: ISC
|
# SPDX-License-Identifier: ISC
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011-2020 Todd C. Miller <Todd.Miller@sudo.ws>
|
# Copyright (c) 2011-2021 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, and distribute this software for any
|
# Permission to use, copy, modify, and distribute this software for any
|
||||||
# purpose with or without fee is hereby granted, provided that the above
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -116,6 +116,8 @@ FUZZ_PROGS = fuzz_sudo_conf
|
|||||||
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
||||||
FUZZ_LIBS = @LIBS@ $(LIB_FUZZING_ENGINE)
|
FUZZ_LIBS = @LIBS@ $(LIB_FUZZING_ENGINE)
|
||||||
FUZZ_LDFLAGS = @LDFLAGS@
|
FUZZ_LDFLAGS = @LDFLAGS@
|
||||||
|
FUZZ_MAX_LEN = 4096
|
||||||
|
FUZZ_RUNS = 8192
|
||||||
|
|
||||||
# User and group ids the installed files should be "owned" by
|
# User and group ids the installed files should be "owned" by
|
||||||
install_uid = 0
|
install_uid = 0
|
||||||
@@ -303,6 +305,23 @@ fuzz_sudo_conf_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_sudo_conf: fuzz_sudo_conf
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/sudo_conf; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_SUDO_CONF_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_sudo_conf -dict=$(srcdir)/regress/fuzz/fuzz_sudo_conf.dict -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
pre-install:
|
pre-install:
|
||||||
|
|
||||||
install: install-dirs
|
install: install-dirs
|
||||||
@@ -345,6 +364,8 @@ cppcheck:
|
|||||||
|
|
||||||
pvs-log-files: $(POBJS)
|
pvs-log-files: $(POBJS)
|
||||||
|
|
||||||
|
fuzz: run-fuzz_sudo_conf
|
||||||
|
|
||||||
check-fuzzer: $(FUZZ_PROGS)
|
check-fuzzer: $(FUZZ_PROGS)
|
||||||
@if test X"$(cross_compiling)" != X"yes"; then \
|
@if test X"$(cross_compiling)" != X"yes"; then \
|
||||||
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
@@ -465,6 +486,7 @@ clean:
|
|||||||
*.lo *.o *.la
|
*.lo *.o *.la
|
||||||
-rm -f *.i *.plog stamp-* core *.core core.* regress/*/*.out \
|
-rm -f *.i *.plog stamp-* core *.core core.* regress/*/*.out \
|
||||||
regress/*/*.err
|
regress/*/*.err
|
||||||
|
-rm -rf regress/corpus/sudo_conf
|
||||||
|
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
@@ -479,7 +501,8 @@ realclean: distclean
|
|||||||
|
|
||||||
cleandir: realclean
|
cleandir: realclean
|
||||||
|
|
||||||
.PHONY: clean mostlyclean distclean cleandir clobber realclean $(FUZZ_SEED_CORPUS)
|
.PHONY: clean mostlyclean distclean cleandir clobber realclean \
|
||||||
|
$(FUZZ_SEED_CORPUS) run-fuzz_sudo_conf
|
||||||
|
|
||||||
# Autogenerated dependencies, do not modify
|
# Autogenerated dependencies, do not modify
|
||||||
aix.lo: $(srcdir)/aix.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
|
aix.lo: $(srcdir)/aix.c $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
|
||||||
|
@@ -161,6 +161,8 @@ pvs-log-files:
|
|||||||
|
|
||||||
pvs-studio:
|
pvs-studio:
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: ISC
|
# SPDX-License-Identifier: ISC
|
||||||
#
|
#
|
||||||
# Copyright (c) 2019-2020 Todd C. Miller <Todd.Miller@sudo.ws>
|
# Copyright (c) 2019-2021 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, and distribute this software for any
|
# Permission to use, copy, modify, and distribute this software for any
|
||||||
# purpose with or without fee is hereby granted, provided that the above
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -106,6 +106,8 @@ FUZZ_PROGS = fuzz_logsrvd_conf
|
|||||||
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
||||||
FUZZ_LIBS = $(LIBS) $(LIB_FUZZING_ENGINE)
|
FUZZ_LIBS = $(LIBS) $(LIB_FUZZING_ENGINE)
|
||||||
FUZZ_LDFLAGS = $(LDFLAGS)
|
FUZZ_LDFLAGS = $(LDFLAGS)
|
||||||
|
FUZZ_MAX_LEN = 4096
|
||||||
|
FUZZ_RUNS = 8192
|
||||||
|
|
||||||
# User and group IDs the installed files should be "owned" by
|
# User and group IDs the installed files should be "owned" by
|
||||||
install_uid = 0
|
install_uid = 0
|
||||||
@@ -175,6 +177,23 @@ fuzz_logsrvd_conf_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_logsrvd_conf: fuzz_logsrvd_conf
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/logsrvd_conf; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_LOGSRVD_CONF_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_logsrvd_conf -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
pre-install:
|
pre-install:
|
||||||
|
|
||||||
install: install-binaries
|
install: install-binaries
|
||||||
@@ -217,6 +236,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz: run-fuzz_logsrvd_conf
|
||||||
|
|
||||||
check-fuzzer: $(FUZZ_PROGS)
|
check-fuzzer: $(FUZZ_PROGS)
|
||||||
@if test X"$(cross_compiling)" != X"yes"; then \
|
@if test X"$(cross_compiling)" != X"yes"; then \
|
||||||
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
@@ -237,6 +258,7 @@ clean:
|
|||||||
-$(LIBTOOL) $(LTFLAGS) --mode=clean rm -f $(PROGS) $(FUZZ_PROGS) \
|
-$(LIBTOOL) $(LTFLAGS) --mode=clean rm -f $(PROGS) $(FUZZ_PROGS) \
|
||||||
*.lo *.o *.la
|
*.lo *.o *.la
|
||||||
-rm -f *.i *.plog stamp-* core *.core core.*
|
-rm -f *.i *.plog stamp-* core *.core core.*
|
||||||
|
-rm -rf regress/corpus/logsrvd_conf
|
||||||
|
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
@@ -250,7 +272,8 @@ realclean: distclean
|
|||||||
|
|
||||||
cleandir: realclean
|
cleandir: realclean
|
||||||
|
|
||||||
.PHONY: clean mostlyclean distclean cleandir clobber realclean $(FUZZ_SEED_CORPUS)
|
.PHONY: clean mostlyclean distclean cleandir clobber realclean \
|
||||||
|
$(FUZZ_SEED_CORPUS) run-fuzz_logsrvd_conf
|
||||||
|
|
||||||
# Autogenerated dependencies, do not modify
|
# Autogenerated dependencies, do not modify
|
||||||
fuzz_logsrvd_conf.o: $(srcdir)/regress/fuzz/fuzz_logsrvd_conf.c \
|
fuzz_logsrvd_conf.o: $(srcdir)/regress/fuzz/fuzz_logsrvd_conf.c \
|
||||||
|
@@ -181,6 +181,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -184,6 +184,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -220,6 +220,8 @@ realclean: distclean
|
|||||||
|
|
||||||
cleandir: realclean
|
cleandir: realclean
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: $(TEST_PROGS) check-fuzzer
|
check: $(TEST_PROGS) check-fuzzer
|
||||||
|
@@ -179,6 +179,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -181,6 +181,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -165,6 +165,8 @@ FUZZ_PROGS = fuzz_policy fuzz_sudoers fuzz_sudoers_ldif
|
|||||||
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
FUZZ_SEED_CORPUS = ${FUZZ_PROGS:=_seed_corpus.zip}
|
||||||
FUZZ_LIBS = libparsesudoers.la @SUDOERS_LIBS@ $(LIB_FUZZING_ENGINE)
|
FUZZ_LIBS = libparsesudoers.la @SUDOERS_LIBS@ $(LIB_FUZZING_ENGINE)
|
||||||
FUZZ_LDFLAGS = @LDFLAGS@
|
FUZZ_LDFLAGS = @LDFLAGS@
|
||||||
|
FUZZ_MAX_LEN = 4096
|
||||||
|
FUZZ_RUNS = 8192
|
||||||
|
|
||||||
AUTH_OBJS = sudo_auth.lo @AUTH_OBJS@
|
AUTH_OBJS = sudo_auth.lo @AUTH_OBJS@
|
||||||
|
|
||||||
@@ -404,6 +406,23 @@ fuzz_policy_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_policy: fuzz_policy
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/policy; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_POLICY_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_policy -dict=$(srcdir)/regress/fuzz/fuzz_policy.dict -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
fuzz_sudoers_seed_corpus.zip:
|
fuzz_sudoers_seed_corpus.zip:
|
||||||
tdir=fuzz_sudoers.$$$$; \
|
tdir=fuzz_sudoers.$$$$; \
|
||||||
mkdir $$tdir; \
|
mkdir $$tdir; \
|
||||||
@@ -413,6 +432,23 @@ fuzz_sudoers_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_sudoers: fuzz_sudoers
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/sudoers; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_SUDOERS_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_sudoers -dict=$(srcdir)/regress/fuzz/fuzz_sudoers.dict -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
fuzz_sudoers_ldif_seed_corpus.zip:
|
fuzz_sudoers_ldif_seed_corpus.zip:
|
||||||
tdir=fuzz_sudoers_ldif.$$$$; \
|
tdir=fuzz_sudoers_ldif.$$$$; \
|
||||||
mkdir $$tdir; \
|
mkdir $$tdir; \
|
||||||
@@ -422,6 +458,23 @@ fuzz_sudoers_ldif_seed_corpus.zip:
|
|||||||
zip -j $@ $$tdir/*; \
|
zip -j $@ $$tdir/*; \
|
||||||
rm -rf $$tdir
|
rm -rf $$tdir
|
||||||
|
|
||||||
|
run-fuzz_sudoers_ldif: fuzz_sudoers_ldif
|
||||||
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
|
LC_ALL=C.UTF-8; export LC_ALL; \
|
||||||
|
else \
|
||||||
|
LC_ALL=C; export LC_ALL; \
|
||||||
|
fi; \
|
||||||
|
unset LANG || LANG=; \
|
||||||
|
MALLOC_OPTIONS=S; export MALLOC_OPTIONS; \
|
||||||
|
MALLOC_CONF="abort:true,junk:true"; export MALLOC_CONF; \
|
||||||
|
umask 022; \
|
||||||
|
corpus=regress/corpus/sudoers_ldif; \
|
||||||
|
mkdir -p $$corpus; \
|
||||||
|
for f in $(FUZZ_SUDOERS_LDIF_CORPUS); do \
|
||||||
|
cp $$f $$corpus; \
|
||||||
|
done; \
|
||||||
|
./fuzz_sudoers_ldif -dict=$(srcdir)/regress/fuzz/fuzz_sudoers_ldif.dict -max_len=$(FUZZ_MAX_LEN) -runs=$(FUZZ_RUNS) $$corpus
|
||||||
|
|
||||||
GENERATED = gram.h gram.c toke.c def_data.c def_data.h getdate.c
|
GENERATED = gram.h gram.c toke.c def_data.c def_data.h getdate.c
|
||||||
|
|
||||||
prologue:
|
prologue:
|
||||||
@@ -551,6 +604,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz: run-fuzz_policy run-fuzz_sudoers run-fuzz_sudoers_ldif
|
||||||
|
|
||||||
check-fuzzer: $(FUZZ_PROGS)
|
check-fuzzer: $(FUZZ_PROGS)
|
||||||
@if test X"$(cross_compiling)" != X"yes"; then \
|
@if test X"$(cross_compiling)" != X"yes"; then \
|
||||||
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
if locale -a 2>&1 | grep '^C.UTF-8$$' >/dev/null 2>&1; then \
|
||||||
@@ -741,7 +796,8 @@ clean:
|
|||||||
-rm -f *.i *.plog stamp-* core *.core core.* prologue regress/*/*.out \
|
-rm -f *.i *.plog stamp-* core *.core core.* prologue regress/*/*.out \
|
||||||
regress/*/*.toke regress/*/*.err regress/*/*.json \
|
regress/*/*.toke regress/*/*.err regress/*/*.json \
|
||||||
regress/*/*.ldif regress/*/*.ldif2sudo regress/*/*.sudo
|
regress/*/*.ldif regress/*/*.ldif2sudo regress/*/*.sudo
|
||||||
-rm -rf regress/iolog_plugin/iolog
|
-rm -rf regress/iolog_plugin/iolog regress/corpus/policy \
|
||||||
|
regress/corpus/sudoers regress/corpus/sudoers_ldif
|
||||||
|
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
@@ -759,7 +815,9 @@ realclean: distclean
|
|||||||
|
|
||||||
cleandir: realclean
|
cleandir: realclean
|
||||||
|
|
||||||
.PHONY: clean mostlyclean distclean cleandir clobber realclean $(FUZZ_SEED_CORPUS)
|
.PHONY: clean mostlyclean distclean cleandir clobber realclean \
|
||||||
|
$(FUZZ_SEED_CORPUS) run-fuzz_policy run-fuzz_sudoers \
|
||||||
|
run-fuzz_sudoers_ldif
|
||||||
|
|
||||||
# Autogenerated dependencies, do not modify
|
# Autogenerated dependencies, do not modify
|
||||||
afs.lo: $(authdir)/afs.c $(authdir)/sudo_auth.h $(devdir)/def_data.h \
|
afs.lo: $(authdir)/afs.c $(authdir)/sudo_auth.h $(devdir)/def_data.h \
|
||||||
|
@@ -184,6 +184,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: check-fuzzer
|
check: check-fuzzer
|
||||||
|
@@ -265,6 +265,8 @@ pvs-log-files: $(POBJS)
|
|||||||
pvs-studio: $(POBJS)
|
pvs-studio: $(POBJS)
|
||||||
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
plog-converter $(PVS_LOG_OPTS) $(POBJS)
|
||||||
|
|
||||||
|
fuzz:
|
||||||
|
|
||||||
check-fuzzer:
|
check-fuzzer:
|
||||||
|
|
||||||
check: $(TEST_PROGS) check-fuzzer
|
check: $(TEST_PROGS) check-fuzzer
|
||||||
|
Reference in New Issue
Block a user