Commit Graph
12 Commits
Author SHA1 Message Date
Anthony PERARD ee38108991 tools/fuzz/libelf: rework makefile
Rename ELF_LIB_OBJS to LIBELF_OBJS as to have the same name as in
libs/guest/.

Replace "-I" by "-iquote".

Remove the use of "vpath". It will not works when we will convert this
makefile to subdirmk. Instead, we create symlinks to the source files.

Since we are creating a new .gitignore for the links, also move the
existing entry to it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
2022-07-12 08:36:37 +02:00
Roger Pau Monné dec25a2cd1 libelf: don't attempt to parse __xen_guest for PVH
The legacy __xen_guest section doesn't support the PHYS32_ENTRY
elfnote, so it's pointless to attempt to parse the elfnotes from that
section when called from an hvm container.

Pass an hvm boolean parameter to the elf note parsing routine, so that
the respective parsing can be suppressed in case libelf is dealing with
an hvm container.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2021-05-28 09:13:32 +02:00
Petre Pircalabu f2b40dabab Makefile: Fix uninstall target
Running "make uninstall" does not remove all installed files, a
situation which might cause link related issues if xen is re-installed
in a different location.
In order to make uninstall correctly remove the files it is best
the process should be done recursively by mirroring each "install"
target with an "uninstall" who removes the installed files.

An exception to this rule is uninstalling the files produced by
"qemu-xen-dir-remote" and "qemu-xen-traditional-dir", which are external
to the project. These projects do not implement an "uninstall" target so
the files have to be removed manually.

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2017-07-28 17:47:42 +01:00
Andrew Cooper 3a54f72491 tools/fuzz: Include LLVMFuzzerTestOneInput() in the generated .a
Otherwise they are not suitable for use with libfuzz.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
2017-03-20 16:45:20 +00:00
Andrew Cooper 264efe24ff tools/fuzz: Use $(CC) for linking the harnesses
This is necessary to make use of compiler features such as UBSAN.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
2017-03-20 16:45:20 +00:00
Andrew Cooper cde043c55c tools/fuzz: Remove .d files in clean
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
2017-03-20 16:45:20 +00:00
Wei Liu 9d3226aa06 fuzz: don't buffer stdout in afl stubs
... to avoid obscuring output.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2017-02-01 11:25:26 +00:00
Wei Liu 4453129a0b fuzz/libelf: exit with fuzzer function return value
Now the function can return nonzero value. Use that value as exit code
for the stub program. AFL might be able to use such information to
optimise fuzzing process.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-01-26 17:23:40 +00:00
Wei Liu 53693bf3be fuzz/libelf: return early if elf_init fails
Coverity-ID: 1399557

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-01-26 17:23:40 +00:00
Wei Liu a304574abe tools/fuzz: add AFL stub program for libefl fuzzer
And hook it up into build system.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2017-01-25 10:00:33 +00:00
Wei Liu e23b93a334 tools/fuzz: make sure targets are always built
Invocation of `make' in top-level directory would end up invoking the
install target.

Adjust fuzzing target makefiles a bit so that they are always build in
that situation.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-01-24 16:24:50 +00:00
Wei Liu 4f62f31d25 tools/fuzz: introduce libelf target
Source code and Makefile to fuzz libelf in Google's oss-fuzz
infrastructure.

Introduce FUZZ_NO_LIBXC in libelf-private.h. That macro will be set when
compiling libelf fuzzer target because libxc is not required in libelf
fuzzing.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2016-12-13 10:25:57 +00:00