From patchwork Tue May 12 03:01:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Bulekov X-Patchwork-Id: 282975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5A4AC47255 for ; Tue, 12 May 2020 03:18:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 93A0620661 for ; Tue, 12 May 2020 03:18:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=bushare.onmicrosoft.com header.i=@bushare.onmicrosoft.com header.b="ldoS+8ug" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93A0620661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bu.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYLRO-0001V1-Lt for qemu-devel@archiver.kernel.org; Mon, 11 May 2020 23:18:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYLPa-0006Qm-1G for qemu-devel@nongnu.org; Mon, 11 May 2020 23:16:54 -0400 Received: from mail-eopbgr750109.outbound.protection.outlook.com ([40.107.75.109]:56482 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYLPY-0004Kx-DD for qemu-devel@nongnu.org; Mon, 11 May 2020 23:16:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g1FZtlpMvklf/yaUwYfBVF0yVLBvt4fApQvg9B8+8DUWuM7RbpSz0DDCZFIa961u+YhjQY1BwPCbCQMs6ZjAk7I7Owj+i+bjCCBm0vjgiwsqLnvu78pBR/WC5uHj7Kk/dE85Z3bqQW2hczsER+ewSxNT8y6E9bo7RqqDvYB30V6a5kGDtq/gf645E+oY+gQf2Zf1u8QfzaiOpzJjqG8h4lcDLoFL6Ee7tCqwuJtWxUIeykVpxE1ETmEHdcbCeYh1ijVPQvgY7zTe/beD+AlrV7XkelqGYz13cllD4yxmxQjtuvJetA7wKfclgQR/nVzbTMZy35qy+27mbIlasgZNqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IkAf2SqTvUp39W77N2uaZR3cGXl6YvhvrW9BvtwkEOs=; b=a64JSqk/JMtAbDM/w1yEmnu2R9UZHoPZR9CytO10hEW7rW9rEVLfypTmOpIwKxcQJ51o092GmiS9UiPnLYxveaspXcAnsQ32R3IXoilElcJR1ossUIQXgbU0t7LCpF+pSq5+l4JbQKJWE3T38UsKsviHUr6PTDdk5veS4eBrz9hSz0Scq+copsb5Xb8uiFxggXVc/TqmcpnIZkqmqc8buHDpe1b60q2O/7JiiosggALFJXO22dpywWCw5EllaLhIeqzYSIpSaP7j8/ITXgf8zrFL499bzt8rCp0jRnUUJvI41XvR1zRgx0HZl8ydu/huQgyMNq4YlJPsNwdNyi8zKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bu.edu; dmarc=pass action=none header.from=bu.edu; dkim=pass header.d=bu.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bushare.onmicrosoft.com; s=selector2-bushare-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IkAf2SqTvUp39W77N2uaZR3cGXl6YvhvrW9BvtwkEOs=; b=ldoS+8ug/E48AbK/s42qFFB+wAjHDjDPJOWRlt+d35zEfJb9lU9ez04bM+2U+qE+3/eKWEXw2qEWm2aLELEvbDJk4N8AVHrfqzdlzgdYjH9+fSB9c3ubnklzhDxLfTVUXDcnKmwXPH2fI6NJJDw34KzCv+Ya5mGK7Z/JVc37LmQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=bu.edu; Received: from SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) by SN6PR03MB3520.namprd03.prod.outlook.com (2603:10b6:805:4d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 03:01:47 +0000 Received: from SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::640a:1123:37c1:42db]) by SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::640a:1123:37c1:42db%3]) with mapi id 15.20.2979.033; Tue, 12 May 2020 03:01:47 +0000 From: Alexander Bulekov To: qemu-devel@nongnu.org Subject: [PATCH 1/4] fuzz: add datadir for oss-fuzz compatability Date: Mon, 11 May 2020 23:01:30 -0400 Message-Id: <20200512030133.29896-2-alxndr@bu.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512030133.29896-1-alxndr@bu.edu> References: <20200512030133.29896-1-alxndr@bu.edu> X-ClientProxiedBy: MN2PR12CA0025.namprd12.prod.outlook.com (2603:10b6:208:a8::38) To SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mozz.bu.edu (128.197.127.33) by MN2PR12CA0025.namprd12.prod.outlook.com (2603:10b6:208:a8::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Tue, 12 May 2020 03:01:46 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [128.197.127.33] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c46cdd6-f476-4025-7e36-08d7f620cecb X-MS-TrafficTypeDiagnostic: SN6PR03MB3520: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eBtpi54Rusd5TuYYt4FWtdwleCjcHt9HYw5zcmLz7MZURhH9bOP/vZU3qyeKFAxlagoYgK+lCvSvjcjwc8QVVh8183Zw1pabB1+t2eYQGKUq9rfiAc6s9ivHvKsERb0bfTvGPGLVyKfLbqXAd52OmQdRwW3qmGXZkaCH5q12eNXMxrTdNh3rffUvsPuYLSy0NQc0o4HhjDUshvP23UHNFAa4woxL0PXkFqeIqSrztY5+R54mae5PHHalQrVqLVAn9iYux22ri3dzCd2p9IVH0UTuUmB+A4w/iFYh4laPSvm8SluleAE/vGiXeycBNIIVvfo8wU5UimiFboFadIMYh1kWTM6Xp8RtoRpQxW87lXMo05Z0mZE3EM8cb53K/IofwnLXNhmR8YkqNALT74vra1zlGAgdORxiTOcbK5/fXhqzY4YtzXt27V/zpKEs+lfuAsjWW8cqqfuphPl/8U4U6G1GGGBonZ/NuLaF4fNp3p57thRFt+1kBpjnbdgaLmM83vkPALRMC3h4ecOoPCglWQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR03MB3871.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(366004)(396003)(376002)(136003)(39860400002)(33430700001)(956004)(4326008)(6666004)(2616005)(8936002)(5660300002)(7696005)(316002)(786003)(66476007)(66946007)(52116002)(54906003)(66556008)(6916009)(26005)(75432002)(186003)(86362001)(16526019)(6486002)(2906002)(33440700001)(478600001)(1076003)(36756003)(8676002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: BpFaEkNOSUgx362KDeJnpOT3+rm+c5jgMmjlGXOXe3d4pAYBJ0pBn1vs7+eFY5lPpcivuU3MmRPyIVHvoCzfA3dXP+1802KAO7ttdbigcUFUbzjwd9aRaUtbQ5msbet9bOEhaiuAX/3L/mN5qyXvXSoNzNcgQgvEhqXh6vimY5o3I1qZQjwLzVZXJfvrXVg9YXpwf/TJen/QwI8PWDb3UQ2vITozg8aqr7dM625+ANO3AJ8jHiaUgpbmJWaVs6vj2F9h0jdh74mS3Y2joecR8tOfeCPLwKsg9K+4kPEWWYAoPKXocRS1P59o4rdCH2UOrOFs48012qDXNoE3NSscyXbuUF+YfgJoNowETnDt+++Gt7hkVypkV472TgHRvmCGAgO7x4GcrMahFrR3KYE7oZeL6nQzeMp4qmKMWhuYgnBlX1Un55M9/2ZCLeEe1tHcmzrEJjMozc6gWXk36CojVcIYWfdfQCkr/k0/sob3WyU= X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 1c46cdd6-f476-4025-7e36-08d7f620cecb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 03:01:46.7572 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d57d32cc-c121-488f-b07b-dfe705680c71 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tfMTp1H/ubzZCycsLxobhs5ExitDYYpzMLM5yoz5ScSaWdS9AL2t2anTZ1U2Pl1A X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3520 Received-SPF: pass client-ip=40.107.75.109; envelope-from=alxndr@bu.edu; helo=NAM02-BL2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 23:16:50 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HK_RANDOM_ENVFROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Alexander Bulekov , darren.kenny@oracle.com, bsd@redhat.com, stefanha@redhat.com, Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This allows us to keep pc-bios in executable_dir/pc-bios, rather than executable_dir/../pc-bios, which is incompatible with oss-fuzz' file structure. Signed-off-by: Alexander Bulekov --- include/sysemu/sysemu.h | 2 ++ softmmu/vl.c | 2 +- tests/qtest/fuzz/fuzz.c | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index ef81302e1a..cc96b66fc9 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -15,6 +15,8 @@ extern const char *qemu_name; extern QemuUUID qemu_uuid; extern bool qemu_uuid_set; +void qemu_add_data_dir(const char *path); + void qemu_add_exit_notifier(Notifier *notify); void qemu_remove_exit_notifier(Notifier *notify); diff --git a/softmmu/vl.c b/softmmu/vl.c index afd2615fb3..c71485a965 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1993,7 +1993,7 @@ char *qemu_find_file(int type, const char *name) return NULL; } -static void qemu_add_data_dir(const char *path) +void qemu_add_data_dir(const char *path) { int i; diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index f5c923852e..33365c3782 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -137,6 +137,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp) { char *target_name; + char *dir; /* Initialize qgraph and modules */ qos_graph_init(); @@ -147,6 +148,20 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp) target_name = strstr(**argv, "-target-"); if (target_name) { /* The binary name specifies the target */ target_name += strlen("-target-"); + /* + * With oss-fuzz, the executable is kept in the root of a directory (we + * cannot assume the path). All data (including bios binaries) must be + * in the same dir, or a subdir. Thus, we cannot place the pc-bios so + * that it would be in exec_dir/../pc-bios. + * As a workaround, oss-fuzz allows us to use argv[0] to get the + * location of the executable. Using this we add exec_dir/pc-bios to + * the datadirs. + */ + dir = g_build_filename(g_path_get_dirname(**argv), "pc-bios", NULL); + if (g_file_test(dir, G_FILE_TEST_IS_DIR)) { + qemu_add_data_dir(dir); + } + g_free(dir); } else if (*argc > 1) { /* The target is specified as an argument */ target_name = (*argv)[1]; if (!strstr(target_name, "--fuzz-target=")) { From patchwork Tue May 12 03:01:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Bulekov X-Patchwork-Id: 282982 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81ACAC47255 for ; Tue, 12 May 2020 03:02:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A65A20757 for ; Tue, 12 May 2020 03:02:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=bushare.onmicrosoft.com header.i=@bushare.onmicrosoft.com header.b="zynkbV7G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A65A20757 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bu.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYLC0-0008Ra-Gw for qemu-devel@archiver.kernel.org; Mon, 11 May 2020 23:02:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYLB9-0007Mu-Qo for qemu-devel@nongnu.org; Mon, 11 May 2020 23:01:59 -0400 Received: from mail-mw2nam12on2098.outbound.protection.outlook.com ([40.107.244.98]:45797 helo=NAM12-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYLB9-0007mk-1C for qemu-devel@nongnu.org; Mon, 11 May 2020 23:01:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTmdHuStA2vDiXplufcRTsY68QkGZ/hyMQkQr7YfQ3RLtLgPQzNVz0bho1viO6aabwWgOKJZKFCuBMzGR4hGlqWS8Y6DPxRvZUFLOR1DikYqn/dt79Hp4htyPWzioCfdnayANv0NGyHf07VpYAYF0IYaZRy6R8hMENFOaDHIv42A7aeyPuiAyqfB+LHUOk1LJYb7baVBiWY/+hechPV2HYwHGVRDbk7UNIWp5F6GrQ58DhMOE/8OTs+Z+Uhysb2zXYL46mtj/uSOT6sttQVdSpi2ybPkj1EQgbZESrMAF1G0KbRZHfHEQHmHP3I7lYrVpjWACb2fnTCqYVpmITMCKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v7FY7X0Tf82uRydOo0ch4U/UHz2NVLHI5HNmP56ejEc=; b=ZdBnwHq5CLkyUSuUxAvoCk7mojcIrTDklJiiNNLKOIMW9QiTYwcvec/yHo4iRdRqooAPpqitet1En1c22caJPlh186s/IYGr0KOAw1qlHXMXFP10jd0bBqP+rE/qSCC1ORad+FVcFrPBykyWDrZ83VZpFbzqgs+bD5eY6ZM+6F3romxFRjOSHasRfZajsokYrP187GwPY2igUGmYp0wmPSzJOCljdTbxmII+XExlAzkJjOVMtkVEikI3yhO0wBDpydYd5Y7I9cRhEUEvGIhyQst93TYw3VSUvKfYWcUm9HH3HNLgUWQSGFomKuNN9/Py3Xg7aIgehGrEtWutB9GbKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bu.edu; dmarc=pass action=none header.from=bu.edu; dkim=pass header.d=bu.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bushare.onmicrosoft.com; s=selector2-bushare-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v7FY7X0Tf82uRydOo0ch4U/UHz2NVLHI5HNmP56ejEc=; b=zynkbV7GB3rXQ6OUXJlLpUPE1qo5/VvdocK1j4zQIcuVZ/5sajMVZImfMnCL69GY9Mri1LTeU7hgY6OI9aIvVCxFNlaAtyoujDDsW6FytapU8WmoWSnlSDlQSqeDqTPwImdFFdP6ZiC3LBDdMKNY+0MQWUXraBhJKaWelxD3Y/s= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=bu.edu; Received: from SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) by SN6PR03MB3887.namprd03.prod.outlook.com (2603:10b6:805:70::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.30; Tue, 12 May 2020 03:01:50 +0000 Received: from SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::640a:1123:37c1:42db]) by SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::640a:1123:37c1:42db%3]) with mapi id 15.20.2979.033; Tue, 12 May 2020 03:01:50 +0000 From: Alexander Bulekov To: qemu-devel@nongnu.org Subject: [PATCH 4/4] fuzz: run the main-loop in fork-server process Date: Mon, 11 May 2020 23:01:33 -0400 Message-Id: <20200512030133.29896-5-alxndr@bu.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512030133.29896-1-alxndr@bu.edu> References: <20200512030133.29896-1-alxndr@bu.edu> X-ClientProxiedBy: MN2PR12CA0025.namprd12.prod.outlook.com (2603:10b6:208:a8::38) To SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mozz.bu.edu (128.197.127.33) by MN2PR12CA0025.namprd12.prod.outlook.com (2603:10b6:208:a8::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Tue, 12 May 2020 03:01:48 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [128.197.127.33] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c8d06da-fb1e-4b03-0013-08d7f620d083 X-MS-TrafficTypeDiagnostic: SN6PR03MB3887: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:425; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1M+bAmMjbIiIjv6s45/c7LmiOrc+N+j+8YUYRvf97Q/u8btQ2hl/0jHvDlaOEYWapRi2yGECbpWT9Dgt7QJfimfWAsX0ZZ0G+ooUJdycddN4MXQF4n28y0z6hoe8ANSPVvsa6z2TFz5Yh10U3IXjh3o8ZNFxG2TA8vD9RFAsJzQ0JuSEJgoZrsxYyLFIpc3vhOO/9b0OhRDg795qRWM/8VvHn3OhIUmj/xyX3+qGvXfL0CuQPHMe7QMYGKtgVW41DT5hdGQko8ohlPmctVrOxArtNBV+5JY7JpXa8R1XOw4sWPb5t0cMqy2C3NsSnVbzxrWDX5gvsJKMHsfjLhU/uRLGJOTURK13k9cd4astSLP2VdXgUxrm+WQcUI94rEdXuSKbTSbK2Mr+egiAShCufUH5FmJHlC1m9HPuFUjFzEl2/V0dQCgCgoJPZkUztiX7nEnJICGSVlQSEdQAvc+x+bQN+KGKR8wuN3bA3EIoa5BA9Llw3GBg9qKsRgNAP1bNTSuvbRQ5JKZvWKZzvmnIBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR03MB3871.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(33430700001)(52116002)(66556008)(66476007)(66946007)(5660300002)(7696005)(8936002)(33440700001)(2616005)(8676002)(36756003)(956004)(6486002)(75432002)(2906002)(86362001)(54906003)(4326008)(186003)(316002)(16526019)(786003)(6666004)(6916009)(478600001)(1076003)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: /cY2/dzM1JmB7whmvt93HKps9yj/LHW4WtCH9ZgXyUAvChl+9pKLEzslU1AzHH5a5Nn62LruN3d+x7PNNlptLiAD8re29OtFMLdhpIHuT5BVzF8Phtr3v1efMbA7nV/zJSrJtvaqnozQ5PlKmoLtYtWVEmcwPpnRVAuySF6hU+vXgMBSPl3491SHuO86ZeKfllxd34vkNilbgw0bAQD3o0c0tpqrPuiz7FBHJ4n3DF/mFKcPeV7j86LdlICGaPtBB9rf1fAbvlZTc+f3KappNoQhiTYLm//w87jTZKuKlahxgl5AcmEtWN02vBWGH+mJROAsmMgzl96/JnaMJwcsyiqMAzDqx4LIW234wBmFK7qlhL+ITY24vUw1z7ci+0eqZGdCjcGMtuMfaRXH+BhOvzqnGnx9LrE09NK8Ca/7NghEqmBAOb2akFCMoO2MHKuGrYsbOXDexIl2t3NYBijb/ncomVKTRZZfmv+ovvR0GZ8= X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 4c8d06da-fb1e-4b03-0013-08d7f620d083 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 03:01:49.5566 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d57d32cc-c121-488f-b07b-dfe705680c71 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GBsnHDoRgx9q2bUlurEWF4izZODeKRnXYeYttD7Wta3MzEQwIOOwAb/tDpDLRjLT X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3887 Received-SPF: pass client-ip=40.107.244.98; envelope-from=alxndr@bu.edu; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 23:01:56 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HK_RANDOM_ENVFROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Alexander Bulekov , darren.kenny@oracle.com, bsd@redhat.com, stefanha@redhat.com, Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Without this, the time since the last main-loop keeps increasing, as the fuzzer runs. The forked children need to handle all the "past-due" timers, slowing them down, over time. With this change, the parent/fork-server process runs the main-loop, while waiting on the child, ensuring that the timer events do not pile up, over time. Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/i440fx_fuzz.c | 1 + tests/qtest/fuzz/virtio_net_fuzz.c | 2 ++ tests/qtest/fuzz/virtio_scsi_fuzz.c | 2 ++ 3 files changed, 5 insertions(+) I'm working on another series to abstract away the details of resetting qemu state between runs from the individual targets. That should relieve us from needing to add this for each new fuzzing target. diff --git a/tests/qtest/fuzz/i440fx_fuzz.c b/tests/qtest/fuzz/i440fx_fuzz.c index 90e75ffaea..8449f81687 100644 --- a/tests/qtest/fuzz/i440fx_fuzz.c +++ b/tests/qtest/fuzz/i440fx_fuzz.c @@ -138,6 +138,7 @@ static void i440fx_fuzz_qos_fork(QTestState *s, i440fx_fuzz_qos(s, Data, Size); _Exit(0); } else { + flush_events(s); wait(NULL); } } diff --git a/tests/qtest/fuzz/virtio_net_fuzz.c b/tests/qtest/fuzz/virtio_net_fuzz.c index d08a47e278..a33bd73067 100644 --- a/tests/qtest/fuzz/virtio_net_fuzz.c +++ b/tests/qtest/fuzz/virtio_net_fuzz.c @@ -122,6 +122,7 @@ static void virtio_net_fork_fuzz(QTestState *s, flush_events(s); _Exit(0); } else { + flush_events(s); wait(NULL); } } @@ -134,6 +135,7 @@ static void virtio_net_fork_fuzz_check_used(QTestState *s, flush_events(s); _Exit(0); } else { + flush_events(s); wait(NULL); } } diff --git a/tests/qtest/fuzz/virtio_scsi_fuzz.c b/tests/qtest/fuzz/virtio_scsi_fuzz.c index 3b95247f12..51dce491ab 100644 --- a/tests/qtest/fuzz/virtio_scsi_fuzz.c +++ b/tests/qtest/fuzz/virtio_scsi_fuzz.c @@ -145,6 +145,7 @@ static void virtio_scsi_fork_fuzz(QTestState *s, flush_events(s); _Exit(0); } else { + flush_events(s); wait(NULL); } } @@ -164,6 +165,7 @@ static void virtio_scsi_with_flag_fuzz(QTestState *s, } _Exit(0); } else { + flush_events(s); wait(NULL); } }