From patchwork Fri Jun 23 12:20:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 695239 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp1920470wrm; Fri, 23 Jun 2023 05:23:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52GrD1ZM/TmPkQwYYRUKixGlujeO6+/GUs25CbNN5HP08v4GfqxzBCxn1N0BXJdMRPAdwt X-Received: by 2002:a05:620a:2610:b0:762:3a1f:4e8e with SMTP id z16-20020a05620a261000b007623a1f4e8emr24226248qko.7.1687523020199; Fri, 23 Jun 2023 05:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687523020; cv=none; d=google.com; s=arc-20160816; b=rZ6AyK98n+ZnKiIPdSZyHnBds8Pp+r5iNrA/snAfPwKHgQPA6jvPVP6WrG/zGt+nzU OjKdYAEoeZ3IRyzfXkbYj2nQhz66ztcsQLjAxt9ERjCjEKaXqI1Eo2JsHL717q6tHUu5 M4X/wfbTIuDXV9+4NtUB8ZanXAVCSszCZ7bslctB2pW4hk7AnNTSwAyRYrnYsb0mSDKO il9s6c4JiExQCnWA3SScUp1iMedxUN9u2pnwngAYa7Q4oprdTHCy8pdRw8jHCmPUocsG kXSO3xZ8qmU4bYsbnu0slQTHa7/pmRP7y+DXh2NNL7xVFeQOfnFjSK77orOt/KqxA3UQ dyjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aIzjiTDV01K3tkp9aXGFv1lByMVRceW6OmvT/ZDu2SA=; b=L6dBZvxZMaucYtLHGWXvJXJa6N9nOpiBqYXgeXu1NyBpkmAVawy1Kyje7yaZLUNp27 0UCZBMaWVoG5w/0zUTuwBBD8zUU2Tha05SmbylbpnsjBSmlMhVUmN1qkIHbRHNuCRL9s PAB03EWwXAnVN371TKzXUf4z6fettgpIRifm/T9efN++aec07gDCampaGsCbQAEla80j jSsmwmRt3UETX96wSev5X06GaGDL+E9Y1BPERdPyRNjT9X0ACBz8UIxkvw6DabEOVmg5 jaDOpgW0Xf+HlCZdRCIHl5G7yoT0dE0qvucYB+opphIMejUfYNcVTHJhwzJVdOEQzFfW NtNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhhD1kzf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y13-20020a05622a004d00b0040089a7bb48si471790qtw.35.2023.06.23.05.23.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Jun 2023 05:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhhD1kzf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCfo7-0005Be-Ph; Fri, 23 Jun 2023 08:22:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCfmu-0003o7-No for qemu-devel@nongnu.org; Fri, 23 Jun 2023 08:21:18 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCfmo-0003ia-LU for qemu-devel@nongnu.org; Fri, 23 Jun 2023 08:21:13 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f90b4ac529so7560935e9.0 for ; Fri, 23 Jun 2023 05:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687522867; x=1690114867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aIzjiTDV01K3tkp9aXGFv1lByMVRceW6OmvT/ZDu2SA=; b=jhhD1kzf5GakGGS11o9Xgpc+TvzmOHE/Dhkelon8pHh7LnhjVSV1STLaDM8aePaa1M 9KTEOloK7AwkYNphOeoU69nbmva/S+D+y8kj3YF66v3EMC37wNn+gFo9SfWZmzszeASy pvlAtwW6M3XykOKVXirNiehROQDZuT0rm73ahOD/2nsxtHm0LoaRhYVcK7SzYbLdMYuU y6f4owTMdEy9VvlraZeMccU5JVV4p7JZhmwrhA3yDxe/gT2tdw9fd/euPXsZpSa66hRf o5s3Z5DnkM493kKxHQ4PX2kLB/1DGjfLcwkqie952ESeZWAdyao7BQohqLUAzNBFQDtG qNqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687522867; x=1690114867; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aIzjiTDV01K3tkp9aXGFv1lByMVRceW6OmvT/ZDu2SA=; b=i8aSKJoLa/qwC8H1GSuSoXEtCCD4ywmDhaUNEuRYs71mN521qkKltM8O41Lng4gXl5 2k37DOu4dAL41axytXBc+VczP9kPKGP7pQ4hBapke64SzGJx4P87us3/G351wVFA9NWo Cuj2STHTVB3+qHOgDdP8Z4TQw/qzc/pMizuN6kuZzVDik7VWCtBvOwGMgallNzmyIBw/ O6y+NxDjBsCTCaCVxfrpH0yCgUvJz982MEKgnp6bkqprmDSkZFs9tivKFC5hXzLYx+UO UsbFLq6qjPwjX1dVOTYAQ2Kdovbooa78+SitKBL9BiUaDWGoqvopP5JFKbbD/QCdcTPL tc/w== X-Gm-Message-State: AC+VfDzTCwgl+eo9tAI32dJlz87p+JjW+neYhAo2/R8R6tASt3ssd/OK qW2/OpALvc2hzbkyXMWx2uNOKw== X-Received: by 2002:a05:600c:231a:b0:3f9:b430:199b with SMTP id 26-20020a05600c231a00b003f9b430199bmr9968001wmo.15.1687522866933; Fri, 23 Jun 2023 05:21:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g7-20020a7bc4c7000000b003f7eeec829asm2259310wmk.10.2023.06.23.05.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 05:21:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9582C1FFBC; Fri, 23 Jun 2023 13:21:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Juan Quintela , Peter Maydell , Cleber Rosa , Darren Kenny , Alexandre Iooss , Peter Xu , qemu-arm@nongnu.org, Eduardo Habkost , Riku Voipio , Mahmoud Mandour , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= , Paolo Bonzini , Bandan Das , Marcin Juszkiewicz , Radoslaw Biernacki , Alexander Bulekov , Leif Lindholm , Qiuhao Li , Wainer dos Santos Moschetta , Marcel Apfelbaum , Leonardo Bras , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Bin Meng , Thomas Huth , Beraldo Leal , Laurent Vivier , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 10/26] tests/docker: add test-fuzz Date: Fri, 23 Jun 2023 13:20:44 +0100 Message-Id: <20230623122100.1640995-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230623122100.1640995-1-alex.bennee@linaro.org> References: <20230623122100.1640995-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Running the fuzzer requires some hoop jumping and some problems only show up in containers. This basically replicates the build-oss-fuzz job from our CI so we can run in the same containers we use in CI. Signed-off-by: Alex Bennée --- tests/docker/test-fuzz | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 tests/docker/test-fuzz diff --git a/tests/docker/test-fuzz b/tests/docker/test-fuzz new file mode 100755 index 0000000000..7e506ae1f6 --- /dev/null +++ b/tests/docker/test-fuzz @@ -0,0 +1,28 @@ +#!/bin/bash -e +# +# Compile and check with oss-fuzz. +# +# Copyright (c) 2023 Linaro Ltd. +# +# Authors: +# Alex Bennée +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. common.rc + +requires_binary clang + +# the build script runs out of $src so we need to copy across +cd "$BUILD_DIR" +cp -a $QEMU_SRC . +cd src +mkdir build-oss-fuzz +export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt +env CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" ./scripts/oss-fuzz/build.sh +export ASAN_OPTIONS="fast_unwind_on_malloc=0" +for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f | grep -v slirp); do + grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ; + echo Testing ${fuzzer} ... ; + "${fuzzer}" -runs=1 -seed=1 || exit 1 ; +done