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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D860ECAAD1 for ; Sat, 27 Aug 2022 04:17:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232623AbiH0ERf (ORCPT ); Sat, 27 Aug 2022 00:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiH0ERd (ORCPT ); Sat, 27 Aug 2022 00:17:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 744CD73933; Fri, 26 Aug 2022 21:17:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E99B460A39; Sat, 27 Aug 2022 04:17:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 299E8C433D6; Sat, 27 Aug 2022 04:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661573851; bh=6Iz/eGwmp2OnF5aKahMz1qTW0tTKm7mlFOFhFDxX1AA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0wwPwPqYjbGm6Ce5o/Y1H+DJmaTo4tbspFfmRDrZEp4vlLxYw57ALtc0CXFnvMbGh VFCSnWNxDc7JkINYWGfzPhl/loGQPXhQADf4HucY5q1H3K85IqB7J0Fx6rs5x3gQei vqaTpKDnySwwiXOltZ9lClnMZEmM8Ob5p56kBsi0= Date: Fri, 26 Aug 2022 21:17:29 -0700 From: Andrew Morton To: Alexander Potapenko Cc: Alexander Viro , Alexei Starovoitov , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 04/44] x86: asm: instrument usercopy in get_user() and put_user() Message-Id: <20220826211729.e65d52e7919fee5c34d22efc@linux-foundation.org> In-Reply-To: <20220826150807.723137-5-glider@google.com> References: <20220826150807.723137-1-glider@google.com> <20220826150807.723137-5-glider@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Aug 2022 17:07:27 +0200 Alexander Potapenko wrote: > Use hooks from instrumented.h to notify bug detection tools about > usercopy events in variations of get_user() and put_user(). And this one blows up x86_64 allmodconfig builds. > --- a/arch/x86/include/asm/uaccess.h > +++ b/arch/x86/include/asm/uaccess.h > @@ -5,6 +5,7 @@ > * User space memory access functions > */ > #include > +#include > #include > #include > #include instrumented.h looks like a higher-level thing than uaccess.h, so this inclusion is an inappropriate layering. Or maybe not. In file included from ./include/linux/kernel.h:22, from ./arch/x86/include/asm/percpu.h:27, from ./arch/x86/include/asm/nospec-branch.h:14, from ./arch/x86/include/asm/paravirt_types.h:40, from ./arch/x86/include/asm/ptrace.h:97, from ./arch/x86/include/asm/math_emu.h:5, from ./arch/x86/include/asm/processor.h:13, from ./arch/x86/include/asm/timex.h:5, from ./include/linux/timex.h:67, from ./include/linux/time32.h:13, from ./include/linux/time.h:60, from ./include/linux/stat.h:19, from ./include/linux/module.h:13, from init/do_mounts.c:2: ./include/linux/page-flags.h: In function 'page_fixed_fake_head': ./include/linux/page-flags.h:226:36: error: invalid use of undefined type 'const struct page' 226 | test_bit(PG_head, &page->flags)) { | ^~ [25000 lines snipped] And kmsan-add-kmsan-runtime-core.patch introduces additional build errors with x86_64 allmodconfig. This is all with CONFIG_KMSAN=n I'll disable the patch series. Please do much more compilation testing - multiple architectures, allnoconfig, allmodconfig, allyesconfig, defconfig, randconfig, etc. Good luck, it looks ugly :(