Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp518488imm; Fri, 11 May 2018 02:00:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZql3v0fLLrh4XJLl1UFxyGmSWAcApX3ZnFjmTdyJrXQyY/Z49SJFvgVPCReCyYjWVT63Kk1 X-Received: by 2002:a17:902:407:: with SMTP id 7-v6mr4720599ple.47.1526029253249; Fri, 11 May 2018 02:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526029253; cv=none; d=google.com; s=arc-20160816; b=LjbRcc/laN+A6NUFcnrHPeE+XtZ/VffLSdt//2/A/1x6Yaxn/dhQxuVEc1KsVN2Jl8 KkjUL99r4oaWIEgW4++wmjFgQIoL+ukzPiwtbwR5CRn+LY5/fl/N+iD2T2n1bdi1qz0c 42BB5S6mo0WXsBgSCqePYUHp7Fxvr9Jt5GL1QZ3xejXUJFJgVoPN9BFcfiTW61nbjn5Y nln3dBXo5xlXVjHLK686sPyvtnkOQOS2EgBTXb3Jb3yFo4lfnvo9jyjrRAlR/NxsrLnE eKhCfX4zYl0vSJb2jEyKc6k+34dniUBH1EBQP33KDX/8mkGDH5kqNOA1mKT0Dqk4Dmta fMjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=62Xt6Su6INO48wEe6M2txS3tZ1CSpxzgoZQrWKPe55o=; b=gAX7ESbc4fQOh4TEDzLfILw8kFo2cpElfW2ZFvu2cDgYPWaI+XcVse8DVg8S2kVFxk PVKXPkoxDyLOq1iDbAkGTwTIAMcgEydhzM0s3+z9n1zDSnDuJnYsXOXG9XyhIN4VBM0b O8XJfW7qTDURrWUPud/6Oy1fXmohccqt6XxJIDX5tE4vFIp+O+9tnv0lnmnEQFiq39XX snZgCbMUWSRfXpM4/QfbTvyhYko9QAgwx7gupW8czmd1gmlJT9JIMYvd83nHKnEdx4T+ KKSrKi+Y1Ro/rq43zwmNMP7xRbZ5r3mNtTeueMsD48AsDaEcLdJcDRkp47nC8q96H5eT VsQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=u3czgcKg; 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=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17-v6si2719527pff.301.2018.05.11.02.00.38; Fri, 11 May 2018 02:00:53 -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=@google.com header.s=20161025 header.b=u3czgcKg; 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=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752833AbeEKJAS (ORCPT + 99 others); Fri, 11 May 2018 05:00:18 -0400 Received: from mail-pl0-f53.google.com ([209.85.160.53]:36014 "EHLO mail-pl0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752547AbeEKJAP (ORCPT ); Fri, 11 May 2018 05:00:15 -0400 Received: by mail-pl0-f53.google.com with SMTP id v24-v6so2939541plo.3 for ; Fri, 11 May 2018 02:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=62Xt6Su6INO48wEe6M2txS3tZ1CSpxzgoZQrWKPe55o=; b=u3czgcKg00Rl31JuZJrjnrxIVsSxsjwh6WTO1FtwyGT7MHt5F76CXVj/ZrpHpielUv TmJX8C/eHfG44yxuvNH98IcMb/m6lxYGbU7h6gcSb6NYR0kd2TjR6u+6peN2HQ3ZqkwU WDiE5Hi5sqIQ1D/1kOcUSJLnESoOK/bkputITi0YISwuBItfehWRf3OSgfc0SSyEVCsB D4A9k6NJlqxuXc5U5GxthYlhth6SAEnt5dILPLt8Bs0mSdglxWnbLAW786VTxE/thXRa GQXr882rott/zxNTKP9YFw0NSpZRcoPYs4RAvJDCi7o1ut/vXCv+5Cb6YaitohrOBJNL RY+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=62Xt6Su6INO48wEe6M2txS3tZ1CSpxzgoZQrWKPe55o=; b=jmgAOqYxmprtx/M/W2j8YjI6WSiZ8P+Lx1cN6dbasmPsVnQOcs+9EpQ4LYc0bTy9TA 47J3ugD0HLK+DDEfskbMO5NmG5ceOoW+5qTcshUD4fM21RI6/dMarzI/0p9Ea9xms+qR UYvjC45J9Z7yTe6aXEMIaE5R/MpG/VO9hRRfv8folTDWSFXUqQ7z+kyKh2ZMFvMlXVyl I9rBWBG8MDbYWYQ1uxhNW4r938pon3B3CTDt+rUb1XfnzD8qKQpL9jqTkZelusa5HSDt Y6atMwO25i5HLQd5b4QHAYrhhil3C/VUYN7nkOVPFGPhrHYdTtR6mdA6cycStH7Fr5bA 011Q== X-Gm-Message-State: ALKqPwcXVN7p8n5Ekg7se68oKEw2TpMmv0csLcrIrcVMa58unA4Y1eNe JuiOIl1dKZdLi4PhVm8imb2MgABLxdKSH1kGkv5jhQ== X-Received: by 2002:a17:902:2a43:: with SMTP id i61-v6mr4783382plb.54.1526029214059; Fri, 11 May 2018 02:00:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.149.24 with HTTP; Fri, 11 May 2018 01:59:53 -0700 (PDT) In-Reply-To: <20180509232254.GQ10363@dastard> References: <20180406161053.GF7500@magnolia> <95c1400b-94f2-1af4-2d5d-c61c274c28ff@sandeen.net> <9f8d657c-7f42-7bd9-4477-6c3addf16dee@sandeen.net> <9adacfed-0de6-cb94-bf14-3e639678a02a@sandeen.net> <20180509232254.GQ10363@dastard> From: Dmitry Vyukov Date: Fri, 11 May 2018 10:59:53 +0200 Message-ID: Subject: Re: WARNING: bad unlock balance in xfs_iunlock To: Dave Chinner Cc: Eric Sandeen , "Darrick J. Wong" , syzbot , LKML , linux-xfs@vger.kernel.org, syzkaller-bugs , "Theodore Ts'o" , syzkaller Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 10, 2018 at 1:22 AM, Dave Chinner wrote: > On Wed, May 09, 2018 at 10:43:05AM +0200, Dmitry Vyukov wrote: >> Does "xfstests fuzzing infrastructure" use coverage-guidance? > > It's guided manually to fuzz a substantial proportion of the fields > in the on-disk format that are susceptible to fuzzing bqased > attacks. It's not complete coverage yet, but it's getting better and > better, and we're finding more problems from it that random bit > based fuzzing has ever uncovered. > > Also, the xfstests fuzzing defeats the CRC protection now built into > the metadata, which means it can exercise all the new filesystem > features that random bit fuzzers cannot exercise. That's the problem > with fuzzers like syzbot - they can only usefully fuzz the legacy > filesystem format which doesn't have CRC validation, nor many of the > other protections that the current filesystem format has to detect > corruption. This will also allow us to test things like online > repair of fuzzed structures.... syzkaller has 2 techniques to deal with checksums, if you are interested I can go into more detail. > Random bit perturbation filesystem image fuzzing was state of the > art ~10 years ago. They were made redundant by filesystems like > XFS and ext4 adding metadata CRC checking ~5 years ago. The legacy > filesystem formats are essentially unfixable, and it's largely a > waste of time to be trying to make them robust against random bit > fuzzing because such random bit corruptions (like the syzbot images) > do not occur in the real world. Note there are also specifically crafted images that can be automounted whenever one plugs something into USB. > IOWs, we've had to advance the "state of the art" ourselves because > nobody else in the fuzzing world responded to the fact we've > essentially defeated random bit image fuzzing. Not only that, we > have our own infrastructure that produces repeatable, understandable > and debuggable failures, and this is something that many 3rd party > fuzzing efforts do not provide us with. > >> If not, it would be useful to add. Among some solutions there are >> LibFuzzer (https://llvm.org/docs/LibFuzzer.html), AFL > >> (http://lcamtuf.coredump.cx/afl/), kernel-fuzzing >> (https://github.com/oracle/kernel-fuzzing). I don't know how >> xfstests fuzzing works, so I can't say what would be more suitable >> there. > > I think only AFL would be a usable infrastructure, but it would > require being taught about the ondisk format so it could perturb the > image in ways that are useful to modern filesystem formats. Lots(!) > of work, and it's not clear it would do any better than what we > already have. > > Given the results we're getting from our own fuzzers, I don't see > much point in (XFS developers) investing huge amounts of effort to > make some other fuzzer equivalent to what we already have. If > someone else starts fuzzing the current format (v5) XFS filesystems > and finding problems we haven't, then I'm going to be interested in > their fuzzing tools. But (guided) random bit perturbation fuzzing > of legacy filesystem formats is really not that useful or > interesting to us right now. Just asked. Note that coverage-guidance does not necessary mean bit flipping. syzkaller combines coverage-guidance with grammar-awareness and other smartness. Based on our experience with network testing, main advantage of syzkaller over just feeding blobs as network packets (even if these blobs are built in a very smart way) is the following. syzkaller can build complex interactions between syscalls, external inputs and blobs. For example, handling of external network packets depend on if there is an open socket on that port, what setsockopts were called, if there is a pending receive, what flags were passed to that receive, were some data sent the other way, etc. For filesystems that would be various filesystem syscalls executed against the mounted image, concurrent umount, rebind, switch to read-only mode, etc. But maybe xfstests do this too, I don't know. Do they?