Received: by 10.213.65.68 with SMTP id h4csp2381117imn; Mon, 9 Apr 2018 02:33:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+61DljZgG2KiHkC7/tCx6L715WrxJ7aAIB8HljykEq5ZCfqsR/OFGIBE2psD5erU3rOI3j X-Received: by 10.99.176.12 with SMTP id h12mr24440921pgf.448.1523266401592; Mon, 09 Apr 2018 02:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523266401; cv=none; d=google.com; s=arc-20160816; b=DQhHizajCYZ+732pyS+ZGEm3JeYA3mTv0A6M7qGBN0XBZhvdUZsXpp8+5bOnWt5n3F 2Y8jRTHOyKBSp2AolDPDxTVMKgXEh2uEei3lKqPftbXPJ4/FHzGrTeFKfoU4iADDyJQP aWfu9AH4DxoK0Zk8GVF/e9G1qdsJn8M1MregvNq+EvjrUiTXoZAEj/wjJPRGSpQwQuN6 WDskqWfiriXycvi9d1FQYMVyAxAr8uAI7V88tyNvGW8g0vTfyeiKFkFD8w7hOrW3gfhL Rxp/gRFAyz1QVJB0bofE9Ljjmar1JseIKT1KwNh7Y8aFzzTaaUmjDiv3lxa7sjlBDvEp 4jbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ydZwdJX6KT1m1/hgvlMGK81ydPxRLUzsZ6IV9Hcyo9I=; b=ycDNckECP5wcapSoCnCgnD9JiuoYzg+Z9W1iZfUmLK8ga9/C8xIDDmPVUQHTKoaynt m0kCZMQ8miboB4e17vtb7YAI9OL5fDa3l7Tc/EPab0fsz+MTdjQaYRRtvrTn6+x2mRZ7 pT+tfSIMqlwGhTSfSmXU6fVSzudSUufpQLBmAkcSK7C6eVnuV2I6FMRohV7GxRSSKO4/ ebBjf9KV9csD88b1CuKIDZpCQ1c3ROBkccTjl4G638+eyHa0R6s9jpBGl5zRuBgcUkeT lab1olIyKLFrxY5wkLUcq/p7ZLYlqFqa7ZQnXEjLrhC2XzdDo+pkT3chSilKIh4MUQoN yxqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XkBYJRmv; 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 x190si11064521pgx.159.2018.04.09.02.32.43; Mon, 09 Apr 2018 02:33:21 -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=XkBYJRmv; 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 S1751744AbeDIJ3W (ORCPT + 99 others); Mon, 9 Apr 2018 05:29:22 -0400 Received: from mail-pl0-f42.google.com ([209.85.160.42]:41644 "EHLO mail-pl0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbeDIJ3U (ORCPT ); Mon, 9 Apr 2018 05:29:20 -0400 Received: by mail-pl0-f42.google.com with SMTP id bj1-v6so4750693plb.8 for ; Mon, 09 Apr 2018 02:29:20 -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; bh=ydZwdJX6KT1m1/hgvlMGK81ydPxRLUzsZ6IV9Hcyo9I=; b=XkBYJRmv8Hn29O2/3bzdbzF+iwmatGMWdDwQ7q3CWigaqDzbi75mj2OOTI2vM4qRtS 5Tdx2bGT16Iil3eeboV9GKVWxazdP3gw8d/4+zA9hMvcfXFChLMgCXQMueTMEU3KHOVg X/H8Jcqte1IQ3Xmw3aSRdE02P1AQVbVTFqu7n1kyFQlEcwgCb6QtbjjITVvKDjEIt6Ef vog3l5W5VP1dDAgfJvd8BfN/jNLscUPy7KZpKOsogRXx8m8f2fO42b0pGvzxCiIVTuFQ 5uhpvLRt20RzjeoR/s6ak9OvAxic4rhufj3tEiAowchXNvQQ/aMuw8r9sForVPMAbVko E3cw== 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; bh=ydZwdJX6KT1m1/hgvlMGK81ydPxRLUzsZ6IV9Hcyo9I=; b=DVS1IlW1jW3zFPJEdsosmpTMrHVhTffKGLBR7VuEFKOYHQ9aduk1diagDgfkgHmLwy 5zxyW1YBaWkrkiehHCyPNFfQxiJL2AcJJX0qMzxA+e+O1lkGLqvMzqcxvz6BnHomGJ/a KkSEwC3cIMr1DQJ1HakF8dYFZxsDom9OTbg8Y9AroRoXSZibqfRIXvsuRU41ShpzaGx5 DGnGPYUqfDG+dK7sHJfg3AiTo5rvEwZxDcS1mpmKdaHXN24odlutinhFEvu5ZssCUyYc 1zOJ2UBcxEooACtFmQ1VyeFpI8z0SqmV7slWaUThyMF1iCvUW9a3mUGYilrth97QF42r RdIg== X-Gm-Message-State: ALQs6tB38sYC4Jg6kelL00c4d3bsrY5lpiha3DYMAnsQmR0Jdp1evKL5 dpxvQpUULCBRfp3spUAt+ZeH1iTj6aouYqTR5ipFmw== X-Received: by 2002:a17:902:8e8c:: with SMTP id bg12-v6mr744607plb.295.1523266159640; Mon, 09 Apr 2018 02:29:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.182.136 with HTTP; Mon, 9 Apr 2018 02:28:59 -0700 (PDT) In-Reply-To: <20180408180252.GC9720@thunk.org> References: <001a1148578c10e4700568e814eb@google.com> <20180404193504.GA7715@bombadil.infradead.org> <20180405032200.GC22358@thunk.org> <20180405032454.GD9301@bombadil.infradead.org> <20180405223226.GA729@dastard> <20180406001325.GA133204@google.com> <20180406013741.GA7345@thunk.org> <20180408063114.GB9720@thunk.org> <20180408180252.GC9720@thunk.org> From: Dmitry Vyukov Date: Mon, 9 Apr 2018 11:28:59 +0200 Message-ID: Subject: Re: Running syzkaller repros using kvm-xfstests To: "Theodore Y. Ts'o" , Dmitry Vyukov , Eric Biggers , Dave Chinner , Matthew Wilcox , linux-fsdevel , LKML , syzkaller , Al Viro 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 Sun, Apr 8, 2018 at 8:02 PM, Theodore Y. Ts'o wrote: > On Sun, Apr 08, 2018 at 03:18:39PM +0200, Dmitry Vyukov wrote: >> >> But note that syzkaller is under active development, so pre-canned >> binaries may not always work. Mismatching binary may not understand >> all syscalls, fail to parse program, interpret arguments differently, >> execute program differently, setup a different environment for the >> test, etc. Now a C program captures all of this, because code that >> transforms syzkaller programs into C is versioned along with the rest >> of the system. >> Strictly saying, for syzkaller reproducers one needs to use the exact >> syzkaller revision listed along with the reproducer, see for example: >> https://syzkaller.appspot.com/bug?id=3fb9c4777053e79a6d2a65ac3738664c87629a21 >> The "#syz test" styzbot command does this. Using a different syzkaller >> revision may or may not work. > > Thanks for the warning. I assume you try to maintain backwards > compatibility where possible? It might be nice if you could add some > kind of explicit versioning scheme --- perhaps with a major/minor > version scheme where the syz-executor needs to have the same major > number, and a minor number >= the minor version number of the test? We try to not break backwards compatibility without a reason. Preserving full backwards compatibility within a single binary is extremely hard. It's like asking kernel to support each and every ever existed version of every in-memory data structure and all of the non-functional aspects (like any fluctuations in performance). If one could give us several additional FTEs for this, then it might be doable. But even then I don't think it's the best use of the FTE time because version control system already gives us exactly this -- exact behavior on a past revision. On top of this, the backward compatibility support will sure have bugs too. In the best case we will spent time debugging why a new version does not precisely model behavior of an old version. In the worst case you will test something and think that the bug is fixed, but it's just that the new version does not behave exactly as the old one. On top of this, this still does not give us forward compatibility, something that one wants in majority of cases with an old pre-canned binary. On top of this, the binaries will be huge because they will need to capture exact versions of all system call descriptions (and the simplest option for this is keeping copies all versions), a 87 MiB image definitely won't be enough to hold this, the binary will be somewhere between gigs and tens of gigs. > One of the reasons why the C program is not so useful for me is that > in the Repeat:true case, the C program repeats forever. So for > example, I translate Repeat:true to -repeat=100. See: > > https://github.com/tytso/xfstests-bld/blob/master/kvm-xfstests/test-appliance/files/usr/local/bin/run-syz > > I suppose I could just abort the test after N minutes and assume if > the kernel hasn't crashed, that it's probably not going to. But some > way that the C program can be given an argument or an environment > variable to control how number of loops it will run might be useful. > And some kind of hint as how reliable the repro would be (e.g,. some > indication that you should try to run it at least N times to get a > failure at least 95% of the time). I think: timeout -s KILL 450 ./a.out is the solution. Repro logic runs programs for at most 7.5 minutes, so 450 should be good. Re env var. There are opposite views too. People complain that syzkaller C repros are mess (which they are). Currently they complain minimal amount of code to reproduce the bugs. If we also start staffing some aux logic in them, it won't be helpful. timeout command looks just as good.