Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp921445ybt; Wed, 24 Jun 2020 14:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHwGXB2fns7WvzVol25GsZhfgNjFdCn2qFmlszns1og6uoHLTRTgoEEVdUoJVS7O+VRLTe X-Received: by 2002:aa7:d64b:: with SMTP id v11mr18482497edr.381.1593035676199; Wed, 24 Jun 2020 14:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593035676; cv=none; d=google.com; s=arc-20160816; b=XPjLvslBCmvKuf+U+7ieFF+EihuxPHot/IHJgdcoKqUFS5bjq31ekyfPWHOCT6++uQ h+mCdJfmSfYELo8QGGftTi8OHhAfRWLnO84AiBJCPeIspBQ3zm+o4urgEB3sLk2xEtMH Faxtw/CLUXrgqH6hhnCdtoe0htAoLgH530RcUi7fd3bumDhXUyyMrZZoHUVKI2qEHu7C N4vzQ7MpTg6Zctr9u/FcYnkvPEsaeCyR8wcP/QlcGHtfL6Y3AqdiqJ0in+LsoCGXHGHa sbkJ1SUZBNJhBfrbwAGFcihpPsEDmhHM/7aRmqt+60pvPRmE7Tl9VzW1d1aGQkng0p0W s1GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mEB3lYAl4SsCrlV3BTMPre2pXq7ZML14cKlVh3L5q6Y=; b=KIThsNybuC5QAtLWs6bPCLFF0qyewm14LMajxZ4JLh4EjWTMV6TdrbmiayRP7Ouy5V K35QqeSblui/tOnFaJVEITpGEwmqrjtWFMLxI+o8vMmm6TTTaHHrVOL77/PCnYJBJPHc BokwnoFBGbPB85b0PaDm6nzCKZCiesgL1/lQsh94cp8QMRpdzybbIPzB0JfHAdCvqtym j5c4M/oxYCHqV2Rz+N+mjrWqdXoz3Q5YfDeNd98urlppPM58I/eHLjCE0wrdB38456R0 sQt2ZDytx4QQs6b57wxpzrXue06YJYnpGkQqV/0JDtPE5YvRjoWlN8HKxzagCI6u6JnT xzpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lhCo7Ce8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si13155053ejq.532.2020.06.24.14.53.59; Wed, 24 Jun 2020 14:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lhCo7Ce8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389960AbgFXUsR (ORCPT + 99 others); Wed, 24 Jun 2020 16:48:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389886AbgFXUsQ (ORCPT ); Wed, 24 Jun 2020 16:48:16 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE590C061796 for ; Wed, 24 Jun 2020 13:48:15 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id h185so1772505pfg.2 for ; Wed, 24 Jun 2020 13:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mEB3lYAl4SsCrlV3BTMPre2pXq7ZML14cKlVh3L5q6Y=; b=lhCo7Ce8+px/1qsZVVvWEvl8b17OyY0VZ6phH6kNRqcIOvtIYFe0Bosc/F3kgxiZAE hIt8Ui2UgLPzKPs5Pu8zXZBkVSaIoZREtMw1R5nWAh47Ns+jsFMToC89jWQxGRUdKYXP CSG99NaJzj43AQOQGF2aC1BQwpgpJnQXPq1No= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mEB3lYAl4SsCrlV3BTMPre2pXq7ZML14cKlVh3L5q6Y=; b=LaGX3KD+OO5SmKDlByP+PkZoow+vszwPTAgM+ameuu/0/Ow3eKPqFSzX293JoLE1Id ta2/Cn3EvCI8W81OLZiA1PGJuJCPa43PmGIC28y7AJglqGF+vt3MaMx0zNUWMg6qu+Iy OiR2hxQ4qoyE8/R2drWvaQEf5YxD+4wBNJK9s0P1UU0sEulgF6WQrRgI5Z6dKgrmiP4h UxjT8G8inNvEQnKIJx9g8M+p5PgsmnOHPU/NMRxzkzSY+XTX/ZmhWH7DliRoxGEAcEK0 NGPzOCHpaV/tOXvtCfu0kTFKFJrFJ638zlV2hDe6cF5E9EwUtikTVno7zlN98VwH2C1M VcOA== X-Gm-Message-State: AOAM532hIpfdTCGamzwI7PejzdsnWVQWVYeys59Naicfj0XqK/VxENhv vLT/pQqX2pzFIgdkV7ixgGdNMg== X-Received: by 2002:a63:be01:: with SMTP id l1mr23945501pgf.32.1593031695265; Wed, 24 Jun 2020 13:48:15 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id n11sm17739270pgm.1.2020.06.24.13.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 13:48:14 -0700 (PDT) Date: Wed, 24 Jun 2020 13:48:13 -0700 From: Kees Cook To: Brendan Higgins Cc: Frank Rowand , Jeff Dike , Richard Weinberger , Anton Ivanov , Arnd Bergmann , Shuah Khan , Alan Maguire , Iurii Zaikin , David Gow , Andrew Morton , rppt@linux.ibm.com, Greg KH , Stephen Boyd , Logan Gunthorpe , Luis Chamberlain , linux-um , linux-arch@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , "open list:DOCUMENTATION" Subject: Re: [PATCH v3 4/7] init: main: add KUnit to kernel init Message-ID: <202006241345.43D22CB261@keescook> References: <20200228012036.15682-5-brendanhiggins@google.com> <202003021439.A6B6FD8@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 01:20:35PM -0700, Brendan Higgins wrote: > On Mon, Mar 2, 2020 at 2:45 PM Kees Cook wrote: > > Now, I realize kunit tests _should_ be self-contained, but this seems > > like a possible robustness problem. Is there any reason this can't be > > moved after rcu_end_inkernel_boot() in kernel_init() instead? > > I tried that, but it doesn't work without an initramfs. We could add I'm curious to know what happened. To me it looks like it would be possible to do it in here: system_state = SYSTEM_RUNNING; numa_default_policy(); rcu_end_inkernel_boot(); do_sysctl_args(); put it here? if (ramdisk_execute_command) { ret = run_init_process(ramdisk_execute_command); That should be before anything happens with an initramfs. (i.e. boot the kernel without an initrd and it won't be required...) > an initramfs for KUnit at some point if highly desired, but I think > that is outside the scope of this patchset. Additionally, this patch > actually moves running tests to later in the init process, which is > still an improvement over the way KUnit works today. Later is better! :) > There are some other reasons I wouldn't want to make that change right > now, which will become apparent in a patch that I will send out in > short order. Cool; I'll look for it. -- Kees Cook