From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88C22C3F2CE for ; Sun, 1 Mar 2020 06:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61E8A214DB for ; Sun, 1 Mar 2020 06:39:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uigv0uke" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725945AbgCAGjf (ORCPT ); Sun, 1 Mar 2020 01:39:35 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:35451 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbgCAGjf (ORCPT ); Sun, 1 Mar 2020 01:39:35 -0500 Received: by mail-qk1-f193.google.com with SMTP id 145so7156362qkl.2 for ; Sat, 29 Feb 2020 22:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3vMiqgqrTzNOns9tPGStxdXw3VsNXtcnvGdYEqnF7WI=; b=uigv0ukeQk6L1xGAaG9zsLq0Hf/aCjLtTWnwjAowPansSH38LcfJha2ytFwRFzHTBO MORDKB0ahQBrsBDvQ1KDy6ECljLXB91prPacbqckjAI29pyPCMmHjUAZWs8H0yTLA3ky 9n8NUpjlefsvmZewQuKgMd+qLaTVXnKyMXDQ/gRfAy+X5g4IcHwjBTUalG9+RsCPwMbY NjURC/jcepaMCeQXlEPQuxOEG6zn0VsA6ZidamhGP9OUqGfFAaq5dZfR6FnoQGX9ktN4 WtiaWF69csP/SNKZiqaYlzM6U+98R0Q/g8NkIEp3quS4QjGhk/3O3fwl/FsZkqLFaalO dBuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3vMiqgqrTzNOns9tPGStxdXw3VsNXtcnvGdYEqnF7WI=; b=OE9J+dujtqaK0PLuGt+cla72fgxlxUm7dw7L136ltdH2yM9DPHDRWrKF954hecHjcg aGvZjmEnTRPcPOlnCqXvsVUu3WrF79jVf37PJABnBiuN3x28SqOKfgQBkXKxITM5Qi1U 5jn/uQcuDxa6PwAuB/bEUy7qJYJYYUXcpNZ5WGczkJx66dIrxYliclFWuq9/Zj8OR7vg IN0vMZ8zjNKzIdvqtzUilQzre8TWF2oTAS34dpXZC5oDn+zETluPhUFxnY2/sHf4iO0C uWTj4U6jhfrw4X4dSeNhT5B7XK5mKeUJPA7iZhM83akaAH7vkp0q5j6ysB5oZVp8aphF ifCQ== X-Gm-Message-State: APjAAAVnvVbQnwVDNGFTLC4FEedyTQilEC+j2WP4j5tT+m64j+3ROCb9 HRj54nPH+Ivw/12XbjIGRoFYHwcWXReta/++cGl/5g== X-Google-Smtp-Source: APXvYqzJDtPI/Dw6AapENwdGNYeXdu95wuDXGOjoQGKY45dZnz92J1JJy/hetlHT1u0pcKpSQL8PLSWAC0j2AabNZrI= X-Received: by 2002:a37:7c47:: with SMTP id x68mr11627985qkc.8.1583044773747; Sat, 29 Feb 2020 22:39:33 -0800 (PST) MIME-Version: 1.0 References: <20200227024301.217042-1-trishalfonso@google.com> In-Reply-To: From: Dmitry Vyukov Date: Sun, 1 Mar 2020 07:39:22 +0100 Message-ID: Subject: Re: [RFC PATCH 1/2] Port KASAN Tests to KUnit To: Patricia Alfonso , Kees Cook Cc: Andrey Ryabinin , Brendan Higgins , David Gow , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , LKML , kasan-dev , "open list:KERNEL SELFTEST FRAMEWORK" , kunit-dev@googlegroups.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, Feb 29, 2020 at 2:56 AM Patricia Alfonso wrote: > On Thu, Feb 27, 2020 at 6:19 AM Dmitry Vyukov wrote: > > > > .On Thu, Feb 27, 2020 at 3:44 AM Patricia Alfonso > > > - pr_info("out-of-bounds in copy_from_user()\n"); > > > - unused = copy_from_user(kmem, usermem, size + 1); > > > > Why is all of this removed? > > Most of these tests are hard earned and test some special corner cases. > > > I just moved it inside IS_MODULE(CONFIG_TEST_KASAN) instead because I > don't think there is a way to rewrite this without it being a module. You mean these are unconditionally crashing the machine? If yes, please add a comment about this. Theoretically we could have a notion of "death tests" similar to gunit: https://stackoverflow.com/questions/3698718/what-are-google-test-death-tests KUnit test runner wrapper would need to spawn a separete process per each such test. Under non-KUnit test runner these should probably be disabled by default and only run if specifically requested (a-la --gunit_filter/--gunit_also_run_disabled_tests). Could also be used to test other things that unconditionally panic, e.g. +Kees may be happy for unit tests for some of the hardening/fortification features. I am not asking to bundle this with this change of course.