From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8toc-0002Aj-3H for linux-um@lists.infradead.org; Mon, 02 Mar 2020 22:45:35 +0000 Received: by mail-pg1-x543.google.com with SMTP id t24so526600pgj.7 for ; Mon, 02 Mar 2020 14:45:33 -0800 (PST) Date: Mon, 2 Mar 2020 14:45:30 -0800 From: Kees Cook Subject: Re: [PATCH v3 4/7] init: main: add KUnit to kernel init Message-ID: <202003021439.A6B6FD8@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200228012036.15682-5-brendanhiggins@google.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Brendan Higgins Cc: linux-arch@vger.kernel.org, alan.maguire@oracle.com, linux-kselftest@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, sboyd@kernel.org, richard@nod.at, jdike@addtoit.com, linux-doc@vger.kernel.org, linux-um@lists.infradead.org, mcgrof@kernel.org, rppt@linux.ibm.com, logang@deltatee.com, kunit-dev@googlegroups.com, davidgow@google.com, skhan@linuxfoundation.org, akpm@linux-foundation.org, yzaikin@google.com, Frank Rowand , linux-kernel@vger.kernel.org, anton.ivanov@cambridgegreys.com On 2/27/20 7:20 PM, Brendan Higgins wrote: > Remove KUnit from init calls entirely, instead call directly from > kernel_init(). > > Co-developed-by: Alan Maguire > Signed-off-by: Alan Maguire > Signed-off-by: Brendan Higgins > Reviewed-by: Stephen Boyd > [...] > diff --git a/init/main.c b/init/main.c > index ee4947af823f3..7875a5c486dc4 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -104,6 +104,8 @@ > #define CREATE_TRACE_POINTS > #include > > +#include > + > static int kernel_init(void *); > > extern void init_IRQ(void); > @@ -1444,6 +1446,8 @@ static noinline void __init kernel_init_freeable(void) > > do_basic_setup(); > > + kunit_run_all_tests(); > + > console_on_rootfs(); > > /* I'm nervous about this happening before two key pieces of the kernel setup, which might lead to weird timing-sensitive bugs or false positives: async_synchronize_full() mark_readonly() 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? -- Kees Cook _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um