From patchwork Mon Jun 26 21:59:09 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: 696500 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3447131wrm; Mon, 26 Jun 2023 15:01:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5cIwM10igr+AYwY+KOUYsMzofd45tF9l/RPQigrvFhCDdmYMU6R9OeOfJ6roRy8gAjSJLi X-Received: by 2002:ad4:5bca:0:b0:631:f426:a4ab with SMTP id t10-20020ad45bca000000b00631f426a4abmr24298616qvt.49.1687816892996; Mon, 26 Jun 2023 15:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687816892; cv=none; d=google.com; s=arc-20160816; b=rvjPUv3/oeWKxBx3NrUYOp8fuQEP8896hylC6b57X8th8V2a0PODc2GrT/SOzPQUN6 vBDL4ZHYDZUFJBLe9wJUfbMYLdz/lKbfFY/z1jj6KyRgYPOw6MoTQnn0tHNN5u599q2l ZOB8llehCrHGm6RMMNwfHzT3t80bsd+MpqNCxP3OqLtwpHG92Bb55IqGifv1Aqcv1ide XKsZfiDzN0Y4jiOC4YvT9RoL3U3CF9Ay26WrebLEmVCQHbPmQ0nQbFEBOdANhPFzKy+s id1v1ngkrA8gS05lHoo+yqBB8nmUP0mSidjH/Ymc7gJ9kwBCaWBKNCnrtkCktpVIWi39 wa6g== 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=; fh=sQEya64SXtq2IEsk3H77u01QQAMvGjGQGvqUW/mcVd0=; b=H0fdmmZuRl0iPZ3i6OwSUyrQ4X0GuYFUCgtVf/3zzxETut7TmtshULiYFRsRnPgwaj Bwi/a4AH2CkbmP2m8vK6mPYjo+y5Qp69rKVeVWydvzIArV+FgPmiN0FPlAnprC+QmxcK nlGKQmnpJrE65ZudV3/Sp1cDKM3qL4Djl59rPbgsNudFzejOZmiT888Xr9UgtaJtR7Vo I/DrShvZJLcPPRyYN8vua7kiX94N3grSsLCd8ncArjAkIRP5x6xlezdUpf8owUu97F04 FMmJ73iMEojg9zKZsodi/7BEil08ff44lJPFV3+1mwD0CG2ZiRFXuWAKCmsQDgF79dbx uKFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=arsa3zJu; 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 uw4-20020a05620a4d8400b00765abebc125si969655qkn.583.2023.06.26.15.01.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jun 2023 15:01:32 -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=arsa3zJu; 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 1qDuFK-0002fm-08; Mon, 26 Jun 2023 17:59:42 -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 1qDuFE-0002ac-Vf for qemu-devel@nongnu.org; Mon, 26 Jun 2023 17:59:36 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDuFA-0004rv-Da for qemu-devel@nongnu.org; Mon, 26 Jun 2023 17:59:36 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fb5bcb9a28so2594030e87.3 for ; Mon, 26 Jun 2023 14:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687816771; x=1690408771; 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=arsa3zJuB8XBMBg8nGs4O26+56wGfrTF05JJULFWLegP/UbPUp1dzrkKU3xmkWUR1H vCJ5I+LjvoEEeSIKXcmc+M0xMRzqUxwfI2BPZd8joL/WsfSt6IOy9o2G3Uq3j7rMLM23 SbWHwKRoiIrw3j1PTVWRVTmLF1xBjN3mkbahkCzKIWmrbnaDVdaw3YiOUR9ej1H2/E3z dt+otFq/xYP0quS3t/nos/ebclahFp+37WGJ4jxcABoQmq1ZfLlgmC5s+cDHq1C5XuHr GXbJboXAkRUuA7CFkcx8brYK4VAXyy4zJ71IkRbVl5rsyuzAgtp+/ix6D1+KvyqiXX9a YvKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687816771; x=1690408771; 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=GN5osk0VYiIgAM9klAG0Wk0y6bG5K7UoT/BPD8EpJBevB71Vg7rqJ8xSzLA3pFa7P8 Vn/r0DfUK5UC9veOd1cI7erWPdCxTusV/c12kg7SoNvzArqXXiXNE+j4IVyQpJcyI60I WVEwG/eTXCvitahP+XzMTpCFnyN8/F2ESzom6WJytF4bjH0bnf1e/UIsMGU0xreLjz8U VhWMcwfOAwGUyHdJnfBPRiHnb+BSVwwa0N6JoVFitDtYwp2ewU802pKpigTcoYsV3zJq mbKvUvhh82tb1gQF2ZPMOOdTs8LZCX2E2onYxpH50JHjr1JVrRHCMF45S2jxfQlkvkiv jktw== X-Gm-Message-State: AC+VfDzjpPFJ/ylE/1IOfdwFtYSoX1WwX3G3o23m9bD9YgIckbSxJF1K 2fXvc2FxLG6QIWaBSTvhAj1y+w== X-Received: by 2002:a05:6512:ba9:b0:4fb:83fd:f6a9 with SMTP id b41-20020a0565120ba900b004fb83fdf6a9mr82631lfv.7.1687816770751; Mon, 26 Jun 2023 14:59:30 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t8-20020a1c7708000000b003f50d6ee334sm8708659wmi.47.2023.06.26.14.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 14:59:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D0D571FFC4; Mon, 26 Jun 2023 22:59:27 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexander Bulekov , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Juan Quintela , Alexandre Iooss , Thomas Huth , Marcel Apfelbaum , Leif Lindholm , Riku Voipio , Peter Maydell , Paolo Bonzini , Bandan Das , Leonardo Bras , Cleber Rosa , Richard Henderson , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mahmoud Mandour , Stefan Hajnoczi , Yanan Wang , Eduardo Habkost , Bin Meng , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Darren Kenny , Radoslaw Biernacki , Marcin Juszkiewicz , Qiuhao Li , Laurent Vivier Subject: [PATCH v2 09/26] tests/docker: add test-fuzz Date: Mon, 26 Jun 2023 22:59:09 +0100 Message-Id: <20230626215926.2522656-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230626215926.2522656-1-alex.bennee@linaro.org> References: <20230626215926.2522656-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12b.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 Reviewed-by: Alexander Bulekov --- 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