Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4286957ybl; Tue, 20 Aug 2019 09:36:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5wTALp3nFcHoKBNSU9wyVGrg+L52fold8t3BYOuweaZIAft8VNN79Vp26mZ+n171qQzEZ X-Received: by 2002:a17:90a:9905:: with SMTP id b5mr918474pjp.70.1566319010979; Tue, 20 Aug 2019 09:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566319010; cv=none; d=google.com; s=arc-20160816; b=n0oDZ0wWLhPOLfUX7MTysJ2KX9j89kF8BX9vVfL6T25h5pJjnXaRmlueKn8QoPXdiJ CYjdQvEM7zGnMZ9B78OqNQhCRTKRf+X8JsKHlA54FfRmfUN52oeCv95so4iXXHu4RhbQ cWU1zyeEbK1vO2u9iOD35XKJzzxo8U1yGivh7T3PiGwDbIBUwmrmOaHcROIAOsUF8/Mx 4ZJyfA+RwAvH4vf1QweqmxmKXJR+QHfGQ4nYxc7wv8bREcocXIYZZMAAlEP6qreP3pL7 yrBMuky6sg4xNOCVGhciJAXSWl8dTca7lir+Uz6Dc2/heKk8FtxXx/ciMQxYb4y7zpnw o1pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=o9vRKnpFEnLbPLxepx60AGesPRvtXbUJjyPA3Au598I=; b=H0NkbVD+piXb/q9Ew09CB8s3eZ/M9UT4tteOCH8O3e/PAZyiQxDzguw0wlq3oleWFs 71vHrBy1K/EcQ+JOPbkepVKCMwecmQyzX7dpjgvhIQC0g/nEln279qtOA5eSc6vUg97P mrdV4QUJWX/AGfQm7y2SMBwy84thERS2tzqvvwtyX8icqi6YUYwwPOXsi961wGfl58b5 p5LpFO1wWhDMNQ0w+LlylffxpmOq630LGEEy9ckSpw9RGm9zkkS7PnWHoohfCTCj1JUK ijDxo14aAEqYc8sVnnnGv4HL8Bw+Nd+vQfR25DBfTmx3RN7lJATIlS7ti7yEfPxsrqZv oHjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=B+zO8fhN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si12295824pgk.384.2019.08.20.09.36.35; Tue, 20 Aug 2019 09:36:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=B+zO8fhN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=aol.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729991AbfHTQfl (ORCPT + 99 others); Tue, 20 Aug 2019 12:35:41 -0400 Received: from sonic308-18.consmr.mail.ir2.yahoo.com ([77.238.178.146]:33252 "EHLO sonic308-18.consmr.mail.ir2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbfHTQfk (ORCPT ); Tue, 20 Aug 2019 12:35:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1566318938; bh=o9vRKnpFEnLbPLxepx60AGesPRvtXbUJjyPA3Au598I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=B+zO8fhNU6IuuMsi6QgPfUMZ/MCqtCI4vBm6C+gJTG9qGcDiX/bevSJsT45fUOsO+yl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YciDjBUAQXyDSi5yj3mQX2xIMJBaEq VLuaBMDI0V8k1p14Hk.TIxt3NF4xw7CBePIyXeqbwX3oubvxaJ5LhAH6FhEZ.fokNIH0DucaBB5x OoBpIGGd5edCK0ZXz3sb6BykLSvI8YyA_cJYpGeFRCjXIl98uidC1_n5x6YxmjrC7qTKuT3HlUlB CVLcD7tjYnrTIwIAMiYitVR4Rk2K0KPAhnVR9Pa1qBGDRTA.A5TVeOK2zkBwhUmItDNmpPU5igft goQpojWo_tob9niY0s2HjbEi3bixfspaAmKByR.g5OiDdRq26Vs3yI8u5OqsaJuLx58Kxkt1AfSU opLZudlYDVU_vb1pA55RojioK9ce7W3d2fmBWRer.VqkLfShjFS8gJ2.3L0puRmu8HdpsTUqCfC3 F36JyHEF9NikVEuwWNwiZFs9281R.V7dPlvwnr_4Ag4HTVle3a4uoxM5lb1LTWoy7fyh_bvDkHNn WITbxyf_gZsE9n8Oowu2csrRoPvp_BMptqizu_w-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ir2.yahoo.com with HTTP; Tue, 20 Aug 2019 16:35:38 +0000 Received: by smtp405.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID add83dbc90a00add290994e4b332bea6; Tue, 20 Aug 2019 16:35:33 +0000 (UTC) Date: Wed, 21 Aug 2019 00:35:08 +0800 From: Gao Xiang To: "Theodore Y. Ts'o" Cc: Chao Yu , Qu Wenruo , "Darrick J. Wong" , Christoph Hellwig , Eric Biggers , Richard Weinberger , Greg Kroah-Hartman , Jan Kara , Dave Chinner , David Sterba , Miao Xie , devel , Stephen Rothwell , Amir Goldstein , linux-erofs , Al Viro , Jaegeuk Kim , linux-kernel , Li Guifu , Fang Wei , Pavel Machek , linux-fsdevel , Andrew Morton , torvalds Subject: Re: [PATCH] erofs: move erofs out of staging Message-ID: <20190820163504.GA7780@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20190818162201.GA16269@infradead.org> <20190818172938.GA14413@sol.localdomain> <20190818174702.GA17633@infradead.org> <20190818181654.GA1617@hsiangkao-HP-ZHAN-66-Pro-G1> <20190818201405.GA27398@hsiangkao-HP-ZHAN-66-Pro-G1> <20190819160923.GG15198@magnolia> <20190819203051.GA10075@hsiangkao-HP-ZHAN-66-Pro-G1> <20190820155623.GA10232@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820155623.GA10232@mit.edu> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ted, On Tue, Aug 20, 2019 at 11:56:23AM -0400, Theodore Y. Ts'o wrote: > On Tue, Aug 20, 2019 at 10:24:11AM +0800, Chao Yu wrote: > > Out of curiosity, it looks like every mainstream filesystem has its own > > fuzz/injection tool in their tool-set, if it's really such a generic > > requirement, why shouldn't there be a common tool to handle that, let specified > > filesystem fill the tool's callback to seek a node/block and supported fields > > can be fuzzed in inode. It can help to avoid redundant work whenever Linux > > welcomes a new filesystem.... > > The reason why there needs to be at least some file system specific > code for fuzz testing is because for efficiency's sake, you don't want > to fuzz every single bit in the file system, but just the ones which > are most interesting (e.g., the metadata blocks). For file systems > which use checksum to protect against accidental corruption, the file > system fuzzer needs to also fix up the checksums (since you can be > sure malicious attackers will do this). I personally agree with your idea, some fs specfic code needed at least. > > What you *can* do is to make the file system specific portion of the > work as small as possible. Great work in this area is Professor Kim's > Janus[1][2] and Hydra[2] work. (Hydra is about to be published at SOSP 19, > and was partially funded from a Google Faculty Research Work.) For EROFS, it's a special case since it is a RO fs, and erofs mkfs will generate reproducable images (which means, for one dir trees, it only generates exact one result except for build time). For this reason (read only), the fastest way to do fault injection for EROFS is to modify mkfs and inject some faults when writing each metadata to the generated images, that is all what I'm done that night. I think it has similar effect since EROFS is an RO fs for some given dirs (except for it cannot modify a specfic field from a given image, but from its source dir). Actually I found 6 issues related with corrupted compressed images, and it can now run smoothly for about an hour. https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/commit/?h=experimental-fuzzer What we will do next is to develop an independent fuzzer, which need the ability of parsing the filesystem image (which share common code with erofs-fuse to parse the filesystem) and then it can inject some faults to the original image. > > [1] https://taesoo.kim/pubs/2019/xu:janus.pdf > [2] https://github.com/sslab-gatech/janus > [3] https://github.com/sslab-gatech/hydra > > > > Personally speaking, debugging tool is way more important than a running > > > kernel module/fuse. > > > It's human trying to write the code, most of time is spent educating > > > code readers, thus debugging tool is way more important than dead cold code. > > I personally find that having a tool like e2fsprogs' debugfs program > to be really handy. It's useful for creating regression test images; > it's useful for debugging results from fuzzing systems like Janus; > it's useful for examining broken file systems extracted from busted > Android handsets during dogfood to root cause bugs which escaped > xfstests testing; etc. Yes, what I want to say is that these fses (ext4, xfs, btrfs, ...) do awesome work by many people for many time. But I personally have 2 hand, 24 hours (including work hours) a day only. I will refer to these debugfs / xfs_db / btrfs ins dump-tree great work to get your experience and develop our EROFS tools. I learn a lot from this topic. Thanks, Gao Xiang > > Cheers, > > - Ted