All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oss-fuzz: remove binaries from qemu-bundle tree
@ 2022-07-20  8:40 Paolo Bonzini
  2022-07-20 17:22 ` Alexander Bulekov
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2022-07-20  8:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Bulekov

oss-fuzz is finding possible fuzzing targets even under qemu-bundle/.../bin, but they
cannot be used because the required shared libraries are missing.  Since the
fuzzing targets are already placed manually in $OUT, the bindir and libexecdir
subtrees are not needed; remove them.

Cc: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/oss-fuzz/build.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
index 2656a89aea..5ee9141e3e 100755
--- a/scripts/oss-fuzz/build.sh
+++ b/scripts/oss-fuzz/build.sh
@@ -87,8 +87,10 @@ if [ "$GITLAB_CI" != "true" ]; then
     make "-j$(nproc)" qemu-fuzz-i386 V=1
 fi
 
-# Prepare a preinstalled tree
+# Place data files in the preinstall tree
 make install DESTDIR=$DEST_DIR/qemu-bundle
+rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/bin
+rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/libexec
 
 targets=$(./qemu-fuzz-i386 | awk '$1 ~ /\*/  {print $2}')
 base_copy="$DEST_DIR/qemu-fuzz-i386-target-$(echo "$targets" | head -n 1)"
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] oss-fuzz: remove binaries from qemu-bundle tree
  2022-07-20  8:40 [PATCH] oss-fuzz: remove binaries from qemu-bundle tree Paolo Bonzini
@ 2022-07-20 17:22 ` Alexander Bulekov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Bulekov @ 2022-07-20 17:22 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 220720 1040, Paolo Bonzini wrote:
> oss-fuzz is finding possible fuzzing targets even under qemu-bundle/.../bin, but they
> cannot be used because the required shared libraries are missing.  Since the
> fuzzing targets are already placed manually in $OUT, the bindir and libexecdir
> subtrees are not needed; remove them.

Thank you for catching this. OSS-Fuzz shouldn't be treating binaries in
subdirectories as fuzzers. For the initial integration we even had to
make modifications to how qemu looks for the datadir, because of this
requirement.. And at least parts of OSS-Fuzz will not try to look for
fuzzers in subdirectories. Thats why the build and build-checks have
been succeeding: 
https://oss-fuzz-build-logs.storage.googleapis.com/index.html#qemu
How fuzz targets are enumerated for the build-test:
https://github.com/google/oss-fuzz/blob/4138b03a9871e09d5d25753681c489aab006d830/infra/base-images/base-runner/test_all.py#L70

However, the oss-fuzz internals must be using some different method to
find targets, which looks in subdirectories, as well...

> 
> Cc: Alexander Bulekov <alxndr@bu.edu>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Alexander Bulekov <alxndr@bu.edu>

> ---
>  scripts/oss-fuzz/build.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/oss-fuzz/build.sh b/scripts/oss-fuzz/build.sh
> index 2656a89aea..5ee9141e3e 100755
> --- a/scripts/oss-fuzz/build.sh
> +++ b/scripts/oss-fuzz/build.sh
> @@ -87,8 +87,10 @@ if [ "$GITLAB_CI" != "true" ]; then
>      make "-j$(nproc)" qemu-fuzz-i386 V=1
>  fi
>  
> -# Prepare a preinstalled tree
> +# Place data files in the preinstall tree
>  make install DESTDIR=$DEST_DIR/qemu-bundle
> +rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/bin
> +rm -rf $DEST_DIR/qemu-bundle/opt/qemu-oss-fuzz/libexec
>  
>  targets=$(./qemu-fuzz-i386 | awk '$1 ~ /\*/  {print $2}')
>  base_copy="$DEST_DIR/qemu-fuzz-i386-target-$(echo "$targets" | head -n 1)"
> -- 
> 2.36.1
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-20 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20  8:40 [PATCH] oss-fuzz: remove binaries from qemu-bundle tree Paolo Bonzini
2022-07-20 17:22 ` Alexander Bulekov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.