Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3175185ybl; Mon, 19 Aug 2019 13:33:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLmCeWfRUY5hD4q6L1SDxZLPJtfYbnAY9k0y73n5XJ8BwK5gDu9XuiarYTcHkkwde4nqRS X-Received: by 2002:a17:90a:dc82:: with SMTP id j2mr23257361pjv.89.1566246815531; Mon, 19 Aug 2019 13:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566246815; cv=none; d=google.com; s=arc-20160816; b=yhfY0gUIqIw6wb6NTuKI24qv3mB6FRnl96EBBopF7DK191q0y9GK8Ot8Z2Uf+3/9HS fui69GckOXAsDJWtkIXhxeIVUGcRF0kIRY4IBmWZ/YhliEYLXpHhZkGROfQFA7FMGJcw ZOYV+l0KdMS/TdiM7eKvMZhxkyCeN42/WPtGDyPnHFRs/c8ius6Jt7AwSWL/1ZA091js rQdGZV5wuVSzVpP/WRlP6imLWI9jL2ChI7qaN1DIgIYl341NnMYcbXk0+J6ZHeH70Y58 kCw1KYtAmjjE5BBdmwOu1fD+vA+aeOPUTBI8OcA26bI9VrHAvtGt7xvhKi69NMX2DlJS aDQg== 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=njtX/1gQOuZJ8x+D/bPD6qmpv4bUeLjYu756qxFnLJg=; b=G2ETSUhLlwxPVqUrDqQ6Bm1/s66Oj341gSbjc4CmKc0Yk1NjYO4PKkdDBRMuJ5SP5B 7AsBxAE78UjslNggwTQVHcddE5SLecFMhAqOVPTjc/A3HtYfVppS277642pywdXU//Xi nXlqLxKTAdwUNK4/q5fC9b5CcM2vXAbNsucaMMvITXavncb/Di+SVdHhR+AiKt9GNfNm xkdM2LO5RGWPl6LA0Q5jbqpqMpUQQPATsOnmwv84g6XAArARKPRutlVtEkT96gGKbYI8 vbIP3y4pMBeHr7cSPMpZ10jXQ/Yz2evmhYbHid0nrbdo+dERAz92zvj5SCdaZle96KQn oKQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aol.com header.s=a2048 header.b=UqwoNxkO; 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 n14si11311980pfq.108.2019.08.19.13.33.19; Mon, 19 Aug 2019 13:33:35 -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=UqwoNxkO; 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 S1728395AbfHSUbO (ORCPT + 99 others); Mon, 19 Aug 2019 16:31:14 -0400 Received: from sonic305-21.consmr.mail.ir2.yahoo.com ([77.238.177.83]:42699 "EHLO sonic305-21.consmr.mail.ir2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728255AbfHSUbO (ORCPT ); Mon, 19 Aug 2019 16:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1566246671; bh=njtX/1gQOuZJ8x+D/bPD6qmpv4bUeLjYu756qxFnLJg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=UqwoNxkOLsELf2H+0ricyNKFddngxwjkdxfdbFNGbRuaBKUhtU04Lc7m3P45n/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N6Agi6wXqw4jhRsRq6gJOGyTX8Nxwn6Jsh1tFKULnaduAW4Y1W5d8fAfjWoKtVNbPyvdV GE55bNHnGVJyEB1_IuRJHmFEFX8xrP4k4YcgvqKfnGp31Fvsb5xvWP8cOauVovDQMRXfGG6uzys2 xS8B.RJ61Zx0WGo_aWYYKzK5WO1UC9_PTfYuXeP31yfA1MZoI_YeWqe60yRnzbQvb6OtNaGoBpaB rfHmvJgzKhiu8hP5xxTxSI9cRkWE.cmSOR50.zWw_YzwJf1ybPohs6_.lDP9ecKqzt.k1kMU1uSB 2o3uFDYVEoVbYoSGam3N5Y9OH7.DTfOsXlP9CyxqcJvf2U3D8YUD8xtQWbsoAqc62WZeHPtrGcxK KdLuCS0A4sXTMGlTphsOuIuCs_JoWRVbMVl8zt7K0YbHOWUnt2ioP4z3qXXuZFzHoGMpKjvMJc_c 9LMtARbJuRBdx9h_EHxkR8yNetLrCiA1eFFNg.tykfGyZYUGf1_pa6mBdkZjmOMJfrO7Bn2IXUKP 0XacAltv0_hVPfsYeu3TkqngJxpWE Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ir2.yahoo.com with HTTP; Mon, 19 Aug 2019 20:31:11 +0000 Received: by smtp421.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 08b49598277d5feef885e8f543c497a0; Mon, 19 Aug 2019 20:31:07 +0000 (UTC) Date: Tue, 20 Aug 2019 04:30:56 +0800 From: Gao Xiang To: "Darrick J. Wong" Cc: Christoph Hellwig , "Theodore Y. Ts'o" , Eric Biggers , Richard Weinberger , Greg Kroah-Hartman , Jan Kara , Chao Yu , 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: <20190819203051.GA10075@hsiangkao-HP-ZHAN-66-Pro-G1> References: <790210571.69061.1566120073465.JavaMail.zimbra@nod.at> <20190818151154.GA32157@mit.edu> <20190818155812.GB13230@infradead.org> <20190818161638.GE1118@sol.localdomain> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190819160923.GG15198@magnolia> 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 Darrick, On Mon, Aug 19, 2019 at 09:09:23AM -0700, Darrick J. Wong wrote: > On Mon, Aug 19, 2019 at 04:14:11AM +0800, Gao Xiang wrote: > > Hi all, > > > > On Mon, Aug 19, 2019 at 02:16:55AM +0800, Gao Xiang wrote: > > > Hi Hch, > > > > > > On Sun, Aug 18, 2019 at 10:47:02AM -0700, Christoph Hellwig wrote: > > > > On Sun, Aug 18, 2019 at 10:29:38AM -0700, Eric Biggers wrote: > > > > > Not sure what you're even disagreeing with, as I *do* expect new filesystems to > > > > > be held to a high standard, and to be written with the assumption that the > > > > > on-disk data may be corrupted or malicious. We just can't expect the bar to be > > > > > so high (e.g. no bugs) that it's never been attained by *any* filesystem even > > > > > after years/decades of active development. If the developers were careful, the > > > > > code generally looks robust, and they are willing to address such bugs as they > > > > > are found, realistically that's as good as we can expect to get... > > > > > > > > Well, the impression I got from Richards quick look and the reply to it is > > > > that there is very little attempt to validate the ondisk data structure > > > > and there is absolutely no priority to do so. Which is very different > > > > from there is a bug or two here and there. > > > > > > As my second reply to Richard, I didn't fuzz all the on-disk fields for EROFS. > > > and as my reply to Richard / Greg, current EROFS is used on the top of dm-verity. > > > > > > I cannot say how well EROFS will be performed on malformed images (and you can > > > also find the bug richard pointed out is a miswritten break->continue by myself). > > > > > > I posted the upstream EROFS post on July 4, 2019 and a month and a half later, > > > no one can tell me (yes, thanks for kind people reply me about their suggestion) > > > what we should do next (you can see these emails, I sent many times) to meet > > > the minimal upstream requirements and rare people can even dip into my code. > > > > > > That is all I want to say. I will work on autofuzz these days, and I want to > > > know how to meet your requirements on this (you can tell us your standard, > > > how well should we do). > > > > > > OK, you don't reply to my post once, I have no idea how to get your first reply. > > > > I have made a simple fuzzer to inject messy in inode metadata, > > dir data, compressed indexes and super block, > > https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/commit/?h=experimental-fuzzer > > > > I am testing with some given dirs and the following script. > > Does it look reasonable? > > > > # !/bin/bash > > > > mkdir -p mntdir > > > > for ((i=0; i<1000; ++i)); do > > mkfs/mkfs.erofs -F$i testdir_fsl.fuzz.img testdir_fsl > /dev/null 2>&1 > > mkfs fuzzes the image? Er.... Thanks for your reply. First, This is just the first step of erofs fuzzer I wrote yesterday night... > > Over in XFS land we have an xfs debugging tool (xfs_db) that knows how > to dump (and write!) most every field of every metadata type. This > makes it fairly easy to write systematic level 0 fuzzing tests that > check how well the filesystem reacts to garbage data (zeroing, > randomizing, oneing, adding and subtracting small integers) in a field. > (It also knows how to trash entire blocks.) Actually, compared with XFS, EROFS has rather simple on-disk format. What we inject one time is quite deterministic. The first step just purposely writes some random fuzzed data to the base inode metadata, compressed indexes, or dir data field (one round one field) to make it validity and coverability. > > You might want to write such a debugging tool for erofs so that you can > take apart crashed images to get a better idea of what went wrong, and > to write easy fuzzing tests. Yes, we will do such a debugging tool of course. Actually Li Guifu is now developping a erofs-fuse to support old linux versions or other OSes for archiveing only use, we will base on that code to develop a better fuzzer tool as well. Thanks, Gao Xiang > > --D > > > umount mntdir > > mount -t erofs -o loop testdir_fsl.fuzz.img mntdir > > for j in `find mntdir -type f`; do > > md5sum $j > /dev/null > > done > > done > > > > Thanks, > > Gao Xiang > > > > > > > > Thanks, > > > Gao Xiang > > >