Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2658979imm; Mon, 24 Sep 2018 07:59:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV607mUmKbNko7AoFRrdlAeIsX5+3ThzXUOy2FO+v79w4Kivmn+3bsM8eUBTsQYba49eMI7NG X-Received: by 2002:a63:e806:: with SMTP id s6-v6mr9843100pgh.176.1537801145448; Mon, 24 Sep 2018 07:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537801145; cv=none; d=google.com; s=arc-20160816; b=vUl0vNQI/WWynzpbdty1ml1NdS5POsxh3cuxE5ZogG/vcBC3dpRkvAhKzWVgDteU9j AvcE/lMutTfrqLolK6Wu8igEupAsXvtkEOiEVBtL9T514cRTcff+68Z3yPi3agZZG7jg B0BFwaYpRPjNxQtmYPDcaK+eUIFTOwi7vaNN5VgG+PMbl5kZtMki7J2ex343RvtWjB/Z Zyx2jHDzgdMPneX/NSw8ftW7/jJcLEg9ODnLKihi1txfIqU1Aa1TSsKQ3YroL8AEU9Fg A6WUhXzvHH1vi1xYCFmA/wkumeqfvUp2O/1KRiZBw7fLHKB5Vp5dRjHxoFo3ezyzKWkp bXWQ== 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; bh=MTQ1NShy3bxgeWoHM3ppxoyzRgZbW/MIott7aAlB6Nk=; b=uzvTZDEvlCi2GHjC7GPU7NusiH37BYA/X6G1/kZF9y2zkWw3VtmNso0cmwb/NAmV2C cV6adRHPOLVsIIT3v4P+JKybXHoKfrP0hnjQHBEa/21MKBVFTAWjdUOBuDQBf9Ylhkno ERDRxgkyuoGAr7eAj8LY8uUhY8OTEuCt5kc7jEiehRxi47sYLT04jJ73hlF+HIGX2xAR eO6p2B1mDfHJV7LGJMhN02GRRc3MI/iAJl6+IcWAnnweEFW4+kyRSVxDIlgqi+bIS06S Zd3sX0/RJbgc9LpDVdwRPaGXEKn0xPM5ghYIlGQzse/zKt9/5oxbK0EX+qDkOK82Kir4 bcug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XqzdjxtZ; 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 j134-v6si11299848pgc.134.2018.09.24.07.58.11; Mon, 24 Sep 2018 07:59:05 -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=XqzdjxtZ; 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 S1730537AbeIXTpD (ORCPT + 99 others); Mon, 24 Sep 2018 15:45:03 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:55371 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727816AbeIXTpD (ORCPT ); Mon, 24 Sep 2018 15:45:03 -0400 Received: by mail-it1-f193.google.com with SMTP id c23-v6so2401346itd.5 for ; Mon, 24 Sep 2018 06:42:48 -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=MTQ1NShy3bxgeWoHM3ppxoyzRgZbW/MIott7aAlB6Nk=; b=XqzdjxtZctxlHUWndXjitFY+KxuBLGHVOV3w1Hn92FPxkYs8EXAS7oNbr7E95zLt20 hoDAMDbhQNAL5D9bJ9WczMhgGyoYPfwR90a3bjk7JBWOiQB93wH1Kx4TNX2VBeo0N2aM kNS7Fp+KcCt+VYIwVDOWd0tjntsJlhBG1et/RNjCKKS1l0/kJU38cLhFbbL4OF0yQiy8 ykFgCvSHnnjpQ2KS16kvzrfBheq1iAHQaoyF7A8RdK9qA6rJaCa9jyxUgTea/2kQ4S77 h3V2EVB6Vo6KO7SJ7Rzo5XnbFPtfXyezy6IabRLaI5wzKWO7HZDGRTTK7ZqhSvxgOJQ+ q90w== 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=MTQ1NShy3bxgeWoHM3ppxoyzRgZbW/MIott7aAlB6Nk=; b=FGDvWI8CqZoaP0iZUG5rPhAdDWPqJEO9ltSmSj/JEV2tJUj7tiNCr/ccT9cnlpJOWu 05PD9Cx8RS5sxo3ASTIb11kodcyK6aeezZk0sP84hhe8LcRYSoO17bdmBNPeE/3/1mg1 xMqwJQXI7r3DfviWYeTALZTM+eDcWem6SU5Q/xnUnT5ZRXr2rYdl1unrAquFsoY1Nx23 yPOdPEXbpPK+xWw+CqXb4howXwSAScubUxgxepOxPIAPcEOjo8KmjeRBTxFnbqb7vnAn GIT5EqTwNOPL0q/L6MhXGAcCtYMSu2NdYDoR5l38S9n4Pywhxya9XAoL41Jx5anS+aJF IvZA== X-Gm-Message-State: APzg51Ai74jIK6QivgYhVdC/Ecwe4Rhlyl9pPm1Xy3gKdDoHIMuejN+P ghBxsGITITE7OLh1aK/mHqnxws688Sz8631MigSyxw== X-Received: by 2002:a02:c04e:: with SMTP id u14-v6mr9503177jam.110.1537796568200; Mon, 24 Sep 2018 06:42:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:ab8c:0:0:0:0:0 with HTTP; Mon, 24 Sep 2018 06:42:27 -0700 (PDT) In-Reply-To: <20180922125256.GB14042@bombadil.infradead.org> References: <20180922125256.GB14042@bombadil.infradead.org> From: Dmitry Vyukov Date: Mon, 24 Sep 2018 15:42:27 +0200 Message-ID: Subject: Re: [Announce] LPC 2018: Testing and Fuzzing Microconference To: Matthew Wilcox Cc: Dhaval Giani , Sasha Levin , LKML , Greg Kroah-Hartman , alice.ferrazzi@gmail.com, Kevin Hilman , Tim Bird , Laura Abbott , Steven Rostedt , gustavo.padovan@collabora.co.uk, "Carpenter,Dan" , knut.omang@oracle.com 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 Sat, Sep 22, 2018 at 2:52 PM, Matthew Wilcox wrote: > On Wed, Sep 19, 2018 at 10:13:15AM -0700, Dhaval Giani wrote: >> Sasha and I are pleased to announce the Testing and Fuzzing track at >> LPC [ 1 ]. We are planning to continue the discussions from last >> year's microconference [2]. Many discussions from the Automated >> Testing Summit [3] will also continue, and a final agenda will come up >> only soon after that. >> >> Suggested Topics >> >> - Syzbot/syzkaller >> - ATS >> - Distro/stable testing >> - kernelci >> - kernelci auto bisection >> - Unit testing framework >> >> We look forward to other interesting topics for this microconference >> as a reply to this email. > > I would like to talk about the IDA test suite that was recently merged. > See lib/test_ida.c. It can be built as a module (CONFIG_TEST_IDA=m), > built-in (=y) or built in userspace (as part of the radix tree test > suite for historical reasons) along with the current kernel code. > > Being able to build the test suite in userspace allows for much more > rapid development. Building it in kernel space offers testing across > a wide range of configurations that I don't have access to and can't > necessarily simulate well in userspace. > > My userspace implementation of kmalloc() simulates failures (in a rather > heavy-handed way; every non-GFP_KERNEL allocation fails). That's rather > harder to simulate in kernel space. I'd like there to be a way for a > kernel space test suite to ask for kmalloc failures so that the failure > paths can be tested. Hi Matthew, kmalloc fault injection is already implemented with CONFIG_FAULT_INJECTION. For original fault injection, you more-or-less ask to fail X% of allocations at random. It's great for testing servers for stability, but not so well suited for testing. Recently I've added so-called "systematic" fault injection (/proc/thread-self/fail-nth) which is perfect for unit testing. It allows to ask to fail N-th allocation request in the current task. So a unit test for a syscall can do: for (i = 0;; i++) { write(/proc/thread-self/fail-nth, i); syscall_under_test(); if (read(/proc/thread-self/fail-nth) != 0) break; } which allows to examine each failure site one-by-one systematically (without making random processes on the machine fail too). > I think the idea of building parts of the core kernel libraries in > userspace and testing them there has greater generality than just the > IDA, IDR, XArray & radix tree and might profitably be adopted by other > parts of lib/. The userspace simulation of other parts of the kernel > may well need to be extended. This would be great. Besides providing faster turn-around time, this allow us to finally have something like: make test [subsystem] which will run all tests for the subsystem locally (in parallel, giving final OK/FAIL). This is not possible to in-kernel tests, because they require a machine and an image, and it's not possible to support everything that people use.