From patchwork Mon Jul 6 19:55:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Bulekov X-Patchwork-Id: 278404 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 500D8C433E0 for ; Mon, 6 Jul 2020 19:58:37 +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 1BF70207D0 for ; Mon, 6 Jul 2020 19:58:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=bushare.onmicrosoft.com header.i=@bushare.onmicrosoft.com header.b="TjnygGXP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BF70207D0 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]:48486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsXG8-0007JA-E5 for qemu-devel@archiver.kernel.org; Mon, 06 Jul 2020 15:58:36 -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 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; 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 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> 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 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 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alexander Bulekov --- 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 detection. This results in a large page-map, and a much slower fork(). To build the fuzzers, install a recent version of clang: -Configure with (substitute the clang binaries with the version you installed): +Configure with (substitute the clang binaries with the version you installed). +Here, enable-sanitizers, is optional but it allows us to reliably detect bugs +such as out-of-bounds accesses, use-after-frees, double-frees etc. - CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing + CC=clang-8 CXX=clang++-8 /path/to/configure --enable-fuzzing \ + --enable-sanitizers Fuzz targets are built similarly to system/softmmu: From patchwork Mon Jul 6 19:55: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: 278405 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 76E7EC433DF for ; Mon, 6 Jul 2020 19:57:30 +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 42DDD2084C for ; Mon, 6 Jul 2020 19:57:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=bushare.onmicrosoft.com header.i=@bushare.onmicrosoft.com header.b="pdkdlH9L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42DDD2084C 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]:43832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsXF3-00052O-Gy for qemu-devel@archiver.kernel.org; Mon, 06 Jul 2020 15:57:29 -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 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; 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 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> 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 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 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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=1 Now the only thing left to do is wait for the fuzzer to trigger potential crashes. +== Useful libFuzzer flags == + +As mentioned above, libFuzzer accepts some arguments. Passing -help=1 will list +the available arguments. In particular, these arguments might be helpful: + +$CORPUS_DIR/ : Specify a directory as the last argument to libFuzzer. libFuzzer +stores each "interesting" input in this corpus directory. The next time you run +libFuzzer, it will read all of the inputs from the corpus, and continue fuzzing +from there. You can also specify multiple directories. libFuzzer loads existing +inputs from all specified directories, but will only write new ones to the +first one specified. + +-max_len=4096 : specify the maximum byte-length of the inputs libFuzzer will +generate. + +-close_fd_mask={1,2,3} : close, stderr, or both. Useful for targets that +trigger many debug/error messages, or create output on the serial console. + +-jobs=4 -workers=4 : These arguments configure libFuzzer to run 4 fuzzers in +parallel (4 fuzzing jobs in 4 worker processes). Alternatively, with only +-jobs=N, libFuzzer automatically spawns a number of workers less than or equal +to half the available CPU cores. Replace 4 with a number appropriate for your +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=1 : For each comparison operation, libFuzzer computes +(caller_pc&4095) | (popcnt(Arg1 ^ Arg2) << 12) and places this in the coverage +table. Useful for targets with "magic" constants. If Arg1 came from the fuzzer'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=1 : 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. + == Adding a new fuzzer == Coverage over virtual devices can be improved by adding additional fuzzers. Fuzzers are kept in tests/qtest/fuzz/ and should be added to