From nobody Thu May 2 12:00:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) ARC-Seal: i=2; a=rsa-sha256; t=1594065450; cv=pass; d=zohomail.com; s=zohoarc; b=gqw6X993Sk3Nt8FNKhwXvGDbSASE4pMA4tKEsTte69khXn+tI3fP8+jNMot+1jAjikET+CpjOkfWmZnwfDk8nIw4H4wi7dt4VuhfJAeFK1W2lZIygjlwBrhqUi2GBQ9p06glIATycOQf2NCEO+kn7DAldktpjvNxAFfhj9jPDbQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594065450; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dsTdI6r2+KgSYYIBcSUuhcXd3d4BZo2yDSICQr8IhfA=; b=ld9m9LFVCEZ+NIo+vAR/0EeSpJs37Rh3RY1HvalZ5ZQat1ZLp91R+ShBGNODbWasVSx9U5l7B7tzARz8TpcS71p1wImYYu4KuAvv3pbxDdJh5MYgw34Z/97ujajLeLK8H4GhbganAPZ0r19oIrbWA0zRw/8cWYLpwpX1k4kYHyw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594065450443635.6822202138239; Mon, 6 Jul 2020 12:57:30 -0700 (PDT) Received: from localhost ([::1]:43476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsXF3-0004oA-37 for importer@patchew.org; Mon, 06 Jul 2020 15:57:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsXE1-0003Fi-8u for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:25 -0400 Received: from mail-mw2nam12on2126.outbound.protection.outlook.com ([40.107.244.126]:37345 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 1jsXDz-00032S-CX for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:24 -0400 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.3153.21; Mon, 6 Jul 2020 19:55:46 +0000 Received: from SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b]) by SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 19:55:46 +0000 Received: from mozz.bu.edu (128.197.127.33) by BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Mon, 6 Jul 2020 19:55:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iVfYed6NJ+xGvJSSsBUWBFn+llzxP/UNO+uyHGZ5cPLH1S6u5PYIg/nqTe4eDN7WMZFHe5VvNzQ5NZEjcApemkCGI5OUcZA6yF6O3O6YBCwGLqIdJh4TTkAo3mfpEF9GShPWLAmJliwUNBnP99jm4P4DTVdXrNfFXnaZdJz6aeYl0kuh0WdrKpnLqXZ9iItaYpVLAMfgSg9mZpt/DLmoomC1Bc7t6zSZAbP2q0SYNlEB50O3+5vQ6I1z72T5WmbJYLTOd+3z5khZuKMYLsoSGgFrcgeAIaDOIVwBkKbz4wJ9J4Yedo7aVO6pN+YtYgwfgS78QcrLHyJtgkPlqTCFPQ== 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=dsTdI6r2+KgSYYIBcSUuhcXd3d4BZo2yDSICQr8IhfA=; b=PQnB2DzQhmYFn7Dfv3y7wIguNvKWnoIbjVdsDP+C1EVXdHXAvQvhhW5lO4n/On0uhl8YowQVldbWMHveZsFt6MK5FJWJd4TcFOgwE4nEQA5PdG05qVyOOQ5JtaaQCqCnxImdPJGHJkePvOehT1y+DK/7VqvRDzjf7UdTIFQtnbDuY2h7JLAuM1oEqizvtTPR0XjOaMZgZ6vDlHPyyxJQ9OJKqsIQRuAn1/bgyOvJye9SGkQsTXW0hi1TuRQ4ArsHqt4tnSUBo3kSuXDB1lE7w8bjkjE/ZXQabKPK3Tml6ztFcows5caA1/zTY7hq3rPZz1iQXhG76Em7lRxaZ4tiHA== 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=dsTdI6r2+KgSYYIBcSUuhcXd3d4BZo2yDSICQr8IhfA=; b=ovzcMMtwx16S8/8OgXqCBQ2cy31Dp6Wzgoyi6M8zW0nOKj25XAXp8t6XtIfijCcar9DoYqkHze9FybSpqzpG735zC6zu3rd30iLuca3aQLHLnwNofGj2doxdQYG2ULcj0VXIEfi+ST84B1lwa+qyGkgo0H3UsZJ9YSklszNsR+E= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=bu.edu; From: Alexander Bulekov To: qemu-devel@nongnu.org Subject: [PATCH 1/4] fuzz: build without AddressSanitizer, by default Date: Mon, 6 Jul 2020 15:55:31 -0400 Message-Id: <20200706195534.14962-2-alxndr@bu.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706195534.14962-1-alxndr@bu.edu> References: <20200706195534.14962-1-alxndr@bu.edu> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) To SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 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: 7c8eea77-bfc3-4a6e-b553-08d821e692d2 X-MS-TrafficTypeDiagnostic: SN6PR03MB3520: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3gP5y6XVeTBOplkEYWCEfAdblt5vXY8Z+Huu6yvckPw5mnDz0T226Iu2KVBAq/AGcXch2p4N0mTVeH8zS3M/1uBdlLRz2zFqDCerHDO/szKA9pU+RFUFicsQeHAFMJ5kBitv5khXxbjIGR8LAq/U94X2TUKWoLDuPh/e94WYlPBgjnFVTmbIJOnr6qcz+eGFkjdS9t22rsHmQPu9nVIksuhurAROu7Q7tQOCvXgKqtZ4RVPTzmsCVdtKaQZCmZ/9EeaCkm3F9gjYGiehH+CBcw6ahC0CBk89Fvk44Ol234SchUBbFA8+Hh2TE8TQQ6iRrlmTpW8VsRcVzBRlE4UOfQ== 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)(396003)(39860400002)(136003)(346002)(376002)(83380400001)(16526019)(26005)(8676002)(66476007)(66556008)(7696005)(4326008)(786003)(75432002)(478600001)(8936002)(66946007)(1076003)(36756003)(86362001)(52116002)(316002)(6666004)(2906002)(186003)(5660300002)(6916009)(6486002)(956004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: VLclbXwiRjuCHFlW9FXsEY1ktDXzx7AWHHRp6xE5OoVYgK/XRESO1F3+IehxJeqAa75OK/N0G7NWCkIscrHN+l20SQxGvpreijllrg9JsaAxG5tjGpDVW6WGUAZXqcxxz46bEHclcTQsHDhijTKIXm6dLPTLL7017wkUuX1Nvrmf0r1AngvuNS1qXbS62LbrZhI5KyhPNiJxZMaerfm0NeGT+NZ/nWVZi+yT/a0BjNUXgDNSzJRlwCF5CH9jRaNWR9k33oZYc8BEaQFAA6gACd7k3++4IoBzO6wyfgVoI0U5yP+fOCR4wDxkdDnbd52HsCxBgncRS4T+tlS0YvyxPrD9+W7/IR6nzdpP6ugKV6EMk/QSuhaFlP+5M1/MdB3NQqxBbfKt0grpdZLbZNqmhS53qBBglL7/PrN9N8LgYgezmfIUAesrNa3yXsmUL4v0eGHOlPZ4sGvCsm6T1IGwhEtrK5oJ25Ob0xYWBrb3jdg= X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 7c8eea77-bfc3-4a6e-b553-08d821e692d2 X-MS-Exchange-CrossTenant-AuthSource: SN6PR03MB3871.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 19:55:46.4411 (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: quYUlahpIIJW/txDwHCHFTWkJdXkvyOjK7QIKDPAs4rXW0cGKkZpQ/ENZnmuhxgm X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3520 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.244.126; envelope-from=alxndr@bu.edu; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 15:56:21 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001, SPF_PASS=-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: Alexander Bulekov , bsd@redhat.com, philmd@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @bushare.onmicrosoft.com) Content-Type: text/plain; charset="utf-8" We already have a nice --enable-sanitizers option to enable AddressSanitizer. There is no reason to duplicate and force this functionality in --enable-fuzzing. In the future, if more sanitizers are added to --enable-sanitizers, it might be impossible to build with both --enable-sanitizers and --enable-fuzzing, since not all sanitizers are compatible with libFuzzer. In that case, we could enable ASAN with --extra-cflags=3D"-fsanitize=3Daddress" Signed-off-by: Alexander Bulekov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- configure | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 8a65240d4a..010c0ca479 100755 --- a/configure +++ b/configure @@ -6319,7 +6319,7 @@ fi # checks for fuzzer if test "$fuzzing" =3D "yes" ; then write_c_fuzzer_skeleton - if compile_prog "$CPU_CFLAGS -Werror -fsanitize=3Daddress,fuzzer" ""; th= en + if compile_prog "$CPU_CFLAGS -Werror -fsanitize=3Dfuzzer" ""; then have_fuzzer=3Dyes fi fi @@ -7858,11 +7858,11 @@ if test "$sheepdog" =3D "yes" ; then fi if test "$fuzzing" =3D "yes" ; then if test "$have_fuzzer" =3D "yes"; then - FUZZ_LDFLAGS=3D" -fsanitize=3Daddress,fuzzer" - FUZZ_CFLAGS=3D" -fsanitize=3Daddress,fuzzer" - CFLAGS=3D" -fsanitize=3Daddress,fuzzer-no-link" + FUZZ_LDFLAGS=3D" -fsanitize=3Dfuzzer" + FUZZ_CFLAGS=3D" -fsanitize=3Dfuzzer" + CFLAGS=3D" -fsanitize=3Dfuzzer-no-link" else - error_exit "Your compiler doesn't support -fsanitize=3Daddress,fuzzer" + error_exit "Your compiler doesn't support -fsanitize=3Dfuzzer" exit 1 fi fi --=20 2.26.2 From nobody Thu May 2 12:00:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) ARC-Seal: i=2; a=rsa-sha256; t=1594065520; cv=pass; d=zohomail.com; s=zohoarc; b=is9SsQtDQ7X/bizWuKC8xxRHTcpeFvsp8TnAjOw/3l99jPpatZ/0tA/Z0OuIku/vWyaMSOt2dryUAS04KMdgnVwH1cquntYEMz5Gruc5l8HSkSzQNYTMpe6mqrnybzbXORuh6T9i5VBB4ZswFA6PoMGZIRXiROSQJD/vdN/EeYM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594065520; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=81P0xTiB6eYwm9dM3xLP3FIv2owOKwkJ7xlolapJBlA=; b=A2g/7D0Mw/I1g65zwOWX6zfRd2UIwmnPyZasyeJIJGTwWMGIs8C1qnJy7h8mDVs9fKVqd266P2ofpkUmvnalJqhM7zyqPDDOtkbieWs4ObioxBwSmuBlZ2n19HP0ZFT0H68xuPdUtTBWuniq3LFUJTyr0bBosDE0i8iBrdoxYHI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159406552040665.32192406107572; Mon, 6 Jul 2020 12:58:40 -0700 (PDT) Received: from localhost ([::1]:48486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsXGB-0007JA-86 for importer@patchew.org; Mon, 06 Jul 2020 15:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsXE3-0003Hl-36 for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:27 -0400 Received: from mail-mw2nam12on2126.outbound.protection.outlook.com ([40.107.244.126]:37345 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 1jsXE1-00032S-HT for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:26 -0400 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.3153.21; Mon, 6 Jul 2020 19:55:47 +0000 Received: from SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b]) by SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 19:55:47 +0000 Received: from mozz.bu.edu (128.197.127.33) by BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Mon, 6 Jul 2020 19:55:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AmYRqS1PvcCSDMptEe2rQL7E+7x5CCDz7bxc30xGaNd3/uf/9+fgq8rV4HoxTLaA1RPxyupFp8E0sVx47Lcz5S8benxoqt9WMJ4uKu0zfyYAV0Jlq6Kb34NWwRjx7Zlz3tuaPL2vgX8RlM0eYfwitvS79hGkMkxT8esbOdYTSSiDMoaA7kDRTRCP1hMbShTcjvMDaTEL/7uj7v7AktLHAIOfwmfBZDJ9ILf6dARBylsakCtEWcEuwPgA+fnB8CIIGJccPHscpVEOobFdlmQOFLB5popFBvciW4M446JWiFfximIltT8LTmGEFlQPwIl4Ojym+ZBXA7ca3n8c/nxHAQ== 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=81P0xTiB6eYwm9dM3xLP3FIv2owOKwkJ7xlolapJBlA=; b=bjIccojg/JHc9Fo8KbaKgif935bfy9/AIfx9BcFGWIH+oigA0tfERqE1BoPKwLWVP5MUxl8Rw8t2BAh0d3qVFby6ENNOJHz23lMw5Jvv2khHWU8IQ+Fxe6E0WvMd6I+8nWvgyRBg+smmv8xYz0KyYi+3xZt8IQg5ecL8sWYXWrWedwfPnN9K0lcCpBeCCJ80GGj8UBeb8HodrUxmFe/waLKaHEYBQOf19ROyoEqq53GqZIVnwhsyZp7Jwlsb7UcMZUG6UheQu8f+jmOjbJgGKwTBdr5PltHmeDj4v4iM0mOh282ZOOvdSByQc+XovcpUvRoL39m0y3Hi2t4iItCgCw== 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=81P0xTiB6eYwm9dM3xLP3FIv2owOKwkJ7xlolapJBlA=; b=TjnygGXPLHJ34hlISy/yf+JH4c9iNA3Az2HGcJFZhNdJh8hQMEkeGHEy7PvSamsdYXB85oV9WUmweuM8HmD3kou2qFVtBsXSsJkmJ558i8uvnFbsaak/g14q2cOn7xCgvYlx6l4x/ulgBgDZi4qUKKQoiAvFikyfcrO9xumO51Y= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=bu.edu; From: Alexander Bulekov To: qemu-devel@nongnu.org Subject: [PATCH 2/4] docs/fuzz: describe building fuzzers with enable-sanitizers Date: Mon, 6 Jul 2020 15:55:32 -0400 Message-Id: <20200706195534.14962-3-alxndr@bu.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706195534.14962-1-alxndr@bu.edu> References: <20200706195534.14962-1-alxndr@bu.edu> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) To SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 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: ea6e70fc-1b63-4c04-4fcc-08d821e69346 X-MS-TrafficTypeDiagnostic: SN6PR03MB3520: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wy/cX33jxLUeOcUQUQJ+4ojiWQM6QnCwDrhqhsoi+cU74kLHTE9jfWf1HQzm1FXI15OPKFUp05SQaPy8s8v8LRgvDfcOOFG5P5jghYolbMpLKhADV39EACaaEtb8P+ILwUJ8ix+tVbKOJZQdjwElJTwzy2dwDAXaGjkgEcssrkY7fQV9j+YF/HWU7wfGlbBsKQvNa23rndkX+7axC+/up0Pg5TGfS7x9MIi3rJZuKCxB+Y27mWTTBDBwTvCi1kMHWiGAenL4hBYvMaaGGsxp4JbibKz3qWhOBFY/jrnpcc6sNqHIA/xXSKR/ZhZk+TIu 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)(396003)(39860400002)(136003)(346002)(376002)(83380400001)(16526019)(26005)(8676002)(66476007)(66556008)(7696005)(4326008)(786003)(75432002)(478600001)(8936002)(66946007)(1076003)(36756003)(86362001)(52116002)(316002)(6666004)(2906002)(186003)(5660300002)(6916009)(6486002)(956004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: oN8UrO0woKNYH5ClHi5A/8Hkc5DJ0tVswivl9UkqQ3pcJ0bHcaIBnQrWMk1BZl/MQTQUIiOySGAcm31cEmXjIjDFwQQb6pqFT3cUR9qC6e7AHTBQXd2nRx4hZZ29KJooqzoW/RcmEMNN8XPEMuexuPUG45aSg1IAHP1+qLtZDenHRe9fEZv7TA2GWIxrOlk+pUzDPnS6GRBnISXqbzBSUAohrZ2+qBr3GpClPFyztE8OGNZnVdeIQvAHfwiZFS5LUEFpsHB1+1fxtqXscUw1dOZ5Sn3DhNh12CxNVTSqERArPakPmkjeY0id2RZB0VtuSgINpma3R5tj9qhth2/bjdF8K++l6wxyqlsXU6dkIHhfA8ijQYUWL0wFE4JaR76HvEQoXF5IWXWhRd9fRQCI4X6sKOtcXrrBz88Kwz/BNainGqXvyXHi+H7zWtVr/TRy+SWxwpO3ATEW4PJhUbYkeQadB6tRNa23WJcqcuHAwLc= X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: ea6e70fc-1b63-4c04-4fcc-08d821e69346 X-MS-Exchange-CrossTenant-AuthSource: SN6PR03MB3871.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 19:55:47.3476 (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: 3Z3AcKgtLx9Uo2KHBpOiq+cuwY2KsuvlZ0bi20au+6Ty++ZqlusR/+OSKuu5ezam X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3520 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.244.126; envelope-from=alxndr@bu.edu; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 15:56:21 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001, SPF_PASS=-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: Alexander Bulekov , bsd@redhat.com, philmd@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @bushare.onmicrosoft.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Alexander Bulekov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- docs/devel/fuzzing.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt index 324d2cd92b..382ade974e 100644 --- a/docs/devel/fuzzing.txt +++ b/docs/devel/fuzzing.txt @@ -23,9 +23,12 @@ AddressSanitizer mmaps ~20TB of memory, as part of its d= etection. This results in a large page-map, and a much slower fork(). =20 To build the fuzzers, install a recent version of clang: -Configure with (substitute the clang binaries with the version you install= ed): +Configure with (substitute the clang binaries with the version you install= ed). +Here, enable-sanitizers, is optional but it allows us to reliably detect b= ugs +such as out-of-bounds accesses, use-after-frees, double-frees etc. =20 - CC=3Dclang-8 CXX=3Dclang++-8 /path/to/configure --enable-fuzzing + CC=3Dclang-8 CXX=3Dclang++-8 /path/to/configure --enable-fuzzing \ + --enable-sanitizers =20 Fuzz targets are built similarly to system/softmmu: =20 --=20 2.26.2 From nobody Thu May 2 12:00:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) ARC-Seal: i=2; a=rsa-sha256; t=1594065454; cv=pass; d=zohomail.com; s=zohoarc; b=lH9Pju43yfBc4cfXR/wAwa9vx9jEJcieia72n4epihmaHy9Fn96jH8M9oQzyzd2XOS366MsD9bp8JqoSeKtsG27655utx5RQp2MnI6k6jq7Wr7AFL403rNc548O5lFIIbIUWPn1kd0YDxV1O1MuEkeq7iXtQ9btufTfz3w1ioL4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594065454; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZH7NF+7Y9CD4fAPbIhuC/DSOh6r1uy1UgxJtzSdvP2w=; b=c621x9vRTWFW9zE4Jvy+g0o8uO1cWrNjjtayWzCJKA6c0TtLNxsONPGMV9sjZ+mflroxP7MtOYtxiISg4Cx2aAEivKnf0EYAs0QD9CU5wy5e4tmt5nOtEiTF5I4kf2TRdO5Ggwyri/umBWiPHZzmov2rvt8cpRs+doz4oa8sF2E= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159406545451387.72746179960484; Mon, 6 Jul 2020 12:57:34 -0700 (PDT) Received: from localhost ([::1]:43832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsXF7-00052O-9I for importer@patchew.org; Mon, 06 Jul 2020 15:57:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsXE4-0003Kt-T0 for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:28 -0400 Received: from mail-mw2nam12on2126.outbound.protection.outlook.com ([40.107.244.126]:37345 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 1jsXE3-00032S-Cs for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:28 -0400 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.3153.21; Mon, 6 Jul 2020 19:55:48 +0000 Received: from SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b]) by SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 19:55:48 +0000 Received: from mozz.bu.edu (128.197.127.33) by BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Mon, 6 Jul 2020 19:55:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P+qjZ1xT+U2N8EGfIS3Eya9K4Lq6y+lxZbA501aHbqAhQ8kBp7AgAd54u2/+aDWWP2UmBiqlx7FKVv0bDP5PszGCC29fLUXkSBV2J+2MMu8XhR44AFOhSaI1sgiwoeUWjYFJiSTlBT5MKnrKqwiVOlsn3dm4X2Ui+d/rBurRbwYO2mZkSuCJC4O0qck2dhLntoyUctDeYcudOfchspf/3W2F9ET0aULIMtcIcSqbb1AdwxXhdELZ6FgjBIJgKdOyGtk491PlcUVUwlCtJW2p3BwHZF0YwzUkfhhsn4Vfs0dvFOVHZdkneJtx4qb/2/iH+5vruWFPqhcpLjZ6d18wPw== 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=ZH7NF+7Y9CD4fAPbIhuC/DSOh6r1uy1UgxJtzSdvP2w=; b=c5P/VI9qxLYgDo2HuoVDWZR9ZkDyaRR2cMAtR8NALXNQ1V0mjLbw3q5dDSwcS6B2LuxNg98rliNfB7j462/wXtsARmV/26SqivDS3c2OySASnnGoCcqRWBO9BUgdIOAvHmla0b+v1gXasMxPuD+0ZC/BeHjOVdRCwa5vhHR4qFjIgygYxY4kjiElSEtsQeUoZlYz4G7+NLo43iGWIH5R0gNyTXBEuoF8hEPeHpOmHg78gT5nYrH7WteDlUIYesk8vxOis00qguDmVHG/OLAZyjhESaWNIrDBVHTBbhFc+nHUDfGusMjjtrQnD00hMq3ZedxzKBcdoM4H3nPMgRuXqw== 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=ZH7NF+7Y9CD4fAPbIhuC/DSOh6r1uy1UgxJtzSdvP2w=; b=pdkdlH9LRAhtQkUtoVPWtNeA4RKw1eCQqssOg/P2KM0n/+f78++TpziSzM1OyK1ajZJ64ZZluoAqacGr6h5kmDgUqzxWjSv7NGxKSNphEbjtazPCmzZWxf9dMwAvgtFUghrJwdYzM6cbUTPg8vVIs5OzxVZ6iWBNdMqGjW5ybh4= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=bu.edu; From: Alexander Bulekov To: qemu-devel@nongnu.org Subject: [PATCH 3/4] docs/fuzz: add information about useful libFuzzer flags Date: Mon, 6 Jul 2020 15:55:33 -0400 Message-Id: <20200706195534.14962-4-alxndr@bu.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706195534.14962-1-alxndr@bu.edu> References: <20200706195534.14962-1-alxndr@bu.edu> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) To SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 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: 852db675-c762-4fa0-2a18-08d821e693d2 X-MS-TrafficTypeDiagnostic: SN6PR03MB3520: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rP619gyNKtGnJCHZe/uKjxRmbmDsEcjTi1MnCJJaWJiQCr2vtnyD6Ouzn+BDeEuFkZL/842lF6Pa4V4WsnRyjHFjVja0rHS8/jmjCG6Nk/Y8q5DkdKI3U9IPXR18eNLQyr3hOkPu3brXh0Cv1T1FSluA0shWZ8zejv+itbAuqFAPtqCSQv82VHTUO+UcgJr+1At2I2IY7vAxRvRN7f4hw0GTMxgcBFGDlXrhe34CldtAIthorCjhQxTHHZXk7Lsysk9jmZTZh6Ga+dlj5Mi2Ma7hg22GVZWEoMBKMjloh15ZkmhCQLgd3YSrsWihyshZWvEmjxAeGxRpMWwwzYQFBQ== 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)(396003)(39860400002)(136003)(346002)(376002)(83380400001)(16526019)(26005)(8676002)(66476007)(66556008)(7696005)(4326008)(786003)(75432002)(478600001)(8936002)(66946007)(1076003)(36756003)(86362001)(52116002)(316002)(6666004)(2906002)(186003)(5660300002)(6916009)(6486002)(956004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: zpJG7mECfkMztiNyME/PhRQVXVFJsEzhWy/4g7wuv2BjQ94Cosm+zhftLJJoMaFGTBI6NIvnR0fgk8dpjCheOxF4LKtbPb9MZUApE/pjnptcfozdNXuVH3BK6MMry3QXwVcsFvIdTDFACb24+HCxY+tDiOTG7IZUG9zthVEFV67MFLPYD9EvVv/HgWfvaDYTKLmTvCwDAzfv50KsSXzgoNMgqekNimClnlLkHB0nq8VO3zkUaS662DXfFlfEcY8mPbabsO9F6MfYgaz/99TOLUelbwLBFzjdb1AO55fwOnK455NlGArOXGZCOppofNAL0PCHQVyNfu+Wy197M1vA3kxG8fnWqsaXwD8bB2QS7DqyQyKPBwpftJunNxKO76f9cmunQG2p/1sYgyilHESHYUZm7K+Mg8Qj1niQeiTCfEbptudzXStuTljbc6OdYhlOS5rcLQ6OqCCNyM4xNlYwGPh9ptvldG9N7efy4lyM0T4= X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 852db675-c762-4fa0-2a18-08d821e693d2 X-MS-Exchange-CrossTenant-AuthSource: SN6PR03MB3871.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 19:55:48.1612 (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: zLtav38GgP2RWGqCsd8klOOGEiTw32ewDld2CxjAGTVmUzaVN4s57WczYf49U1ZT X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3520 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.244.126; envelope-from=alxndr@bu.edu; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 15:56:21 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001, SPF_PASS=-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: Alexander Bulekov , bsd@redhat.com, philmd@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @bushare.onmicrosoft.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Alexander Bulekov --- docs/devel/fuzzing.txt | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt index 382ade974e..284d57f8fd 100644 --- a/docs/devel/fuzzing.txt +++ b/docs/devel/fuzzing.txt @@ -48,6 +48,43 @@ Information about these is available by passing -help=3D1 Now the only thing left to do is wait for the fuzzer to trigger potential crashes. =20 +=3D=3D Useful libFuzzer flags =3D=3D + +As mentioned above, libFuzzer accepts some arguments. Passing -help=3D1 wi= ll list +the available arguments. In particular, these arguments might be helpful: + +$CORPUS_DIR/ : Specify a directory as the last argument to libFuzzer. libF= uzzer +stores each "interesting" input in this corpus directory. The next time yo= u run +libFuzzer, it will read all of the inputs from the corpus, and continue fu= zzing +from there. You can also specify multiple directories. libFuzzer loads exi= sting +inputs from all specified directories, but will only write new ones to the +first one specified. + +-max_len=3D4096 : specify the maximum byte-length of the inputs libFuzzer = will +generate. + +-close_fd_mask=3D{1,2,3} : close, stderr, or both. Useful for targets that +trigger many debug/error messages, or create output on the serial console. + +-jobs=3D4 -workers=3D4 : These arguments configure libFuzzer to run 4 fuzz= ers in +parallel (4 fuzzing jobs in 4 worker processes). Alternatively, with only +-jobs=3DN, libFuzzer automatically spawns a number of workers less than or= equal +to half the available CPU cores. Replace 4 with a number appropriate for y= our +machine. Make sure to specify a $CORPUS_DIR, which will allow the parallel +fuzzers to share information about the interesting inputs they find. + +-use_value_profile=3D1 : For each comparison operation, libFuzzer computes=20 +(caller_pc&4095) | (popcnt(Arg1 ^ Arg2) << 12) and places this in the cove= rage +table. Useful for targets with "magic" constants. If Arg1 came from the fu= zzer's +input and Arg2 is a magic constant, then each time the Hamming distance +between Arg1 and Arg2 decreases, libFuzzer adds the input to the corpus. + +-shrink=3D1 : Tries to make elements of the corpus "smaller". Might lead to +better coverage performance, depending on the target. + +Note that libFuzzer's exact behavior will depend on the version of +clang and libFuzzer used to build the device fuzzers. + =3D=3D Adding a new fuzzer =3D=3D Coverage over virtual devices can be improved by adding additional fuzzers. Fuzzers are kept in tests/qtest/fuzz/ and should be added to --=20 2.26.2 From nobody Thu May 2 12:00:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) ARC-Seal: i=2; a=rsa-sha256; t=1594065455; cv=pass; d=zohomail.com; s=zohoarc; b=GQbeVIlACwO04xWXf+wmrq6FdipIwIvUlzCrp9xWPGkOvMHl3/sCO685uir1GwD3/EenrsHe49EsQl5G7EpoNlfxu+yMfGQR3OvgPXs8Tgsp924xJOMOR0rCYIkdFIcQQUtt2HzQdgpRQi0KtfqCUc1ceBe/Yk5LgsA4Xvbyyz0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594065455; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LXDB9zLidv5j9OknXJbWv5mw0T0xEQ+ky2Ou5Bv81u0=; b=eo0CZ0BQM3mUuh8ZU1cQWHk+nzPhMCEEF/pcqhsVGaupfr46sTP4dJeXsxPakrNTYfVsvmAzE9MtBkyJrcH+eAQTbvKhFKjHhNiL8JR6d17OQwvcJjPGB1PfFQrZuQ+JJ8KzEo5P0jdt5OCG6acszXsV/S8SfxW1C3/g41/r3Ns= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1dmarc=pass fromdomain=bu.edu) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594065455428764.2591602062444; Mon, 6 Jul 2020 12:57:35 -0700 (PDT) Received: from localhost ([::1]:43930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsXF8-00056m-03 for importer@patchew.org; Mon, 06 Jul 2020 15:57:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsXE6-0003OJ-QW for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:30 -0400 Received: from mail-mw2nam12on2126.outbound.protection.outlook.com ([40.107.244.126]:37345 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 1jsXE5-00032S-7k for qemu-devel@nongnu.org; Mon, 06 Jul 2020 15:56:30 -0400 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.3153.21; Mon, 6 Jul 2020 19:55:49 +0000 Received: from SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b]) by SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::8ce:29a6:77be:c35b%7]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 19:55:49 +0000 Received: from mozz.bu.edu (128.197.127.33) by BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Mon, 6 Jul 2020 19:55:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mSsMvOoLbKcmHHFRKliWgdrxenvyvXIRJn6iEgT3g1tG1BclxP/8e0YZrznXRI+VjthLVIPf55zMy9eann7BnItSeDCxcSjcXqL1n5YS4xUDO4+P2buvqpn9sNdCdVNhYzWMWcCDBB2bvzI2xwefOAktN0MJ0BX18z4c04gFSmgYQN4z4wtHuHuyHt+Ae/6UgslCSsoiANTfMsZ+VboxrkeT98hVIU0a6oMLyZ6oKr20v9JbkFxeFWqDUrTTzWWWV/DXOE4qw1rs13Eg+8jEkpG3fyDhuU8Jd2gMHe6mnufczWqc6Lv/pGzti7TtI30SRiJlyfvQbeT84wQNrUG6Cw== 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=LXDB9zLidv5j9OknXJbWv5mw0T0xEQ+ky2Ou5Bv81u0=; b=gODHuTJVgDmQN4bgxHGBsh3JzccN19a6Q3AIOd7oRFac6R6E6i4wihD6JSNtV64LU03lL8jzmJlSG4tx+uwBrgCDqorUX6sJmhlB9NIaLzkepW31GvMJd8JAumt+HNBzjhhOvZo1b/seuoiicglbSaulgoswQDvMP0j3aSkBYPuEW/Zk1SDy15zrLY86UvJiWoP93k1UdeEhm9ZQil368uQQxLqipGzf4Dzl1Xz7ncos/rSRKmtliWU77qlIfiD1z0wH+nAr22dFDwvNHOR7uTlqbWBFS4Xmzlua1h6SFD8i8XhBq5Ndbbkw61leYI+0fUl9hFkvOJprAqwO8HiDBA== 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=LXDB9zLidv5j9OknXJbWv5mw0T0xEQ+ky2Ou5Bv81u0=; b=CStK5OfjHRrGfzV3xSbvr2JXS9TmtavtQasOtFY84d28hQxhcb1PRKWhxPK5wRwQkrStzanTi/wzrEObrFOUBz7Zb5o2tw1Zc123KRr+mftVGGfWgjpDh7tAQWDUYKOh0M7n6ecuwWqa8uqEeRvXHqTmnGSGs79xTF9xBOKEBDI= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=bu.edu; From: Alexander Bulekov To: qemu-devel@nongnu.org Subject: [PATCH 4/4] docs/fuzz: add instructions for generating a coverage report Date: Mon, 6 Jul 2020 15:55:34 -0400 Message-Id: <20200706195534.14962-5-alxndr@bu.edu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706195534.14962-1-alxndr@bu.edu> References: <20200706195534.14962-1-alxndr@bu.edu> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BL0PR02CA0142.namprd02.prod.outlook.com (2603:10b6:208:35::47) To SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 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: 09ea5f1c-4a0a-4474-3c3b-08d821e69468 X-MS-TrafficTypeDiagnostic: SN6PR03MB3520: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BxDuW013vZTgU6zH3XBtSwJ5m5lMSt64RGixa+EQpA49SmLwtIi6If2iy11R4OwwznLPjxh579ydZxRQdXQWWTJwTV39r0pepJBPa2qLs0vVc4NPWb4JwIeMWT705k54Y5+lVBhbdWKalzVRvw9n6UtqFHjmxZRMYVKjRIHV2Ldl6lr8c6oPfcbrl96DpEIqEiwE7OVswzg1LcZd0fP89gX6DlvIMQmkDpGXHqD0j3kPvqJS1nTT10wcaMIeAwcJmVz0AMIpLvMrkQdITGwXhiBy9OHCV00QAdWx54l0/E04//QHzvEp1wjSuzSttA7mvufw7XAjgc2NeUJj07Mc9w== 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)(396003)(39860400002)(136003)(346002)(376002)(83380400001)(16526019)(26005)(8676002)(66476007)(66556008)(7696005)(4326008)(786003)(75432002)(478600001)(8936002)(66946007)(1076003)(36756003)(86362001)(52116002)(316002)(6666004)(2906002)(186003)(5660300002)(6916009)(6486002)(956004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: SyuJXLuFBf/X95cLHEqvS2I+4rjU8+mX6H/PbeP13RTUAqqgVmC9hlEkdsekntAIeT/jPh6iRPSBNEN8LgnRSoZs85Ny8kJ0DpnSLBT3D61pNmvjMtWr3Oe0oCdh4Nx1vWN9MuTR5ZkHVV2+KihNJtYYjY5y6mn4pIRRslQ57qx5KI6yrRmo8MzSZlvCfUewlQ6l/5M/ZdX+59NPg9CfActVMMFXEtg0hO8FK02kt7dVAnlh9U11zA6PEr0iFIn3rivp4JEWFEklO9vOc5A34yizexr8fdaC/ruJPHhlkfRUh7F2xcRyZGkCKQK/w+Fy9ghaqbP5YaFxNRWF3imr4qZyYcTD2wdbQuPp09aDKrsdpvcPE1s5U9Lppjhz+x4/+ljOjlrQyLsR7Di1ntuvdHv4lDg9juk47xkEZr6L9qs1QmPK+KL6i/L9E3shR6OznmQ0jNJTJwVfItgDkNeOfVWJM7DWytTgYq7ZEQtGgX0= X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 09ea5f1c-4a0a-4474-3c3b-08d821e69468 X-MS-Exchange-CrossTenant-AuthSource: SN6PR03MB3871.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 19:55:49.3256 (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: n7lDkZimlQDU8RgaxJVmQbEKn4xhVdB0LH/yrAChXR7jaF6e7fZ5BBrVeKpJPZfN X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3520 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.244.126; envelope-from=alxndr@bu.edu; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 15:56:21 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001, SPF_PASS=-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: Alexander Bulekov , bsd@redhat.com, philmd@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @bushare.onmicrosoft.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Alexander Bulekov --- docs/devel/fuzzing.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt index 284d57f8fd..a9816ffce9 100644 --- a/docs/devel/fuzzing.txt +++ b/docs/devel/fuzzing.txt @@ -85,6 +85,25 @@ better coverage performance, depending on the target. Note that libFuzzer's exact behavior will depend on the version of clang and libFuzzer used to build the device fuzzers. =20 +=3D=3D Generating Coverage Reports =3D=3D +Code coverage is a crucial metric for evaluating a fuzzer's performance. +libFuzzer's output provides a "cov: " column that provides a total number = of +unique blocks/edges covered. To examine coverage on a line-by-line basis we +can use Clang coverage: + + 1. Configure libFuzzer to store a corpus of all interesting inputs (see + CORPUS_DIR above) + 2. ./configure the QEMU build with: + --enable-sanitizers \ + --extra-cflags=3D"-fprofile-instr-generate -fcoverage-mapping" + 3. Re-run the fuzzer. Specify $CORPUS_DIR/* as an argument, telling libfu= zzer + to execute all of the inputs in $CORPUS_DIR and exit. Once the process + exits, you should find a file, "default.profraw" in the working direct= ory. + 4. Execute these commands to generate a detailed HTML coverage-report: + llvm-profdata merge -output=3Ddefault.profdata default.profraw + llvm-cov show ./path/to/qemu-fuzz-i386 -instr-profile=3Ddefault.profdata \ + --format html -output-dir=3D/path/to/output/report + =3D=3D Adding a new fuzzer =3D=3D Coverage over virtual devices can be improved by adding additional fuzzers. Fuzzers are kept in tests/qtest/fuzz/ and should be added to --=20 2.26.2