Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1036118rwe; Fri, 26 Aug 2022 22:12:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR4xB2b+hH520wfPMTaPJsLNL38/ETYqCxivOe9Ud1fRDV+6NQO7UnIqCr0NZ3KpuOKKw9Px X-Received: by 2002:a17:902:ab08:b0:173:320e:3316 with SMTP id ik8-20020a170902ab0800b00173320e3316mr6551503plb.38.1661577135620; Fri, 26 Aug 2022 22:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661577135; cv=none; d=google.com; s=arc-20160816; b=FpQ9P6NB3THzN2Rt0g91w4V1RZH0cOkPSfm2LSyxTlw9/eKEPMZbfKgpslkyawQqdu opRCU521lrfI0sITYtOpxlmYOq5HfiNX6XXPamNJYoLxgOO/9ArbpXpkf2K8KNjKGd4H hAGFR+mJ3H0PXbWLpw1gHdyIPiVcmyjRTq7xge2PiZC4t6vhePX7QpafGKJ1wrnvFRmf Tigk21E3u/L3LfCyep+P4ts/uYdqnayNaUfiFt6qqbvRGvzuavIQqvNW6eFagmhfRy4W fs7LhlDgO5hF44dGkwjuWaeSrDNc8DoSwoyCT4zUz0ZuE/MLBPAiOJp05/pY1kfA0nFJ lkOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YXKY7xUH+e8MljL5ktdAuQHuT8m/c8UeQSkKo/fZ3pM=; b=t6BZE1iGgYIfmMA8lx2TXcuXGna7nh4VUwAyTiXKPoWpXQkGyhXK3vNrqvtZ3AEQRy Mzz963PkeGnSyvRgUAbGqUSIlfoSx8Of7kB+lViwIfzQE4KNDmieF8NsLxRvgqQfWfQS uk41+VwIcOGK/vs3xJaCLH2vflB+NV9w4BjdabGkmsySyCwyHKLPG6fxqM9SPJ7kfr6A 3tO0j9eau6ClV14XWeIOSlYf+nvA3pmW+A4ZgUWetguM+ibes6nr3goJ4OwR5s9On4Iv 8PVY0+6wE2A81uFg1ql+zdaifzjbW5qzwYpxzT2t9mHHtEutsZlBfHPDDxKUGCUdVkls ZI9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=0wwPwPqY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a056a000a8a00b0052f7fb6f2desi3821615pfl.154.2022.08.26.22.12.03; Fri, 26 Aug 2022 22:12:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=0wwPwPqY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232363AbiH0ERe (ORCPT + 99 others); Sat, 27 Aug 2022 00:17:34 -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 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 :(