[vlc-devel] [PATCH] add libfuzzer support
Rémi Denis-Courmont
remi at remlab.net
Wed Jun 21 15:17:38 CEST 2017
Le 21 juin 2017 15:36:50 GMT+03:00, Shaleen Jain <shaleen.jain95 at gmail.com> a écrit :
>---
> .gitignore | 1 +
> configure.ac | 8 ++++++++
> test/Makefile.am | 2 ++
> test/fuzz/Makefile.am | 19 +++++++++++++++++++
> 4 files changed, 30 insertions(+)
> create mode 100644 test/fuzz/Makefile.am
>
>diff --git a/.gitignore b/.gitignore
>index 0b0ee9cc20..fcd0e59213 100644
>--- a/.gitignore
>+++ b/.gitignore
>@@ -45,6 +45,7 @@ wxvlc
> vlc_install_dir/*
> plugins.dat
> patches/*
>+*_fuzzer
>
> include/vlc/libvlc_version.h
>
>diff --git a/configure.ac b/configure.ac
>index 67fc7deb1a..c289b69510 100644
>--- a/configure.ac
>+++ b/configure.ac
>@@ -94,6 +94,13 @@ AS_IF([test -n "${with_binary_version}"],[
> [Binary specific version])
> ])
>
>+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
>+#if !defined(__clang__)
>+#error
>+#endif])], have_clang=yes, have_clang=no)
>+
>+AM_CONDITIONAL(HAVE_CLANG, test "x$have_clang" = "xyes")
>+
> dnl
> dnl Check the operating system
> dnl
>@@ -4248,6 +4255,7 @@ AC_CONFIG_FILES([
> lib/Makefile
> bin/Makefile
> test/Makefile
>+ test/fuzz/Makefile
> modules/hw/mmal/Makefile
> share/vlc.appdata.xml.in
> ])
>diff --git a/test/Makefile.am b/test/Makefile.am
>index 95d4df6516..30c1bb56b6 100644
>--- a/test/Makefile.am
>+++ b/test/Makefile.am
>@@ -4,6 +4,8 @@
>
> AUTOMAKE_OPTIONS = subdir-objects
>
>+SUBDIRS = fuzz
>+
> extra_check_verbose = $(extra_check_verbose_$(V))
> extra_check_verbose_ = $(extra_check_flags__$(AM_DEFAULT_VERBOSITY))
> extra_check_verbose_0 = @echo TEST $@
>diff --git a/test/fuzz/Makefile.am b/test/fuzz/Makefile.am
>new file mode 100644
>index 0000000000..57eb04f13f
>--- /dev/null
>+++ b/test/fuzz/Makefile.am
>@@ -0,0 +1,19 @@
>+AUTOMAKE_OPTIONS = subdir-objects
>+
>+AM_CXXFLAGS = -fsanitize=address -fsanitize-address-use-after-scope
>-fsanitize=undefined -fno-sanitize-recover=undefined
>+if HAVE_CLANG
>+AM_CXXFLAGS += -fsanitize-coverage=trace-pc-guard,trace-cmp
>+else
>+AM_CXXFLAGS += -fsanitize-coverage=trace-pc
>+endif
>+
>+LIBVLCCORE = ../../src/libvlccore.la
>+LIBVLC = ../../lib/libvlc.la
>+
>+LDADD = $(LIBVLCCORE) $(LIBVLC) -L./ -lFuzzer
>+
>+check_PROGRAMS = \
>+ libvlc_demux_fuzzer
>+
>+libvlc_demux_fuzzer_SOURCES = libvlc_demux_fuzzer.cpp
>+
>--
>2.13.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
Hello,
AFAIK, this won't work. You need to build the entire tree with sanitizers, not just the fuzzing binary.
The source code is missing too. But, I don't think that this should be published, as it helps potentially hostile third parties with better computational power than it helps us. That is why I did not publish my own AFL and libfuzzer VLC frontends.
--
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170621/911db737/attachment.html>
More information about the vlc-devel
mailing list